Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
f5009d6f
Commit
f5009d6f
authored
Dec 07, 2004
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Recommit 9469->9479 + fix wxT/wxU
parent
d8e40e92
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
419 additions
and
449 deletions
+419
-449
modules/access/http.c
modules/access/http.c
+80
-11
modules/codec/cmml/cmml.c
modules/codec/cmml/cmml.c
+22
-7
modules/codec/cmml/intf.c
modules/codec/cmml/intf.c
+6
-12
modules/codec/speex.c
modules/codec/speex.c
+8
-7
modules/demux/mjpeg.c
modules/demux/mjpeg.c
+19
-8
modules/demux/ogg.c
modules/demux/ogg.c
+7
-0
modules/gui/skins2/src/vout_window.hpp
modules/gui/skins2/src/vout_window.hpp
+5
-11
modules/gui/wxwindows/iteminfo.cpp
modules/gui/wxwindows/iteminfo.cpp
+0
-16
modules/gui/wxwindows/playlist.cpp
modules/gui/wxwindows/playlist.cpp
+221
-330
modules/gui/wxwindows/wxwindows.h
modules/gui/wxwindows/wxwindows.h
+41
-38
modules/services_discovery/sap.c
modules/services_discovery/sap.c
+10
-9
No files found.
modules/access/http.c
View file @
f5009d6f
...
@@ -67,6 +67,10 @@ static void Close( vlc_object_t * );
...
@@ -67,6 +67,10 @@ static void Close( vlc_object_t * );
#define RECONNECT_LONGTEXT N_("Will automatically attempt a re-connection " \
#define RECONNECT_LONGTEXT N_("Will automatically attempt a re-connection " \
"in case it was untimely closed.")
"in case it was untimely closed.")
#define CONTINUOUS_TEXT N_("Continuous stream")
#define CONTINUOUS_LONGTEXT N_("Enable this option to read a file that is " \
"being constantly updated (for example, a JPG file on a server)")
vlc_module_begin
();
vlc_module_begin
();
set_description
(
_
(
"HTTP input"
)
);
set_description
(
_
(
"HTTP input"
)
);
set_capability
(
"access2"
,
0
);
set_capability
(
"access2"
,
0
);
...
@@ -81,10 +85,13 @@ vlc_module_begin();
...
@@ -81,10 +85,13 @@ vlc_module_begin();
AGENT_LONGTEXT
,
VLC_FALSE
);
AGENT_LONGTEXT
,
VLC_FALSE
);
add_bool
(
"http-reconnect"
,
0
,
NULL
,
RECONNECT_TEXT
,
add_bool
(
"http-reconnect"
,
0
,
NULL
,
RECONNECT_TEXT
,
RECONNECT_LONGTEXT
,
VLC_TRUE
);
RECONNECT_LONGTEXT
,
VLC_TRUE
);
add_bool
(
"http-continuous"
,
0
,
NULL
,
CONTINUOUS_TEXT
,
CONTINUOUS_LONGTEXT
,
VLC_TRUE
);
add_shortcut
(
"http"
);
add_shortcut
(
"http"
);
add_shortcut
(
"http4"
);
add_shortcut
(
"http4"
);
add_shortcut
(
"http6"
);
add_shortcut
(
"http6"
);
add_shortcut
(
"unsv"
);
set_callbacks
(
Open
,
Close
);
set_callbacks
(
Open
,
Close
);
vlc_module_end
();
vlc_module_end
();
...
@@ -124,8 +131,11 @@ struct access_sys_t
...
@@ -124,8 +131,11 @@ struct access_sys_t
char
*
psz_icy_genre
;
char
*
psz_icy_genre
;
char
*
psz_icy_title
;
char
*
psz_icy_title
;
int
i_remaining
;
vlc_bool_t
b_seekable
;
vlc_bool_t
b_seekable
;
vlc_bool_t
b_reconnect
;
vlc_bool_t
b_reconnect
;
vlc_bool_t
b_continuous
;
vlc_bool_t
b_pace_control
;
vlc_bool_t
b_pace_control
;
};
};
...
@@ -137,6 +147,7 @@ static int Control( access_t *, int, va_list );
...
@@ -137,6 +147,7 @@ static int Control( access_t *, int, va_list );
/* */
/* */
static
void
ParseURL
(
access_sys_t
*
,
char
*
psz_url
);
static
void
ParseURL
(
access_sys_t
*
,
char
*
psz_url
);
static
int
Connect
(
access_t
*
,
int64_t
);
static
int
Connect
(
access_t
*
,
int64_t
);
static
int
Request
(
access_t
*
p_access
,
int64_t
i_tell
);
/*****************************************************************************
/*****************************************************************************
* Open:
* Open:
...
@@ -201,6 +212,7 @@ static int Open( vlc_object_t *p_this )
...
@@ -201,6 +212,7 @@ static int Open( vlc_object_t *p_this )
p_sys
->
psz_icy_name
=
NULL
;
p_sys
->
psz_icy_name
=
NULL
;
p_sys
->
psz_icy_genre
=
NULL
;
p_sys
->
psz_icy_genre
=
NULL
;
p_sys
->
psz_icy_title
=
NULL
;
p_sys
->
psz_icy_title
=
NULL
;
p_sys
->
i_remaining
=
0
;
/* Parse URI */
/* Parse URI */
ParseURL
(
p_sys
,
p_access
->
psz_path
);
ParseURL
(
p_sys
,
p_access
->
psz_path
);
...
@@ -269,6 +281,7 @@ static int Open( vlc_object_t *p_this )
...
@@ -269,6 +281,7 @@ static int Open( vlc_object_t *p_this )
}
}
p_sys
->
b_reconnect
=
var_CreateGetBool
(
p_access
,
"http-reconnect"
);
p_sys
->
b_reconnect
=
var_CreateGetBool
(
p_access
,
"http-reconnect"
);
p_sys
->
b_continuous
=
var_CreateGetBool
(
p_access
,
"http-continuous"
);
/* Connect */
/* Connect */
if
(
Connect
(
p_access
,
0
)
)
if
(
Connect
(
p_access
,
0
)
)
...
@@ -420,6 +433,7 @@ static int Read( access_t *p_access, uint8_t *p_buffer, int i_len )
...
@@ -420,6 +433,7 @@ static int Read( access_t *p_access, uint8_t *p_buffer, int i_len )
return
0
;
return
0
;
}
}
}
}
if
(
p_sys
->
b_chunked
)
if
(
p_sys
->
b_chunked
)
{
{
if
(
p_sys
->
i_chunk
<
0
)
if
(
p_sys
->
i_chunk
<
0
)
...
@@ -454,6 +468,19 @@ static int Read( access_t *p_access, uint8_t *p_buffer, int i_len )
...
@@ -454,6 +468,19 @@ static int Read( access_t *p_access, uint8_t *p_buffer, int i_len )
}
}
}
}
if
(
p_sys
->
b_continuous
&&
i_len
>
p_sys
->
i_remaining
)
{
/* Only ask for the remaining length */
int
i_new_len
=
p_sys
->
i_remaining
;
if
(
i_new_len
==
0
)
{
Request
(
p_access
,
0
);
i_read
=
Read
(
p_access
,
p_buffer
,
i_len
);
return
i_read
;
}
i_len
=
i_new_len
;
}
if
(
p_sys
->
i_icy_meta
>
0
&&
p_access
->
info
.
i_pos
>
0
)
if
(
p_sys
->
i_icy_meta
>
0
&&
p_access
->
info
.
i_pos
>
0
)
{
{
int64_t
i_next
=
p_sys
->
i_icy_meta
-
int64_t
i_next
=
p_sys
->
i_icy_meta
-
...
@@ -472,6 +499,7 @@ static int Read( access_t *p_access, uint8_t *p_buffer, int i_len )
...
@@ -472,6 +499,7 @@ static int Read( access_t *p_access, uint8_t *p_buffer, int i_len )
}
}
i_read
=
net_Read
(
p_access
,
p_sys
->
fd
,
NULL
,
p_buffer
,
i_len
,
VLC_FALSE
);
i_read
=
net_Read
(
p_access
,
p_sys
->
fd
,
NULL
,
p_buffer
,
i_len
,
VLC_FALSE
);
if
(
i_read
>
0
)
if
(
i_read
>
0
)
{
{
p_access
->
info
.
i_pos
+=
i_read
;
p_access
->
info
.
i_pos
+=
i_read
;
...
@@ -489,6 +517,13 @@ static int Read( access_t *p_access, uint8_t *p_buffer, int i_len )
...
@@ -489,6 +517,13 @@ static int Read( access_t *p_access, uint8_t *p_buffer, int i_len )
}
}
else
if
(
i_read
==
0
)
else
if
(
i_read
==
0
)
{
{
if
(
p_sys
->
b_continuous
)
{
Request
(
p_access
,
0
);
p_sys
->
b_continuous
=
VLC_FALSE
;
i_read
=
Read
(
p_access
,
p_buffer
,
i_len
);
p_sys
->
b_continuous
=
VLC_TRUE
;
}
if
(
p_sys
->
b_reconnect
)
if
(
p_sys
->
b_reconnect
)
{
{
msg_Dbg
(
p_access
,
"got disconnected, trying to reconnect"
);
msg_Dbg
(
p_access
,
"got disconnected, trying to reconnect"
);
...
@@ -508,6 +543,11 @@ static int Read( access_t *p_access, uint8_t *p_buffer, int i_len )
...
@@ -508,6 +543,11 @@ static int Read( access_t *p_access, uint8_t *p_buffer, int i_len )
if
(
i_read
==
0
)
p_access
->
info
.
b_eof
=
VLC_TRUE
;
if
(
i_read
==
0
)
p_access
->
info
.
b_eof
=
VLC_TRUE
;
}
}
if
(
p_sys
->
b_continuous
)
{
p_sys
->
i_remaining
-=
i_read
;
}
return
i_read
;
return
i_read
;
}
}
...
@@ -760,6 +800,14 @@ static int Connect( access_t *p_access, int64_t i_tell )
...
@@ -760,6 +800,14 @@ static int Connect( access_t *p_access, int64_t i_tell )
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
return
Request
(
p_access
,
i_tell
);
}
static
int
Request
(
access_t
*
p_access
,
int64_t
i_tell
)
{
access_sys_t
*
p_sys
=
p_access
->
p_sys
;
char
*
psz
;
if
(
p_sys
->
b_proxy
)
if
(
p_sys
->
b_proxy
)
{
{
if
(
p_sys
->
url
.
psz_path
)
if
(
p_sys
->
url
.
psz_path
)
...
@@ -807,6 +855,7 @@ static int Connect( access_t *p_access, int64_t i_tell )
...
@@ -807,6 +855,7 @@ static int Connect( access_t *p_access, int64_t i_tell )
net_Printf
(
VLC_OBJECT
(
p_access
),
p_sys
->
fd
,
NULL
,
net_Printf
(
VLC_OBJECT
(
p_access
),
p_sys
->
fd
,
NULL
,
"Range: bytes="
I64Fd
"-
\r\n
"
,
i_tell
);
"Range: bytes="
I64Fd
"-
\r\n
"
,
i_tell
);
}
}
/* Authentification */
/* Authentification */
if
(
p_sys
->
psz_user
&&
*
p_sys
->
psz_user
)
if
(
p_sys
->
psz_user
&&
*
p_sys
->
psz_user
)
{
{
...
@@ -827,7 +876,17 @@ static int Connect( access_t *p_access, int64_t i_tell )
...
@@ -827,7 +876,17 @@ static int Connect( access_t *p_access, int64_t i_tell )
net_Printf
(
VLC_OBJECT
(
p_access
),
p_sys
->
fd
,
NULL
,
"Icy-MetaData: 1
\r\n
"
);
net_Printf
(
VLC_OBJECT
(
p_access
),
p_sys
->
fd
,
NULL
,
"Icy-MetaData: 1
\r\n
"
);
net_Printf
(
VLC_OBJECT
(
p_access
),
p_sys
->
fd
,
NULL
,
"Connection: Close
\r\n
"
);
if
(
p_sys
->
b_continuous
&&
p_sys
->
i_version
==
1
)
{
net_Printf
(
VLC_OBJECT
(
p_access
),
p_sys
->
fd
,
NULL
,
"Connection: keep-alive
\r\n
"
);
}
else
{
net_Printf
(
VLC_OBJECT
(
p_access
),
p_sys
->
fd
,
NULL
,
"Connection: Close
\r\n
"
);
p_sys
->
b_continuous
=
VLC_FALSE
;
}
if
(
net_Printf
(
VLC_OBJECT
(
p_access
),
p_sys
->
fd
,
NULL
,
"
\r\n
"
)
<
0
)
if
(
net_Printf
(
VLC_OBJECT
(
p_access
),
p_sys
->
fd
,
NULL
,
"
\r\n
"
)
<
0
)
{
{
...
@@ -906,10 +965,19 @@ static int Connect( access_t *p_access, int64_t i_tell )
...
@@ -906,10 +965,19 @@ static int Connect( access_t *p_access, int64_t i_tell )
while
(
*
p
==
' '
)
p
++
;
while
(
*
p
==
' '
)
p
++
;
if
(
!
strcasecmp
(
psz
,
"Content-Length"
)
)
if
(
!
strcasecmp
(
psz
,
"Content-Length"
)
)
{
if
(
p_sys
->
b_continuous
)
{
p_access
->
info
.
i_size
=
-
1
;
msg_Dbg
(
p_access
,
"this frame size="
I64Fd
,
atoll
(
p
)
);
p_sys
->
i_remaining
=
atoll
(
p
);
}
else
{
{
p_access
->
info
.
i_size
=
i_tell
+
atoll
(
p
);
p_access
->
info
.
i_size
=
i_tell
+
atoll
(
p
);
msg_Dbg
(
p_access
,
"stream size="
I64Fd
,
p_access
->
info
.
i_size
);
msg_Dbg
(
p_access
,
"stream size="
I64Fd
,
p_access
->
info
.
i_size
);
}
}
}
else
if
(
!
strcasecmp
(
psz
,
"Location"
)
)
else
if
(
!
strcasecmp
(
psz
,
"Location"
)
)
{
{
if
(
p_sys
->
psz_location
)
free
(
p_sys
->
psz_location
);
if
(
p_sys
->
psz_location
)
free
(
p_sys
->
psz_location
);
...
@@ -936,10 +1004,11 @@ static int Connect( access_t *p_access, int64_t i_tell )
...
@@ -936,10 +1004,11 @@ static int Connect( access_t *p_access, int64_t i_tell )
!
strncasecmp
(
p
,
"Nanocaster"
,
10
)
)
!
strncasecmp
(
p
,
"Nanocaster"
,
10
)
)
{
{
/* Remember if this is Icecast
/* Remember if this is Icecast
* we need to force mp3 in some cases without breaking autodetection */
* we need to force mp3 in some cases without breaking
* autodetection */
/* Let live
365 streams (nanocaster) piggyback on the icecast routine.
/* Let live
65 streams (nanocaster) piggyback on the icecast
* They look very similar */
*
routine.
They look very similar */
p_sys
->
b_reconnect
=
VLC_TRUE
;
p_sys
->
b_reconnect
=
VLC_TRUE
;
p_sys
->
b_pace_control
=
VLC_FALSE
;
p_sys
->
b_pace_control
=
VLC_FALSE
;
...
...
modules/codec/cmml/cmml.c
View file @
f5009d6f
...
@@ -53,7 +53,7 @@ struct decoder_sys_t
...
@@ -53,7 +53,7 @@ struct decoder_sys_t
static
int
OpenDecoder
(
vlc_object_t
*
);
static
int
OpenDecoder
(
vlc_object_t
*
);
static
void
CloseDecoder
(
vlc_object_t
*
);
static
void
CloseDecoder
(
vlc_object_t
*
);
static
void
DecodeBlock
(
decoder_t
*
,
block_t
**
);
static
subpicture_t
*
DecodeBlock
(
decoder_t
*
,
block_t
**
);
static
void
ParseText
(
decoder_t
*
,
block_t
*
);
static
void
ParseText
(
decoder_t
*
,
block_t
*
);
...
@@ -140,17 +140,32 @@ static int OpenDecoder( vlc_object_t *p_this )
...
@@ -140,17 +140,32 @@ static int OpenDecoder( vlc_object_t *p_this )
****************************************************************************
****************************************************************************
* This function must be fed with complete subtitles units.
* This function must be fed with complete subtitles units.
****************************************************************************/
****************************************************************************/
static
void
DecodeBlock
(
decoder_t
*
p_dec
,
block_t
**
pp_block
)
static
subpicture_t
*
DecodeBlock
(
decoder_t
*
p_dec
,
block_t
**
pp_block
)
{
{
subpicture_t
*
p_spu
;
if
(
!
pp_block
||
*
pp_block
==
NULL
)
if
(
!
pp_block
||
*
pp_block
==
NULL
)
{
{
return
;
return
NULL
;
}
}
ParseText
(
p_dec
,
*
pp_block
);
ParseText
(
p_dec
,
*
pp_block
);
block_Release
(
*
pp_block
);
block_Release
(
*
pp_block
);
*
pp_block
=
NULL
;
*
pp_block
=
NULL
;
/* allocate an empty subpicture to return. the actual subpicture
* displaying is done in the DisplayAnchor function in intf.c (called from
* DisplayPendingAnchor, which in turn is called from the main RunIntf
* loop). */
p_spu
=
p_dec
->
pf_spu_buffer_new
(
p_dec
);
if
(
!
p_spu
)
{
msg_Dbg
(
p_dec
,
"couldn't allocate new subpicture"
);
return
NULL
;
}
return
p_spu
;
}
}
/*****************************************************************************
/*****************************************************************************
...
...
modules/codec/cmml/intf.c
View file @
f5009d6f
...
@@ -53,7 +53,6 @@
...
@@ -53,7 +53,6 @@
#undef CMML_INTF_USE_TIMED_URIS
#undef CMML_INTF_USE_TIMED_URIS
#undef CMML_INTF_DEBUG
#undef CMML_INTF_DEBUG
#undef CMML_INTF_SUBPICTURE_DEBUG
#undef CMML_INTF_HISTORY_DEBUG
#undef CMML_INTF_HISTORY_DEBUG
/*****************************************************************************
/*****************************************************************************
...
@@ -149,10 +148,11 @@ void E_(CloseIntf) ( vlc_object_t *p_this )
...
@@ -149,10 +148,11 @@ void E_(CloseIntf) ( vlc_object_t *p_this )
msg_Dbg
(
p_intf
,
"freeing CMML interface"
);
msg_Dbg
(
p_intf
,
"freeing CMML interface"
);
#endif
#endif
/*
E
rase the anchor text description from the video output if it exists */
/*
e
rase the anchor text description from the video output if it exists */
p_vout
=
vlc_object_find
(
p_intf
,
VLC_OBJECT_VOUT
,
FIND_ANYWHERE
);
p_vout
=
vlc_object_find
(
p_intf
,
VLC_OBJECT_VOUT
,
FIND_ANYWHERE
);
if
(
p_vout
)
if
(
p_vout
)
{
{
/* enable CMML as a subtitle track */
spu_Control
(
p_vout
->
p_spu
,
SPU_CHANNEL_CLEAR
,
DEFAULT_CHAN
);
spu_Control
(
p_vout
->
p_spu
,
SPU_CHANNEL_CLEAR
,
DEFAULT_CHAN
);
vlc_object_release
(
p_vout
);
vlc_object_release
(
p_vout
);
}
}
...
@@ -821,9 +821,8 @@ static int DisplayAnchor( intf_thread_t *p_intf,
...
@@ -821,9 +821,8 @@ static int DisplayAnchor( intf_thread_t *p_intf,
if
(
psz_anchor_url
)
if
(
psz_anchor_url
)
{
{
/* Should display subtitle underlined and in blue,
/* Should display subtitle underlined and in blue, but it looks
* but it looks like VLC doesn't implement any
* like VLC doesn't implement any text styles yet. D'oh! */
* text styles yet. D'oh! */
p_style
=
&
blue_with_underline
;
p_style
=
&
blue_with_underline
;
}
}
...
@@ -836,11 +835,6 @@ static int DisplayAnchor( intf_thread_t *p_intf,
...
@@ -836,11 +835,6 @@ static int DisplayAnchor( intf_thread_t *p_intf,
i_margin_h
,
i_margin_v
,
i_now
,
0
)
==
VLC_SUCCESS
)
i_margin_h
,
i_margin_v
,
i_now
,
0
)
==
VLC_SUCCESS
)
{
{
/* Displayed successfully */
/* Displayed successfully */
#ifdef CMML_INTF_SUBPICTURE_DEBUG
msg_Dbg
(
p_intf
,
"subpicture created at (%d, %d) (%d, %d)"
,
p_subpicture
->
i_x
,
p_subpicture
->
i_y
,
p_subpicture
->
i_width
,
p_subpicture
->
i_height
);
#endif
}
}
else
else
{
{
...
...
modules/codec/speex.c
View file @
f5009d6f
...
@@ -463,7 +463,7 @@ static aout_buffer_t *DecodePacket( decoder_t *p_dec, ogg_packet *p_oggpacket )
...
@@ -463,7 +463,7 @@ static aout_buffer_t *DecodePacket( decoder_t *p_dec, ogg_packet *p_oggpacket )
return
NULL
;
return
NULL
;
}
}
i_ret
=
speex_decode
(
p_sys
->
p_state
,
&
p_sys
->
bits
,
i_ret
=
speex_decode
_int
(
p_sys
->
p_state
,
&
p_sys
->
bits
,
(
int16_t
*
)
p_aout_buffer
->
p_buffer
);
(
int16_t
*
)
p_aout_buffer
->
p_buffer
);
if
(
i_ret
==
-
1
)
if
(
i_ret
==
-
1
)
{
{
...
@@ -483,8 +483,9 @@ static aout_buffer_t *DecodePacket( decoder_t *p_dec, ogg_packet *p_oggpacket )
...
@@ -483,8 +483,9 @@ static aout_buffer_t *DecodePacket( decoder_t *p_dec, ogg_packet *p_oggpacket )
}
}
if
(
p_sys
->
p_header
->
nb_channels
==
2
)
if
(
p_sys
->
p_header
->
nb_channels
==
2
)
speex_decode_stereo
(
(
int16_t
*
)
p_aout_buffer
->
p_buffer
,
speex_decode_stereo_int
(
(
int16_t
*
)
p_aout_buffer
->
p_buffer
,
p_sys
->
p_header
->
frame_size
,
&
p_sys
->
stereo
);
p_sys
->
p_header
->
frame_size
,
&
p_sys
->
stereo
);
/* Date management */
/* Date management */
p_aout_buffer
->
start_date
=
aout_DateGet
(
&
p_sys
->
end_date
);
p_aout_buffer
->
start_date
=
aout_DateGet
(
&
p_sys
->
end_date
);
...
@@ -744,7 +745,7 @@ static block_t *Encode( encoder_t *p_enc, aout_buffer_t *p_aout_buf )
...
@@ -744,7 +745,7 @@ static block_t *Encode( encoder_t *p_enc, aout_buffer_t *p_aout_buf )
/* Encode current frame */
/* Encode current frame */
if
(
p_enc
->
fmt_in
.
audio
.
i_channels
==
2
)
if
(
p_enc
->
fmt_in
.
audio
.
i_channels
==
2
)
speex_encode_stereo
(
p_samples
,
p_sys
->
i_frame_length
,
speex_encode_stereo
_int
(
p_samples
,
p_sys
->
i_frame_length
,
&
p_sys
->
bits
);
&
p_sys
->
bits
);
#if 0
#if 0
...
@@ -752,7 +753,7 @@ static block_t *Encode( encoder_t *p_enc, aout_buffer_t *p_aout_buf )
...
@@ -752,7 +753,7 @@ static block_t *Encode( encoder_t *p_enc, aout_buffer_t *p_aout_buf )
speex_preprocess( p_sys->preprocess, p_samples, NULL );
speex_preprocess( p_sys->preprocess, p_samples, NULL );
#endif
#endif
speex_encode
(
p_sys
->
p_state
,
p_samples
,
&
p_sys
->
bits
);
speex_encode
_int
(
p_sys
->
p_state
,
p_samples
,
&
p_sys
->
bits
);
p_buffer
+=
p_sys
->
i_frame_size
;
p_buffer
+=
p_sys
->
i_frame_size
;
p_sys
->
i_samples_delay
-=
p_sys
->
i_frame_length
;
p_sys
->
i_samples_delay
-=
p_sys
->
i_frame_length
;
...
...
modules/demux/mjpeg.c
View file @
f5009d6f
...
@@ -65,6 +65,7 @@ struct demux_sys_t
...
@@ -65,6 +65,7 @@ struct demux_sys_t
vlc_bool_t
b_still
;
vlc_bool_t
b_still
;
mtime_t
i_still_end
;
mtime_t
i_still_end
;
mtime_t
i_still_length
;
mtime_t
i_time
;
mtime_t
i_time
;
mtime_t
i_frame_length
;
mtime_t
i_frame_length
;
...
@@ -277,7 +278,7 @@ static int SendBlock( demux_t *p_demux, int i )
...
@@ -277,7 +278,7 @@ static int SendBlock( demux_t *p_demux, int i )
if
(
p_sys
->
b_still
)
if
(
p_sys
->
b_still
)
{
{
p_sys
->
i_still_end
=
mdate
()
+
I64C
(
5000000
)
;
p_sys
->
i_still_end
=
mdate
()
+
p_sys
->
i_still_length
;
}
}
return
1
;
return
1
;
...
@@ -327,6 +328,11 @@ static int Open( vlc_object_t * p_this )
...
@@ -327,6 +328,11 @@ static int Open( vlc_object_t * p_this )
goto
error
;
goto
error
;
}
}
var_Create
(
p_demux
,
"mjpeg-fps"
,
VLC_VAR_FLOAT
|
VLC_VAR_DOINHERIT
);
var_Get
(
p_demux
,
"mjpeg-fps"
,
&
val
);
p_sys
->
i_frame_length
=
0
;
/* Check for jpeg file extension */
/* Check for jpeg file extension */
p_sys
->
b_still
=
VLC_FALSE
;
p_sys
->
b_still
=
VLC_FALSE
;
p_sys
->
i_still_end
=
0
;
p_sys
->
i_still_end
=
0
;
...
@@ -335,12 +341,17 @@ static int Open( vlc_object_t * p_this )
...
@@ -335,12 +341,17 @@ static int Open( vlc_object_t * p_this )
!
strcasecmp
(
psz_ext
,
".jpg"
)
)
)
!
strcasecmp
(
psz_ext
,
".jpg"
)
)
)
{
{
p_sys
->
b_still
=
VLC_TRUE
;
p_sys
->
b_still
=
VLC_TRUE
;
if
(
val
.
f_float
)
{
p_sys
->
i_still_length
=
1000000
.
0
/
val
.
f_float
;
}
}
else
var_Create
(
p_demux
,
"mjpeg-fps"
,
VLC_VAR_FLOAT
|
VLC_VAR_DOINHERIT
);
{
var_Get
(
p_demux
,
"mjpeg-fps"
,
&
val
);
/* Defaults to 1fps */
p_sys
->
i_frame_length
=
0
;
p_sys
->
i_still_length
=
1000000
;
if
(
val
.
f_float
)
}
}
else
if
(
val
.
f_float
)
{
{
p_sys
->
i_frame_length
=
1000000
.
0
/
val
.
f_float
;
p_sys
->
i_frame_length
=
1000000
.
0
/
val
.
f_float
;
}
}
...
@@ -373,7 +384,7 @@ static int MjpgDemux( demux_t *p_demux )
...
@@ -373,7 +384,7 @@ static int MjpgDemux( demux_t *p_demux )
}
}
else
if
(
p_sys
->
b_still
&&
p_sys
->
i_still_end
)
else
if
(
p_sys
->
b_still
&&
p_sys
->
i_still_end
)
{
{
msleep
(
400
00
);
msleep
(
400
);
return
1
;
return
1
;
}
}
...
...
modules/demux/ogg.c
View file @
f5009d6f
...
@@ -1338,6 +1338,13 @@ static void Ogg_ReadAnnodexHeader( vlc_object_t *p_this,
...
@@ -1338,6 +1338,13 @@ static void Ogg_ReadAnnodexHeader( vlc_object_t *p_this,
p_stream
->
b_force_backup
=
1
;
p_stream
->
b_force_backup
=
1
;
}
}
else
if
(
!
strncmp
(
content_type_string
,
"audio/x-speex"
,
14
)
)
{
p_stream
->
fmt
.
i_cat
=
AUDIO_ES
;
p_stream
->
fmt
.
i_codec
=
VLC_FOURCC
(
's'
,
'p'
,
'x'
,
' '
);
p_stream
->
b_force_backup
=
1
;
}
else
if
(
!
strncmp
(
content_type_string
,
"video/x-theora"
,
14
)
)
else
if
(
!
strncmp
(
content_type_string
,
"video/x-theora"
,
14
)
)
{
{
p_stream
->
fmt
.
i_cat
=
VIDEO_ES
;
p_stream
->
fmt
.
i_cat
=
VIDEO_ES
;
...
...
modules/gui/skins2/src/vout_window.hpp
View file @
f5009d6f
...
@@ -30,24 +30,18 @@ class OSGraphics;
...
@@ -30,24 +30,18 @@ class OSGraphics;
/// Class to handle a video output window
/// Class to handle a video output window
class
VoutWindow
:
p
ublic
GenericWindow
class
VoutWindow
:
p
rivate
GenericWindow
{
{
public:
public:
VoutWindow
(
intf_thread_t
*
pIntf
,
int
xPos
,
int
yPos
,
VoutWindow
(
intf_thread_t
*
pIntf
,
int
xPos
,
int
yPos
,
bool
dragDrop
,
bool
playOnDrop
,
GenericWindow
&
rParent
);
bool
dragDrop
,
bool
playOnDrop
,
GenericWindow
&
rParent
);
virtual
~
VoutWindow
();
virtual
~
VoutWindow
();
///
These methods are redefined here to make them
public
///
Make some functions
public
//@{
//@{
/// Show the window
using
GenericWindow
::
show
;
virtual
void
show
()
{
GenericWindow
::
show
();
}
using
GenericWindow
::
hide
;
using
GenericWindow
::
move
;
/// Hide the window
virtual
void
hide
()
{
GenericWindow
::
hide
();
}
/// Move the window
virtual
void
move
(
int
left
,
int
top
)
{
GenericWindow
::
move
(
left
,
top
);
}
//@}
//@}
/// Resize the window
/// Resize the window
...
...
modules/gui/wxwindows/iteminfo.cpp
View file @
f5009d6f
...
@@ -223,22 +223,6 @@ void ItemInfoDialog::OnOk( wxCommandEvent& WXUNUSED(event) )
...
@@ -223,22 +223,6 @@ void ItemInfoDialog::OnOk( wxCommandEvent& WXUNUSED(event) )
p_item
->
input
.
psz_uri
=
strdup
(
uri_text
->
GetLineText
(
0
).
mb_str
()
);
p_item
->
input
.
psz_uri
=
strdup
(
uri_text
->
GetLineText
(
0
).
mb_str
()
);
playlist_ItemAddInfo
(
p_item
,
"General"
,
"Author"
,
playlist_ItemAddInfo
(
p_item
,
"General"
,
"Author"
,
author_text
->
GetLineText
(
0
).
mb_str
()
);
author_text
->
GetLineText
(
0
).
mb_str
()
);
vlc_bool_t
b_old_enabled
=
p_item
->
b_enabled
;
playlist_t
*
p_playlist
=
(
playlist_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
if
(
p_playlist
!=
NULL
)
{
if
(
b_old_enabled
==
VLC_FALSE
&&
enabled_checkbox
->
IsChecked
()
)
p_playlist
->
i_enabled
++
;
else
if
(
b_old_enabled
==
VLC_TRUE
&&
!
enabled_checkbox
->
IsChecked
()
)
p_playlist
->
i_enabled
--
;
vlc_object_release
(
p_playlist
);
}
p_item
->
b_enabled
=
enabled_checkbox
->
IsChecked
()
?
VLC_TRUE
:
VLC_FALSE
;
vlc_mutex_unlock
(
&
p_item
->
input
.
lock
);
vlc_mutex_unlock
(
&
p_item
->
input
.
lock
);
EndModal
(
wxID_OK
);
EndModal
(
wxID_OK
);
}
}
...
...
modules/gui/wxwindows/playlist.cpp
View file @
f5009d6f
...
@@ -76,8 +76,6 @@ enum
...
@@ -76,8 +76,6 @@ enum
SortTitle_Event
,
SortTitle_Event
,
RSortTitle_Event
,
RSortTitle_Event
,
SortAuthor_Event
,
RSortAuthor_Event
,
Randomize_Event
,
Randomize_Event
,
EnableSelection_Event
,
EnableSelection_Event
,
...
@@ -90,10 +88,6 @@ enum
...
@@ -90,10 +88,6 @@ enum
Repeat_Event
,
Repeat_Event
,
SelectAll_Event
,
SelectAll_Event
,
Up_Event
,
Down_Event
,
Infos_Event
,
PopupPlay_Event
,
PopupPlay_Event
,
PopupPlayThis_Event
,
PopupPlayThis_Event
,
PopupSort_Event
,
PopupSort_Event
,
...
@@ -137,8 +131,6 @@ BEGIN_EVENT_TABLE(Playlist, wxFrame)
...
@@ -137,8 +131,6 @@ BEGIN_EVENT_TABLE(Playlist, wxFrame)
EVT_MENU
(
SortTitle_Event
,
Playlist
::
OnSort
)
EVT_MENU
(
SortTitle_Event
,
Playlist
::
OnSort
)
EVT_MENU
(
RSortTitle_Event
,
Playlist
::
OnSort
)
EVT_MENU
(
RSortTitle_Event
,
Playlist
::
OnSort
)
EVT_MENU
(
SortAuthor_Event
,
Playlist
::
OnSort
)
EVT_MENU
(
RSortAuthor_Event
,
Playlist
::
OnSort
)
EVT_MENU
(
Randomize_Event
,
Playlist
::
OnSort
)
EVT_MENU
(
Randomize_Event
,
Playlist
::
OnSort
)
...
@@ -147,7 +139,6 @@ BEGIN_EVENT_TABLE(Playlist, wxFrame)
...
@@ -147,7 +139,6 @@ BEGIN_EVENT_TABLE(Playlist, wxFrame)
EVT_MENU
(
InvertSelection_Event
,
Playlist
::
OnInvertSelection
)
EVT_MENU
(
InvertSelection_Event
,
Playlist
::
OnInvertSelection
)
EVT_MENU
(
DeleteSelection_Event
,
Playlist
::
OnDeleteSelection
)
EVT_MENU
(
DeleteSelection_Event
,
Playlist
::
OnDeleteSelection
)
EVT_MENU
(
SelectAll_Event
,
Playlist
::
OnSelectAll
)
EVT_MENU
(
SelectAll_Event
,
Playlist
::
OnSelectAll
)
EVT_MENU
(
Infos_Event
,
Playlist
::
OnInfos
)
EVT_MENU_OPEN
(
Playlist
::
OnMenuOpen
)
EVT_MENU_OPEN
(
Playlist
::
OnMenuOpen
)
EVT_MENU
(
-
1
,
Playlist
::
OnMenuEvent
)
EVT_MENU
(
-
1
,
Playlist
::
OnMenuEvent
)
...
@@ -172,10 +163,6 @@ BEGIN_EVENT_TABLE(Playlist, wxFrame)
...
@@ -172,10 +163,6 @@ BEGIN_EVENT_TABLE(Playlist, wxFrame)
/* Button events */
/* Button events */
EVT_BUTTON
(
Search_Event
,
Playlist
::
OnSearch
)
EVT_BUTTON
(
Search_Event
,
Playlist
::
OnSearch
)
EVT_BUTTON
(
Save_Event
,
Playlist
::
OnSave
)
EVT_BUTTON
(
Save_Event
,
Playlist
::
OnSave
)
EVT_BUTTON
(
Infos_Event
,
Playlist
::
OnInfos
)
EVT_BUTTON
(
Up_Event
,
Playlist
::
OnUp
)
EVT_BUTTON
(
Down_Event
,
Playlist
::
OnDown
)
EVT_TEXT
(
SearchText_Event
,
Playlist
::
OnSearchTextChange
)
EVT_TEXT
(
SearchText_Event
,
Playlist
::
OnSearchTextChange
)
...
@@ -222,9 +209,9 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ):
...
@@ -222,9 +209,9 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ):
p_sd_menu
=
SDMenu
();
p_sd_menu
=
SDMenu
();
i_current_view
=
VIEW_SIMPLE
;
i_current_view
=
VIEW_SIMPLE
;
b_changed_view
=
VLC_FALSE
;
i_title_sorted
=
0
;
i_title_sorted
=
0
;
i_author_sorted
=
0
;
i_group_sorted
=
0
;
i_group_sorted
=
0
;
i_duration_sorted
=
0
;
i_duration_sorted
=
0
;
...
@@ -251,9 +238,6 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ):
...
@@ -251,9 +238,6 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ):
sort_menu
->
Append
(
SortTitle_Event
,
wxU
(
_
(
"Sort by &title"
))
);
sort_menu
->
Append
(
SortTitle_Event
,
wxU
(
_
(
"Sort by &title"
))
);
sort_menu
->
Append
(
RSortTitle_Event
,
wxU
(
_
(
"&Reverse sort by title"
))
);
sort_menu
->
Append
(
RSortTitle_Event
,
wxU
(
_
(
"&Reverse sort by title"
))
);
sort_menu
->
AppendSeparator
();
sort_menu
->
AppendSeparator
();
sort_menu
->
Append
(
SortAuthor_Event
,
wxU
(
_
(
"Sort by &author"
))
);
sort_menu
->
Append
(
RSortAuthor_Event
,
wxU
(
_
(
"Reverse sort by author"
))
);
sort_menu
->
AppendSeparator
();
sort_menu
->
Append
(
Randomize_Event
,
wxU
(
_
(
"&Shuffle Playlist"
))
);
sort_menu
->
Append
(
Randomize_Event
,
wxU
(
_
(
"&Shuffle Playlist"
))
);
/* Create our "Selection" menu */
/* Create our "Selection" menu */
...
@@ -404,11 +388,6 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ):
...
@@ -404,11 +388,6 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ):
Rebuild
();
Rebuild
();
}
}
void
Playlist
::
OnSize
(
wxSizeEvent
&
event
)
{
event
.
Skip
();
}
Playlist
::~
Playlist
()
Playlist
::~
Playlist
()
{
{
playlist_t
*
p_playlist
=
playlist_t
*
p_playlist
=
...
@@ -426,8 +405,10 @@ Playlist::~Playlist()
...
@@ -426,8 +405,10 @@ Playlist::~Playlist()
}
}
/**********************************************************************
/**********************************************************************
* Update
one playlist item
* Update
functions
**********************************************************************/
**********************************************************************/
/* Update a node */
void
Playlist
::
UpdateNode
(
playlist_t
*
p_playlist
,
playlist_item_t
*
p_node
,
void
Playlist
::
UpdateNode
(
playlist_t
*
p_playlist
,
playlist_item_t
*
p_node
,
wxTreeItemId
node
)
wxTreeItemId
node
)
{
{
...
@@ -457,6 +438,7 @@ void Playlist::UpdateNode( playlist_t *p_playlist, playlist_item_t *p_node,
...
@@ -457,6 +438,7 @@ void Playlist::UpdateNode( playlist_t *p_playlist, playlist_item_t *p_node,
}
}
}
}
/* Creates the node p_node as last child of parent */
/* Creates the node p_node as last child of parent */
void
Playlist
::
CreateNode
(
playlist_t
*
p_playlist
,
playlist_item_t
*
p_node
,
void
Playlist
::
CreateNode
(
playlist_t
*
p_playlist
,
playlist_item_t
*
p_node
,
wxTreeItemId
parent
)
wxTreeItemId
parent
)
...
@@ -470,6 +452,7 @@ void Playlist::CreateNode( playlist_t *p_playlist, playlist_item_t *p_node,
...
@@ -470,6 +452,7 @@ void Playlist::CreateNode( playlist_t *p_playlist, playlist_item_t *p_node,
UpdateNodeChildren
(
p_playlist
,
p_node
,
node
);
UpdateNodeChildren
(
p_playlist
,
p_node
,
node
);
}
}
/* Update all children (recursively) of this node */
void
Playlist
::
UpdateNodeChildren
(
playlist_t
*
p_playlist
,
void
Playlist
::
UpdateNodeChildren
(
playlist_t
*
p_playlist
,
playlist_item_t
*
p_node
,
playlist_item_t
*
p_node
,
wxTreeItemId
node
)
wxTreeItemId
node
)
...
@@ -498,97 +481,62 @@ void Playlist::UpdateNodeChildren( playlist_t *p_playlist,
...
@@ -498,97 +481,62 @@ void Playlist::UpdateNodeChildren( playlist_t *p_playlist,
}
}
}
}
wxTreeItemId
Playlist
::
FindItem
(
wxTreeItemId
root
,
playlist_item_t
*
p_item
)
/* Set current item */
void
Playlist
::
SetCurrentItem
(
wxTreeItemId
item
)
{
{
long
cookie
;
if
(
item
.
IsOk
()
)
PlaylistItem
*
p_wxcurrent
;
wxTreeItemId
search
;
wxTreeItemId
item
=
treectrl
->
GetFirstChild
(
root
,
cookie
);
wxTreeItemId
child
;
p_wxcurrent
=
(
PlaylistItem
*
)
treectrl
->
GetItemData
(
root
);
if
(
p_wxcurrent
->
p_item
==
p_item
)
{
{
return
root
;
treectrl
->
SetItemBold
(
item
,
true
);
treectrl
->
EnsureVisible
(
item
);
}
}
}
/* Update an item in the tree */
void
Playlist
::
UpdateTreeItem
(
playlist_t
*
p_playlist
,
wxTreeItemId
item
)
{
playlist_item_t
*
p_item
=
((
PlaylistItem
*
)
treectrl
->
GetItemData
(
item
))
->
p_item
;
if
(
!
p_item
)
if
(
!
p_item
)
{
{
wxTreeItemId
dummy
;
return
;
return
dummy
;
}
}
while
(
item
.
IsOk
()
)
wxString
msg
;
{
char
*
psz_author
=
playlist_ItemGetInfo
(
p_item
,
_
(
"Meta-information"
),
p_wxcurrent
=
(
PlaylistItem
*
)
treectrl
->
GetItemData
(
item
);
_
(
"Artist"
));
if
(
p_wxcurrent
->
p_item
==
p_item
)
char
psz_duration
[
MSTRTIME_MAX_SIZE
];
{
mtime_t
dur
=
p_item
->
input
.
i_duration
;
return
item
;
}
if
(
treectrl
->
ItemHasChildren
(
item
)
)
{
wxTreeItemId
search
=
FindItem
(
item
,
p_item
);
if
(
search
.
IsOk
()
)
{
return
search
;
}
}
item
=
treectrl
->
GetNextChild
(
root
,
cookie
);
}
/* Not found */
wxTreeItemId
dummy
;
return
dummy
;
}
wxTreeItemId
Playlist
::
FindItemByName
(
wxTreeItemId
root
,
wxString
search_string
,
wxTreeItemId
current
,
vlc_bool_t
*
pb_current_found
)
if
(
dur
!=
-
1
)
{
secstotimestr
(
psz_duration
,
dur
/
1000000
);
long
cookie
;
else
PlaylistItem
*
p_wxcurrent
;
memcpy
(
psz_duration
,
"-:--:--"
,
sizeof
(
"-:--:--"
)
);
wxTreeItemId
search
;
wxTreeItemId
item
=
treectrl
->
GetFirstChild
(
root
,
cookie
);
wxTreeItemId
child
;
while
(
item
.
IsOk
()
)
if
(
!
strcmp
(
psz_author
,
""
)
||
p_item
->
input
.
b_fixed_name
==
VLC_TRUE
)
{
if
(
treectrl
->
GetItemText
(
item
).
Lower
().
Contains
(
search_string
.
Lower
()
)
)
{
if
(
!
current
.
IsOk
()
||
*
pb_current_found
==
VLC_TRUE
)
{
{
return
item
;
msg
.
Printf
(
wxString
(
wxL2U
(
p_item
->
input
.
psz_name
)
)
+
wxU
(
" ( "
)
+
wxString
(
wxL2U
(
psz_duration
)
)
+
wxU
(
")"
)
);
}
}
else
if
(
current
.
IsOk
()
&&
item
==
current
)
else
{
{
*
pb_current_found
=
VLC_TRUE
;
msg
.
Printf
(
wxString
(
wxU
(
psz_author
))
+
wxT
(
" - "
)
+
}
wxString
(
wxL2U
(
p_item
->
input
.
psz_name
))
+
wxU
(
" ( "
)
+
wxString
(
wxL2U
(
psz_duration
)
)
+
wxU
(
")"
)
);
}
}
if
(
treectrl
->
ItemHasChildren
(
item
)
)
treectrl
->
SetItemText
(
item
,
msg
);
{
wxTreeItemId
search
=
FindItemByName
(
item
,
search_string
,
current
,
if
(
p_playlist
->
status
.
p_item
==
p_item
)
pb_current_found
);
if
(
search
.
IsOk
()
)
{
{
return
search
;
SetCurrentItem
(
item
);
}
}
item
=
treectrl
->
GetNextChild
(
root
,
cookie
);
}
}
/* Not found */
else
wxTreeItemId
dummy
;
return
dummy
;
}
void
Playlist
::
SetCurrentItem
(
wxTreeItemId
item
)
{
if
(
item
.
IsOk
()
)
{
{
treectrl
->
SetItemBold
(
item
,
true
);
treectrl
->
SetItemBold
(
item
,
false
);
treectrl
->
EnsureVisible
(
item
);
}
}
}
}
/* Process a AppendItem request */
void
Playlist
::
AppendItem
(
wxCommandEvent
&
event
)
void
Playlist
::
AppendItem
(
wxCommandEvent
&
event
)
{
{
playlist_add_t
*
p_add
=
(
playlist_add_t
*
)
event
.
GetClientData
();
playlist_add_t
*
p_add
=
(
playlist_add_t
*
)
event
.
GetClientData
();
...
@@ -596,6 +544,7 @@ void Playlist::AppendItem( wxCommandEvent& event )
...
@@ -596,6 +544,7 @@ void Playlist::AppendItem( wxCommandEvent& event )
playlist_t
*
p_playlist
=
playlist_t
*
p_playlist
=
(
playlist_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_PLAYLIST
,
(
playlist_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
FIND_ANYWHERE
);
wxTreeItemId
item
,
node
;
if
(
p_playlist
==
NULL
)
if
(
p_playlist
==
NULL
)
{
{
event
.
Skip
();
event
.
Skip
();
...
@@ -604,20 +553,16 @@ void Playlist::AppendItem( wxCommandEvent& event )
...
@@ -604,20 +553,16 @@ void Playlist::AppendItem( wxCommandEvent& event )
if
(
p_add
->
i_view
!=
i_current_view
)
if
(
p_add
->
i_view
!=
i_current_view
)
{
{
vlc_object_release
(
p_playlist
);
goto
update
;
event
.
Skip
();
return
;
}
}
wxTreeItemId
node
=
FindItem
(
treectrl
->
GetRootItem
(),
p_add
->
p_node
);
node
=
FindItem
(
treectrl
->
GetRootItem
(),
p_add
->
p_node
);
if
(
!
node
.
IsOk
()
)
if
(
!
node
.
IsOk
()
)
{
{
vlc_object_release
(
p_playlist
);
goto
update
;
event
.
Skip
();
return
;
}
}
wxTreeItemId
item
=
treectrl
->
AppendItem
(
node
,
item
=
treectrl
->
AppendItem
(
node
,
wxL2U
(
p_add
->
p_item
->
input
.
psz_name
),
-
1
,
-
1
,
wxL2U
(
p_add
->
p_item
->
input
.
psz_name
),
-
1
,
-
1
,
new
PlaylistItem
(
p_add
->
p_item
)
);
new
PlaylistItem
(
p_add
->
p_item
)
);
treectrl
->
SetItemImage
(
item
,
p_add
->
p_item
->
input
.
i_type
);
treectrl
->
SetItemImage
(
item
,
p_add
->
p_item
->
input
.
i_type
);
...
@@ -627,13 +572,33 @@ void Playlist::AppendItem( wxCommandEvent& event )
...
@@ -627,13 +572,33 @@ void Playlist::AppendItem( wxCommandEvent& event )
UpdateTreeItem
(
p_playlist
,
item
);
UpdateTreeItem
(
p_playlist
,
item
);
}
}
update:
int
i_count
=
CountItems
(
treectrl
->
GetRootItem
());
if
(
i_count
!=
p_playlist
->
i_size
)
{
statusbar
->
SetStatusText
(
wxString
::
Format
(
wxU
(
_
(
"%i items in playlist (%i not shown)"
)),
p_playlist
->
i_size
,
p_playlist
->
i_size
-
i_count
)
);
if
(
!
b_changed_view
)
{
i_current_view
=
VIEW_CATEGORY
;
b_changed_view
=
VLC_TRUE
;
b_need_update
=
VLC_TRUE
;
}
}
else
{
statusbar
->
SetStatusText
(
wxString
::
Format
(
wxU
(
_
(
statusbar
->
SetStatusText
(
wxString
::
Format
(
wxU
(
_
(
"%i items in playlist"
)),
"%i items in playlist"
)),
p_playlist
->
i_size
),
0
);
p_playlist
->
i_size
),
0
);
}
vlc_object_release
(
p_playlist
);
vlc_object_release
(
p_playlist
);
return
;
}
}
/* Process a updateitem request */
void
Playlist
::
UpdateItem
(
int
i
)
void
Playlist
::
UpdateItem
(
int
i
)
{
{
if
(
i
<
0
)
return
;
/* Sanity check */
if
(
i
<
0
)
return
;
/* Sanity check */
...
@@ -660,57 +625,112 @@ void Playlist::UpdateItem( int i )
...
@@ -660,57 +625,112 @@ void Playlist::UpdateItem( int i )
vlc_object_release
(
p_playlist
);
vlc_object_release
(
p_playlist
);
}
}
void
Playlist
::
UpdateTreeItem
(
playlist_t
*
p_playlist
,
wxTreeItemId
item
)
/**********************************************************************
* Search functions (internal
**********************************************************************/
/* Find a wxItem from a playlist_item */
wxTreeItemId
Playlist
::
FindItem
(
wxTreeItemId
root
,
playlist_item_t
*
p_item
)
{
{
playlist_item_t
*
p_item
=
long
cookie
;
((
PlaylistItem
*
)
treectrl
->
GetItemData
(
item
))
->
p_item
;
PlaylistItem
*
p_wxcurrent
;
wxTreeItemId
search
;
wxTreeItemId
item
=
treectrl
->
GetFirstChild
(
root
,
cookie
);
wxTreeItemId
child
;
p_wxcurrent
=
(
PlaylistItem
*
)
treectrl
->
GetItemData
(
root
);
if
(
p_wxcurrent
->
p_item
==
p_item
)
{
return
root
;
}
if
(
!
p_item
)
if
(
!
p_item
)
{
{
return
;
wxTreeItemId
dummy
;
return
dummy
;
}
}
wxString
msg
;
while
(
item
.
IsOk
()
)
char
*
psz_author
=
playlist_ItemGetInfo
(
p_item
,
_
(
"Meta-information"
),
{
_
(
"Artist"
));
p_wxcurrent
=
(
PlaylistItem
*
)
treectrl
->
GetItemData
(
item
);
char
psz_duration
[
MSTRTIME_MAX_SIZE
];
if
(
p_wxcurrent
->
p_item
==
p_item
)
mtime_t
dur
=
p_item
->
input
.
i_duration
;
{
return
item
;
}
if
(
treectrl
->
ItemHasChildren
(
item
)
)
{
wxTreeItemId
search
=
FindItem
(
item
,
p_item
);
if
(
search
.
IsOk
()
)
{
return
search
;
}
}
item
=
treectrl
->
GetNextChild
(
root
,
cookie
);
}
/* Not found */
wxTreeItemId
dummy
;
return
dummy
;
}
if
(
dur
!=
-
1
)
int
Playlist
::
CountItems
(
wxTreeItemId
root
)
secstotimestr
(
psz_duration
,
dur
/
1000000
);
{
else
long
cookie
;
memcpy
(
psz_duration
,
"-:--:--"
,
sizeof
(
"-:--:--"
)
);
int
count
=
0
;
wxTreeItemId
item
=
treectrl
->
GetFirstChild
(
root
,
cookie
);
if
(
!
strcmp
(
psz_author
,
""
)
||
p_item
->
input
.
b_fixed_name
==
VLC_TRUE
)
while
(
item
.
IsOk
()
)
{
{
msg
.
Printf
(
wxString
(
wxL2U
(
p_item
->
input
.
psz_name
)
)
+
wxU
(
" ( "
)
+
if
(
treectrl
->
ItemHasChildren
(
item
)
)
wxString
(
wxL2U
(
psz_duration
)
)
+
wxU
(
")"
)
);
}
else
{
{
msg
.
Printf
(
wxString
(
wxU
(
psz_author
))
+
wxT
(
" - "
)
+
count
+=
CountItems
(
item
);
wxString
(
wxL2U
(
p_item
->
input
.
psz_name
))
+
wxU
(
" ( "
)
+
wxString
(
wxL2U
(
psz_duration
)
)
+
wxU
(
")"
)
);
}
}
treectrl
->
SetItemText
(
item
,
msg
);
else
if
(
(
(
PlaylistItem
*
)
treectrl
->
GetItemData
(
item
)
)
->
p_item
->
i_children
==
-
1
)
count
++
;
item
=
treectrl
->
GetNextChild
(
root
,
cookie
);
}
return
count
;
}
if
(
p_playlist
->
status
.
p_item
==
p_item
)
/* Find a wxItem from a name (from current) */
wxTreeItemId
Playlist
::
FindItemByName
(
wxTreeItemId
root
,
wxString
search_string
,
wxTreeItemId
current
,
vlc_bool_t
*
pb_current_found
)
{
long
cookie
;
wxTreeItemId
search
;
wxTreeItemId
item
=
treectrl
->
GetFirstChild
(
root
,
cookie
);
wxTreeItemId
child
;
while
(
item
.
IsOk
()
)
{
{
SetCurrentItem
(
item
);
if
(
treectrl
->
GetItemText
(
item
).
Lower
().
Contains
(
search_string
.
Lower
()
)
)
{
if
(
!
current
.
IsOk
()
||
*
pb_current_found
==
VLC_TRUE
)
{
return
item
;
}
}
else
else
if
(
current
.
IsOk
()
&&
item
==
current
)
{
{
treectrl
->
SetItemBold
(
item
,
false
)
;
*
pb_current_found
=
VLC_TRUE
;
}
}
#if 0
}
if( p_item->b_enabled == VLC_FALSE )
if
(
treectrl
->
ItemHasChildren
(
item
)
)
{
wxTreeItemId
search
=
FindItemByName
(
item
,
search_string
,
current
,
pb_current_found
);
if
(
search
.
IsOk
()
)
{
{
wxListItem listitem;
return
search
;
listitem.m_itemId = i;
listitem.SetTextColour( *wxLIGHT_GREY);
listview->SetItem(listitem);
}
}
#endif
}
item
=
treectrl
->
GetNextChild
(
root
,
cookie
);
}
/* Not found */
wxTreeItemId
dummy
;
return
dummy
;
}
}
/**********************************************************************
/**********************************************************************
...
@@ -726,6 +746,13 @@ void Playlist::Rebuild()
...
@@ -726,6 +746,13 @@ void Playlist::Rebuild()
{
{
return
;
return
;
}
}
int
i_count
=
CountItems
(
treectrl
->
GetRootItem
())
;
if
(
i_count
>
p_playlist
->
i_size
&&
!
b_changed_view
)
{
i_current_view
=
VIEW_CATEGORY
;
b_changed_view
=
VLC_TRUE
;
}
/* ...and rebuild it */
/* ...and rebuild it */
vlc_mutex_lock
(
&
p_playlist
->
object_lock
);
vlc_mutex_lock
(
&
p_playlist
->
object_lock
);
...
@@ -755,38 +782,37 @@ void Playlist::Rebuild()
...
@@ -755,38 +782,37 @@ void Playlist::Rebuild()
item
=
root
;
item
=
root
;
}
}
SetCurrentItem
(
item
);
i_count
=
CountItems
(
treectrl
->
GetRootItem
()
);
if
(
i_count
!=
p_playlist
->
i_size
)
/* GetChildrenCount does count internal nodes :(
if( treectrl->GetChildrenCount( root, true ) !=
p_playlist->i_size )
{
{
statusbar->SetStatusText( wxString::Format( wx
T
(_(
statusbar
->
SetStatusText
(
wxString
::
Format
(
wx
U
(
_
(
"%i items in playlist (%i not shown)"
)),
"%i items in playlist (%i not shown)"
)),
p_playlist
->
i_size
,
p_playlist
->
i_size
,
p_playlist->i_size -
p_playlist
->
i_size
-
i_count
)
);
treectrl->GetChildrenCount( root, true ) ) );
}
}
else
else
{
{
*/
statusbar
->
SetStatusText
(
wxString
::
Format
(
wxU
(
_
(
statusbar
->
SetStatusText
(
wxString
::
Format
(
wxU
(
_
(
"%i items in playlist"
)),
"%i items in playlist"
)),
p_playlist
->
i_size
),
0
);
p_playlist
->
i_size
),
0
);
//
}
}
SetCurrentItem
(
item
);
vlc_mutex_unlock
(
&
p_playlist
->
object_lock
);
vlc_mutex_unlock
(
&
p_playlist
->
object_lock
);
vlc_object_release
(
p_playlist
);
vlc_object_release
(
p_playlist
);
}
}
void
Playlist
::
ShowPlaylist
(
bool
show
)
void
Playlist
::
ShowPlaylist
(
bool
show
)
{
{
if
(
show
)
Rebuild
();
if
(
show
)
Rebuild
();
Show
(
show
);
Show
(
show
);
}
}
/* This function is called on a regular basis */
void
Playlist
::
UpdatePlaylist
()
void
Playlist
::
UpdatePlaylist
()
{
{
i_update_counter
++
;
i_update_counter
++
;
...
@@ -832,6 +858,22 @@ void Playlist::DeleteItem( int item_id )
...
@@ -832,6 +858,22 @@ void Playlist::DeleteItem( int item_id )
vlc_object_release
(
p_playlist
);
vlc_object_release
(
p_playlist
);
}
}
void
Playlist
::
DeleteNode
(
playlist_item_t
*
p_item
)
{
playlist_t
*
p_playlist
=
(
playlist_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
if
(
p_playlist
==
NULL
)
{
return
;
}
playlist_NodeDelete
(
p_playlist
,
p_item
,
VLC_TRUE
);
vlc_object_release
(
p_playlist
);
}
void
Playlist
::
OnClose
(
wxCommandEvent
&
WXUNUSED
(
event
)
)
void
Playlist
::
OnClose
(
wxCommandEvent
&
WXUNUSED
(
event
)
)
{
{
Hide
();
Hide
();
...
@@ -926,53 +968,6 @@ void Playlist::OnAddMRL( wxCommandEvent& WXUNUSED(event) )
...
@@ -926,53 +968,6 @@ void Playlist::OnAddMRL( wxCommandEvent& WXUNUSED(event) )
}
}
/********************************************************************
* Move functions
********************************************************************/
void
Playlist
::
OnUp
(
wxCommandEvent
&
event
)
{
playlist_t
*
p_playlist
=
(
playlist_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
if
(
p_playlist
==
NULL
)
{
return
;
}
#if 0
/* We use the first selected item, so find it */
long i_item = listview->GetNextItem( -1, wxLIST_NEXT_ALL,
wxLIST_STATE_SELECTED);
if( i_item > 0 && i_item < p_playlist->i_size )
{
playlist_Move( p_playlist, i_item, i_item - 1 );
listview->Focus( i_item - 1 );
}
#endif
vlc_object_release
(
p_playlist
);
}
void
Playlist
::
OnDown
(
wxCommandEvent
&
event
)
{
playlist_t
*
p_playlist
=
(
playlist_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
if
(
p_playlist
==
NULL
)
{
return
;
}
#if 0
/* We use the first selected item, so find it */
long i_item = listview->GetNextItem( -1, wxLIST_NEXT_ALL,
wxLIST_STATE_SELECTED );
if( i_item >= 0 && i_item < p_playlist->i_size - 1 )
{
playlist_Move( p_playlist, i_item, i_item + 2 );
listview->Focus( i_item + 1 );
}
#endif
vlc_object_release
(
p_playlist
);
}
/********************************************************************
/********************************************************************
* Sorting functions
* Sorting functions
********************************************************************/
********************************************************************/
...
@@ -981,35 +976,32 @@ void Playlist::OnSort( wxCommandEvent& event )
...
@@ -981,35 +976,32 @@ void Playlist::OnSort( wxCommandEvent& event )
playlist_t
*
p_playlist
=
playlist_t
*
p_playlist
=
(
playlist_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_PLAYLIST
,
(
playlist_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
FIND_ANYWHERE
);
PlaylistItem
*
p_wxitem
;
p_wxitem
=
(
PlaylistItem
*
)
treectrl
->
GetItemData
(
treectrl
->
GetRootItem
()
);
if
(
p_playlist
==
NULL
)
if
(
p_playlist
==
NULL
)
{
{
return
;
return
;
}
}
vlc_mutex_lock
(
&
p_playlist
->
object_lock
);
switch
(
event
.
GetId
()
)
switch
(
event
.
GetId
()
)
{
{
case
SortTitle_Event
:
case
SortTitle_Event
:
playlist_SortTitle
(
p_playlist
,
ORDER_NORMAL
);
playlist_RecursiveNodeSort
(
p_playlist
,
p_wxitem
->
p_item
,
SORT_TITLE_NODES_FIRST
,
ORDER_NORMAL
);
break
;
break
;
case
RSortTitle_Event
:
case
RSortTitle_Event
:
playlist_SortTitle
(
p_playlist
,
ORDER_REVERSE
);
playlist_RecursiveNodeSort
(
p_playlist
,
p_wxitem
->
p_item
,
break
;
SORT_TITLE_NODES_FIRST
,
ORDER_REVERSE
);
case
SortAuthor_Event
:
playlist_SortAuthor
(
p_playlist
,
ORDER_NORMAL
);
break
;
case
RSortAuthor_Event
:
playlist_SortAuthor
(
p_playlist
,
ORDER_REVERSE
);
break
;
case
Randomize_Event
:
playlist_Sort
(
p_playlist
,
SORT_RANDOM
,
ORDER_NORMAL
);
break
;
}
}
vlc_
object_release
(
p_playlist
);
vlc_
mutex_unlock
(
&
p_playlist
->
object_lock
);
vlc_object_release
(
p_playlist
);
Rebuild
();
Rebuild
();
}
}
/**********************************************************************
/**********************************************************************
* Search functions
* Search functions
(user)
**********************************************************************/
**********************************************************************/
void
Playlist
::
OnSearchTextChange
(
wxCommandEvent
&
WXUNUSED
(
event
)
)
void
Playlist
::
OnSearchTextChange
(
wxCommandEvent
&
WXUNUSED
(
event
)
)
{
{
...
@@ -1045,86 +1037,6 @@ void Playlist::OnSearch( wxCommandEvent& WXUNUSED(event) )
...
@@ -1045,86 +1037,6 @@ void Playlist::OnSearch( wxCommandEvent& WXUNUSED(event) )
}
}
}
}
#if 0
for( i_current = 0; i_current < listview->GetItemCount(); i_current++ )
{
if( listview->GetItemState( i_current, wxLIST_STATE_SELECTED ) ==
wxLIST_STATE_SELECTED )
{
i_first = i_current;
break;
}
}
if( i_first == listview->GetItemCount() )
{
i_first = -1;
}
for( i_current = i_first + 1; i_current < listview->GetItemCount();
i_current++ )
{
wxListItem listitem;
listitem.SetId( i_current );
listview->GetItem( listitem );
if( listitem.m_text.Lower().Contains( search_string.Lower() ) )
{
i_item = i_current;
b_ok = true;
break;
}
listitem.SetColumn( 1 );
listview->GetItem( listitem );
if( listitem.m_text.Lower().Contains( search_string.Lower() ) )
{
i_item = i_current;
b_ok = true;
break;
}
}
if( !b_ok )
{
for( i_current = -1 ; i_current < i_first - 1;
i_current++ )
{
wxListItem listitem;
listitem.SetId( i_current );
listview->GetItem( listitem );
if( listitem.m_text.Lower().Contains( search_string.Lower() ) )
{
i_item = i_current;
b_ok = true;
break;
}
listitem.SetColumn( 1 );
listview->GetItem( listitem );
if( listitem.m_text.Lower().Contains( search_string.Lower() ) )
{
i_item = i_current;
b_ok = true;
break;
}
}
}
if( i_item < 0 || i_item >= listview->GetItemCount() )
{
return;
}
for( long item = 0; item < listview->GetItemCount(); item++ )
{
listview->Select( item, FALSE );
}
wxListItem listitem;
listitem.SetId(i_item);
listitem.m_state = wxLIST_STATE_SELECTED;
listview->Select( i_item, TRUE );
listview->Focus( i_item );
}
#endif
/**********************************************************************
/**********************************************************************
* Selection functions
* Selection functions
**********************************************************************/
**********************************************************************/
...
@@ -1146,17 +1058,7 @@ void Playlist::OnEnableSelection( wxCommandEvent& WXUNUSED(event) )
...
@@ -1146,17 +1058,7 @@ void Playlist::OnEnableSelection( wxCommandEvent& WXUNUSED(event) )
{
{
return
;
return
;
}
}
#if 0
msg_Warn
(
p_playlist
,
"not implemented"
);
for( long item = listview->GetItemCount() - 1; item >= 0; item-- )
{
if( listview->IsSelected( item ) )
{
/*XXX*/
playlist_Enable( p_playlist, item );
UpdateItem( item );
}
}
#endif
vlc_object_release
(
p_playlist
);
vlc_object_release
(
p_playlist
);
}
}
...
@@ -1169,17 +1071,9 @@ void Playlist::OnDisableSelection( wxCommandEvent& WXUNUSED(event) )
...
@@ -1169,17 +1071,9 @@ void Playlist::OnDisableSelection( wxCommandEvent& WXUNUSED(event) )
{
{
return
;
return
;
}
}
#if 0
for( long item = listview->GetItemCount() - 1; item >= 0; item-- )
msg_Warn
(
p_playlist
,
"not implemented"
);
{
if( listview->IsSelected( item ) )
{
/*XXX*/
playlist_Disable( p_playlist, item );
UpdateItem( item );
}
}
#endif
vlc_object_release
(
p_playlist
);
vlc_object_release
(
p_playlist
);
}
}
...
@@ -1235,6 +1129,9 @@ void Playlist::OnRepeat( wxCommandEvent& event )
...
@@ -1235,6 +1129,9 @@ void Playlist::OnRepeat( wxCommandEvent& event )
vlc_object_release
(
p_playlist
);
vlc_object_release
(
p_playlist
);
}
}
/********************************************************************
* Event
********************************************************************/
void
Playlist
::
OnActivateItem
(
wxTreeEvent
&
event
)
void
Playlist
::
OnActivateItem
(
wxTreeEvent
&
event
)
{
{
playlist_item_t
*
p_item
,
*
p_node
;
playlist_item_t
*
p_item
,
*
p_node
;
...
@@ -1287,14 +1184,6 @@ void Playlist::OnKeyDown( wxTreeEvent& event )
...
@@ -1287,14 +1184,6 @@ void Playlist::OnKeyDown( wxTreeEvent& event )
}
}
}
}
void
Playlist
::
ShowInfos
(
int
i_item
)
{
}
void
Playlist
::
OnInfos
(
wxCommandEvent
&
WXUNUSED
(
event
)
)
{
}
void
Playlist
::
OnEnDis
(
wxCommandEvent
&
event
)
void
Playlist
::
OnEnDis
(
wxCommandEvent
&
event
)
{
{
playlist_t
*
p_playlist
=
playlist_t
*
p_playlist
=
...
@@ -1304,6 +1193,7 @@ void Playlist::OnEnDis( wxCommandEvent& event )
...
@@ -1304,6 +1193,7 @@ void Playlist::OnEnDis( wxCommandEvent& event )
{
{
return
;
return
;
}
}
msg_Warn
(
p_intf
,
"not implemented"
);
vlc_object_release
(
p_playlist
);
vlc_object_release
(
p_playlist
);
}
}
...
@@ -1351,6 +1241,7 @@ void Playlist::OnMenuEvent( wxCommandEvent& event )
...
@@ -1351,6 +1241,7 @@ void Playlist::OnMenuEvent( wxCommandEvent& event )
if
(
p_view
!=
NULL
)
if
(
p_view
!=
NULL
)
{
{
b_changed_view
=
VLC_TRUE
;
i_current_view
=
i_new_view
;
i_current_view
=
i_new_view
;
playlist_ViewUpdate
(
p_playlist
,
i_new_view
);
playlist_ViewUpdate
(
p_playlist
,
i_new_view
);
Rebuild
();
Rebuild
();
...
@@ -1360,6 +1251,7 @@ void Playlist::OnMenuEvent( wxCommandEvent& event )
...
@@ -1360,6 +1251,7 @@ void Playlist::OnMenuEvent( wxCommandEvent& event )
else
if
(
i_new_view
>=
VIEW_FIRST_SORTED
&&
else
if
(
i_new_view
>=
VIEW_FIRST_SORTED
&&
i_new_view
<=
VIEW_LAST_SORTED
)
i_new_view
<=
VIEW_LAST_SORTED
)
{
{
b_changed_view
=
VLC_TRUE
;
playlist_ViewInsert
(
p_playlist
,
i_new_view
,
"View"
);
playlist_ViewInsert
(
p_playlist
,
i_new_view
,
"View"
);
playlist_ViewUpdate
(
p_playlist
,
i_new_view
);
playlist_ViewUpdate
(
p_playlist
,
i_new_view
);
...
@@ -1434,7 +1326,6 @@ wxMenu *Playlist::SDMenu()
...
@@ -1434,7 +1326,6 @@ wxMenu *Playlist::SDMenu()
{
{
return
NULL
;
return
NULL
;
}
}
vlc_value_t
val
,
val_list
,
text_list
;
p_sd_menu
=
new
wxMenu
;
p_sd_menu
=
new
wxMenu
;
vlc_list_t
*
p_list
=
vlc_list_find
(
p_playlist
,
VLC_OBJECT_MODULE
,
vlc_list_t
*
p_list
=
vlc_list_find
(
p_playlist
,
VLC_OBJECT_MODULE
,
...
@@ -1543,7 +1434,7 @@ void Playlist::OnPopupDel( wxMenuEvent& event )
...
@@ -1543,7 +1434,7 @@ void Playlist::OnPopupDel( wxMenuEvent& event )
}
}
else
else
{
{
//
DeleteNode( p_wxitem->p_item );
DeleteNode
(
p_wxitem
->
p_item
);
}
}
}
}
...
...
modules/gui/wxwindows/wxwindows.h
View file @
f5009d6f
...
@@ -785,40 +785,52 @@ public:
...
@@ -785,40 +785,52 @@ public:
private:
private:
void
DeleteItem
(
int
item
);
void
DeleteItem
(
int
item
);
void
ShowInfos
(
int
item
);
void
DeleteNode
(
playlist_item_t
*
node
);
/* Event handlers (these functions should _not_ be virtual) */
/* Event handlers (these functions should _not_ be virtual) */
void
OnSize
(
wxSizeEvent
&
event
);
/* Menu Handlers */
/* Menu Handlers */
void
OnAddFile
(
wxCommandEvent
&
event
);
void
OnAddFile
(
wxCommandEvent
&
event
);
void
OnAddDir
(
wxCommandEvent
&
event
);
void
OnAddDir
(
wxCommandEvent
&
event
);
void
OnAddMRL
(
wxCommandEvent
&
event
);
void
OnAddMRL
(
wxCommandEvent
&
event
);
void
OnClose
(
wxCommandEvent
&
event
);
void
OnClose
(
wxCommandEvent
&
event
);
void
OnSearch
(
wxCommandEvent
&
event
);
void
OnEnDis
(
wxCommandEvent
&
event
);
void
OnEnableSelection
(
wxCommandEvent
&
event
);
void
OnInfos
(
wxCommandEvent
&
event
);
void
OnDisableSelection
(
wxCommandEvent
&
event
);
void
OnSearchTextChange
(
wxCommandEvent
&
event
);
void
OnInvertSelection
(
wxCommandEvent
&
event
);
void
OnDeleteSelection
(
wxCommandEvent
&
event
);
void
OnSelectAll
(
wxCommandEvent
&
event
);
void
OnOpen
(
wxCommandEvent
&
event
);
void
OnOpen
(
wxCommandEvent
&
event
);
void
OnSave
(
wxCommandEvent
&
event
);
void
OnSave
(
wxCommandEvent
&
event
);
/* Search (user) */
void
OnSearch
(
wxCommandEvent
&
event
);
void
OnSearchTextChange
(
wxCommandEvent
&
event
);
wxTextCtrl
*
search_text
;
wxButton
*
search_button
;
wxTreeItemId
search_current
;
void
OnEnDis
(
wxCommandEvent
&
event
);
/* Sort */
int
i_sort_mode
;
void
OnSort
(
wxCommandEvent
&
event
);
void
OnSort
(
wxCommandEvent
&
event
);
int
i_title_sorted
;
int
i_group_sorted
;
int
i_duration_sorted
;
/* Dynamic menus */
void
OnMenuEvent
(
wxCommandEvent
&
event
);
void
OnMenuEvent
(
wxCommandEvent
&
event
);
void
OnMenuOpen
(
wxMenuEvent
&
event
);
void
OnMenuOpen
(
wxMenuEvent
&
event
);
wxMenu
*
p_view_menu
;
wxMenu
*
p_sd_menu
;
wxMenu
*
ViewMenu
();
wxMenu
*
ViewMenu
();
wxMenu
*
SDMenu
();
wxMenu
*
SDMenu
();
void
OnUp
(
wxCommandEvent
&
event
);
void
OnUp
(
wxCommandEvent
&
event
);
void
OnDown
(
wxCommandEvent
&
event
);
void
OnDown
(
wxCommandEvent
&
event
);
void
OnEnableSelection
(
wxCommandEvent
&
event
);
void
OnDisableSelection
(
wxCommandEvent
&
event
);
void
OnInvertSelection
(
wxCommandEvent
&
event
);
void
OnDeleteSelection
(
wxCommandEvent
&
event
);
void
OnSelectAll
(
wxCommandEvent
&
event
);
void
OnRandom
(
wxCommandEvent
&
event
);
void
OnRandom
(
wxCommandEvent
&
event
);
void
OnRepeat
(
wxCommandEvent
&
event
);
void
OnRepeat
(
wxCommandEvent
&
event
);
void
OnLoop
(
wxCommandEvent
&
event
);
void
OnLoop
(
wxCommandEvent
&
event
);
...
@@ -827,7 +839,11 @@ private:
...
@@ -827,7 +839,11 @@ private:
void
OnKeyDown
(
wxTreeEvent
&
event
);
void
OnKeyDown
(
wxTreeEvent
&
event
);
void
OnNewGroup
(
wxCommandEvent
&
event
);
void
OnNewGroup
(
wxCommandEvent
&
event
);
/* Popup functions */
/* Popup */
wxMenu
*
popup_menu
;
wxTreeItemId
i_popup_item
;
playlist_item_t
*
p_popup_item
;
playlist_item_t
*
p_popup_parent
;
void
OnPopup
(
wxContextMenuEvent
&
event
);
void
OnPopup
(
wxContextMenuEvent
&
event
);
void
OnPopupPlay
(
wxMenuEvent
&
event
);
void
OnPopupPlay
(
wxMenuEvent
&
event
);
void
OnPopupSort
(
wxMenuEvent
&
event
);
void
OnPopupSort
(
wxMenuEvent
&
event
);
...
@@ -840,46 +856,34 @@ private:
...
@@ -840,46 +856,34 @@ private:
void
UpdateNode
(
playlist_t
*
,
playlist_item_t
*
,
wxTreeItemId
);
void
UpdateNode
(
playlist_t
*
,
playlist_item_t
*
,
wxTreeItemId
);
void
UpdateNodeChildren
(
playlist_t
*
,
playlist_item_t
*
,
wxTreeItemId
);
void
UpdateNodeChildren
(
playlist_t
*
,
playlist_item_t
*
,
wxTreeItemId
);
void
CreateNode
(
playlist_t
*
,
playlist_item_t
*
,
wxTreeItemId
);
void
CreateNode
(
playlist_t
*
,
playlist_item_t
*
,
wxTreeItemId
);
void
UpdateTreeItem
(
playlist_t
*
,
wxTreeItemId
);
void
SetCurrentItem
(
wxTreeItemId
);
/* Search (internal) */
int
CountItems
(
wxTreeItemId
);
wxTreeItemId
FindItem
(
wxTreeItemId
,
playlist_item_t
*
);
wxTreeItemId
FindItem
(
wxTreeItemId
,
playlist_item_t
*
);
wxTreeItemId
FindItemByName
(
wxTreeItemId
,
wxString
,
wxTreeItemId
,
vlc_bool_t
*
);
wxTreeItemId
FindItemByName
(
wxTreeItemId
,
wxString
,
void
SetCurrentItem
(
wxTreeItemId
);
wxTreeItemId
,
vlc_bool_t
*
);
void
UpdateTreeItem
(
playlist_t
*
,
wxTreeItemId
);
/* Custom events */
/* Custom events */
void
OnPlaylistEvent
(
wxCommandEvent
&
event
);
void
OnPlaylistEvent
(
wxCommandEvent
&
event
);
wxTextCtrl
*
search_text
;
wxButton
*
search_button
;
DECLARE_EVENT_TABLE
();
DECLARE_EVENT_TABLE
();
wxMenu
*
popup_menu
;
wxMenu
*
p_view_menu
;
wxMenu
*
p_sd_menu
;
char
**
pp_sds
;
/* Global widgets */
wxStatusBar
*
statusbar
;
wxStatusBar
*
statusbar
;
ItemInfoDialog
*
iteminfo_dialog
;
ItemInfoDialog
*
iteminfo_dialog
;
intf_thread_t
*
p_intf
;
wxTreeCtrl
*
treectrl
;
int
i_update_counter
;
int
i_update_counter
;
int
i_sort_mode
;
intf_thread_t
*
p_intf
;
wxTreeCtrl
*
treectrl
;
int
i_current_view
;
int
i_current_view
;
vlc_bool_t
b_changed_view
;
char
**
pp_sds
;
wxTreeItemId
i_popup_item
;
wxTreeItemId
search_current
;
playlist_item_t
*
p_popup_item
;
playlist_item_t
*
p_popup_parent
;
int
i_title_sorted
;
int
i_author_sorted
;
int
i_group_sorted
;
int
i_duration_sorted
;
};
};
/* ItemInfo Dialog */
/* ItemInfo Dialog */
...
@@ -923,7 +927,6 @@ private:
...
@@ -923,7 +927,6 @@ private:
wxTreeCtrl
*
info_tree
;
wxTreeCtrl
*
info_tree
;
wxTreeItemId
info_root
;
wxTreeItemId
info_root
;
wxCheckBox
*
enabled_checkbox
;
};
};
...
...
modules/services_discovery/sap.c
View file @
f5009d6f
...
@@ -738,19 +738,20 @@ static int ParseSAP( services_discovery_t *p_sd, uint8_t *p_buffer, int i_read )
...
@@ -738,19 +738,20 @@ static int ParseSAP( services_discovery_t *p_sd, uint8_t *p_buffer, int i_read )
}
}
/* Decide whether we should add a playlist item for this SDP */
/* Decide whether we should add a playlist item for this SDP */
/* Multi-media or no-parse -> pass to LIVE.COM */
if
(
p_sdp
->
i_media
>
1
||
p_sd
->
p_sys
->
b_parse
==
VLC_FALSE
)
{
asprintf
(
&
p_sdp
->
psz_uri
,
"sdp://%s"
,
p_sdp
->
psz_sdp
);
}
else
{
/* Parse connection information (c= & m= ) */
/* Parse connection information (c= & m= ) */
if
(
ParseConnection
(
VLC_OBJECT
(
p_sd
),
p_sdp
)
)
if
(
ParseConnection
(
VLC_OBJECT
(
p_sd
),
p_sdp
)
)
{
{
p_sdp
->
psz_uri
=
NULL
;
p_sdp
->
psz_uri
=
NULL
;
}
}
/* Multi-media or no-parse -> pass to LIVE.COM */
if
(
p_sdp
->
i_media
>
1
||
(
p_sdp
->
i_media_type
!=
14
&&
p_sdp
->
i_media_type
!=
32
&&
p_sdp
->
i_media_type
!=
33
)
||
p_sd
->
p_sys
->
b_parse
==
VLC_FALSE
)
{
if
(
p_sdp
->
psz_uri
)
free
(
p_sdp
->
psz_uri
);
asprintf
(
&
p_sdp
->
psz_uri
,
"sdp://%s"
,
p_sdp
->
psz_sdp
);
}
}
if
(
p_sdp
->
psz_uri
==
NULL
)
return
VLC_EGENERIC
;
if
(
p_sdp
->
psz_uri
==
NULL
)
return
VLC_EGENERIC
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment