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
382926a8
Commit
382926a8
authored
Nov 08, 2004
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
include services discovery in interface
parent
e56a6361
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
114 additions
and
39 deletions
+114
-39
include/vlc_playlist.h
include/vlc_playlist.h
+2
-0
modules/gui/wxwindows/menus.cpp
modules/gui/wxwindows/menus.cpp
+1
-1
modules/gui/wxwindows/playlist.cpp
modules/gui/wxwindows/playlist.cpp
+85
-38
modules/gui/wxwindows/wxwindows.h
modules/gui/wxwindows/wxwindows.h
+4
-0
src/playlist/playlist.c
src/playlist/playlist.c
+3
-0
src/playlist/services_discovery.c
src/playlist/services_discovery.c
+19
-0
No files found.
include/vlc_playlist.h
View file @
382926a8
...
@@ -231,6 +231,8 @@ VLC_EXPORT( int, playlist_Clear, ( playlist_t * ) );
...
@@ -231,6 +231,8 @@ VLC_EXPORT( int, playlist_Clear, ( playlist_t * ) );
VLC_EXPORT
(
int
,
playlist_ServicesDiscoveryAdd
,
(
playlist_t
*
,
const
char
*
));
VLC_EXPORT
(
int
,
playlist_ServicesDiscoveryAdd
,
(
playlist_t
*
,
const
char
*
));
VLC_EXPORT
(
void
,
playlist_ServicesDiscoveryRemove
,
(
playlist_t
*
,
const
char
*
));
VLC_EXPORT
(
void
,
playlist_ServicesDiscoveryRemove
,
(
playlist_t
*
,
const
char
*
));
VLC_EXPORT
(
int
,
playlist_AddSDModules
,
(
playlist_t
*
,
char
*
));
VLC_EXPORT
(
int
,
playlist_AddSDModules
,
(
playlist_t
*
,
char
*
));
VLC_EXPORT
(
vlc_bool_t
,
playlist_IsServicesDiscoveryLoaded
,
(
playlist_t
*
,
const
char
*
));
/* Item management functions (act on items) */
/* Item management functions (act on items) */
#define playlist_AddItem(p,pi,i1,i2) playlist_ItemAdd(p,pi,i1,i2)
#define playlist_AddItem(p,pi,i1,i2) playlist_ItemAdd(p,pi,i1,i2)
...
...
modules/gui/wxwindows/menus.cpp
View file @
382926a8
modules/gui/wxwindows/playlist.cpp
View file @
382926a8
...
@@ -107,7 +107,13 @@ enum
...
@@ -107,7 +107,13 @@ enum
/* custom events */
/* custom events */
UpdateItem_Event
,
UpdateItem_Event
,
MenuDummy_Event
=
wxID_HIGHEST
+
999
,
FirstView_Event
=
wxID_HIGHEST
+
1000
,
FirstView_Event
=
wxID_HIGHEST
+
1000
,
LastView_Event
=
wxID_HIGHEST
+
1100
,
FirstSD_Event
=
wxID_HIGHEST
+
2000
,
LastSD_Event
=
wxID_HIGHEST
+
2100
,
};
};
DEFINE_LOCAL_EVENT_TYPE
(
wxEVT_PLAYLIST
);
DEFINE_LOCAL_EVENT_TYPE
(
wxEVT_PLAYLIST
);
...
@@ -205,6 +211,7 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ):
...
@@ -205,6 +211,7 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ):
SetIcon
(
*
p_intf
->
p_sys
->
p_icon
);
SetIcon
(
*
p_intf
->
p_sys
->
p_icon
);
p_view_menu
=
NULL
;
p_view_menu
=
NULL
;
p_sd_menu
=
SDMenu
();
i_current_view
=
VIEW_SIMPLE
;
i_current_view
=
VIEW_SIMPLE
;
...
@@ -222,6 +229,9 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ):
...
@@ -222,6 +229,9 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ):
manage_menu
->
Append
(
AddFile_Event
,
wxU
(
_
(
"&Simple Add..."
))
);
manage_menu
->
Append
(
AddFile_Event
,
wxU
(
_
(
"&Simple Add..."
))
);
manage_menu
->
Append
(
AddMRL_Event
,
wxU
(
_
(
"&Add MRL..."
))
);
manage_menu
->
Append
(
AddMRL_Event
,
wxU
(
_
(
"&Add MRL..."
))
);
manage_menu
->
AppendSeparator
();
manage_menu
->
AppendSeparator
();
manage_menu
->
Append
(
MenuDummy_Event
,
wxU
(
_
(
"Services discovery"
)),
p_sd_menu
);
manage_menu
->
AppendSeparator
();
manage_menu
->
Append
(
Open_Event
,
wxU
(
_
(
"&Open Playlist..."
))
);
manage_menu
->
Append
(
Open_Event
,
wxU
(
_
(
"&Open Playlist..."
))
);
manage_menu
->
Append
(
Save_Event
,
wxU
(
_
(
"&Save Playlist..."
))
);
manage_menu
->
Append
(
Save_Event
,
wxU
(
_
(
"&Save Playlist..."
))
);
manage_menu
->
AppendSeparator
();
manage_menu
->
AppendSeparator
();
...
@@ -1090,12 +1100,6 @@ void Playlist::OnDisableSelection( wxCommandEvent& WXUNUSED(event) )
...
@@ -1090,12 +1100,6 @@ void Playlist::OnDisableSelection( wxCommandEvent& WXUNUSED(event) )
void
Playlist
::
OnSelectAll
(
wxCommandEvent
&
WXUNUSED
(
event
)
)
void
Playlist
::
OnSelectAll
(
wxCommandEvent
&
WXUNUSED
(
event
)
)
{
{
#if 0
for( long item = 0; item < listview->GetItemCount(); item++ )
{
listview->Select( item, TRUE );
}
#endif
}
}
/**********************************************************************
/**********************************************************************
...
@@ -1203,12 +1207,6 @@ void Playlist::ShowInfos( int i_item )
...
@@ -1203,12 +1207,6 @@ void Playlist::ShowInfos( int i_item )
void
Playlist
::
OnInfos
(
wxCommandEvent
&
WXUNUSED
(
event
)
)
void
Playlist
::
OnInfos
(
wxCommandEvent
&
WXUNUSED
(
event
)
)
{
{
/* We use the first selected item, so find it */
#if 0
long i_item = listview->GetNextItem( -1, wxLIST_NEXT_ALL,
wxLIST_STATE_SELECTED );
ShowInfos( i_item );
#endif
}
}
void
Playlist
::
OnEnDis
(
wxCommandEvent
&
event
)
void
Playlist
::
OnEnDis
(
wxCommandEvent
&
event
)
...
@@ -1220,15 +1218,6 @@ void Playlist::OnEnDis( wxCommandEvent& event )
...
@@ -1220,15 +1218,6 @@ void Playlist::OnEnDis( wxCommandEvent& event )
{
{
return
;
return
;
}
}
#if 0
long i_item = listview->GetNextItem( -1, wxLIST_NEXT_ALL,
wxLIST_STATE_SELECTED );
if( i_item >= 0 && i_item < p_playlist->i_size )
{
Rebuild();
}
#endif
vlc_object_release
(
p_playlist
);
vlc_object_release
(
p_playlist
);
}
}
...
@@ -1266,6 +1255,8 @@ void Playlist::OnMenuEvent( wxCommandEvent& event )
...
@@ -1266,6 +1255,8 @@ void Playlist::OnMenuEvent( wxCommandEvent& event )
event
.
Skip
();
event
.
Skip
();
return
;
return
;
}
}
else
if
(
event
.
GetId
()
<
LastView_Event
)
{
int
i_new_view
=
event
.
GetId
()
-
FirstView_Event
;
int
i_new_view
=
event
.
GetId
()
-
FirstView_Event
;
...
@@ -1279,7 +1270,8 @@ void Playlist::OnMenuEvent( wxCommandEvent& event )
...
@@ -1279,7 +1270,8 @@ void Playlist::OnMenuEvent( wxCommandEvent& event )
vlc_object_release
(
p_playlist
);
vlc_object_release
(
p_playlist
);
return
;
return
;
}
}
else
if
(
i_new_view
>=
VIEW_FIRST_SORTED
&&
i_new_view
<=
VIEW_LAST_SORTED
)
else
if
(
i_new_view
>=
VIEW_FIRST_SORTED
&&
i_new_view
<=
VIEW_LAST_SORTED
)
{
{
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
);
...
@@ -1288,7 +1280,21 @@ void Playlist::OnMenuEvent( wxCommandEvent& event )
...
@@ -1288,7 +1280,21 @@ void Playlist::OnMenuEvent( wxCommandEvent& event )
Rebuild
();
Rebuild
();
}
}
}
else
if
(
event
.
GetId
()
>=
FirstSD_Event
&&
event
.
GetId
()
<
LastSD_Event
)
{
if
(
!
playlist_IsServicesDiscoveryLoaded
(
p_playlist
,
pp_sds
[
event
.
GetId
()
-
FirstSD_Event
]
)
)
{
playlist_ServicesDiscoveryAdd
(
p_playlist
,
pp_sds
[
event
.
GetId
()
-
FirstSD_Event
]
);
}
else
{
playlist_ServicesDiscoveryRemove
(
p_playlist
,
pp_sds
[
event
.
GetId
()
-
FirstSD_Event
]
);
}
}
vlc_object_release
(
p_playlist
);
vlc_object_release
(
p_playlist
);
}
}
...
@@ -1339,6 +1345,47 @@ wxMenu * Playlist::ViewMenu()
...
@@ -1339,6 +1345,47 @@ wxMenu * Playlist::ViewMenu()
return
p_view_menu
;
return
p_view_menu
;
}
}
wxMenu
*
Playlist
::
SDMenu
()
{
playlist_t
*
p_playlist
=
(
playlist_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
if
(
!
p_playlist
)
{
return
NULL
;
}
vlc_value_t
val
,
val_list
,
text_list
;
p_sd_menu
=
new
wxMenu
;
vlc_list_t
*
p_list
=
vlc_list_find
(
p_playlist
,
VLC_OBJECT_MODULE
,
FIND_ANYWHERE
);
int
i_number
=
0
;
for
(
int
i_index
=
0
;
i_index
<
p_list
->
i_count
;
i_index
++
)
{
module_t
*
p_parser
=
(
module_t
*
)
p_list
->
p_values
[
i_index
].
p_object
;
if
(
!
strcmp
(
p_parser
->
psz_capability
,
"services_discovery"
)
)
{
p_sd_menu
->
AppendCheckItem
(
FirstSD_Event
+
i_number
,
wxU
(
p_parser
->
psz_longname
?
p_parser
->
psz_longname
:
p_parser
->
psz_shortname
)
);
if
(
playlist_IsServicesDiscoveryLoaded
(
p_playlist
,
p_parser
->
psz_shortname
)
)
{
p_sd_menu
->
Check
(
FirstSD_Event
+
i_number
,
TRUE
);
}
INSERT_ELEM
(
(
void
**
)
pp_sds
,
i_number
,
i_number
,
(
void
*
)
p_parser
->
psz_shortname
);
}
}
vlc_list_release
(
p_list
);
vlc_object_release
(
p_playlist
);
return
p_sd_menu
;
}
/*****************************************************************************
/*****************************************************************************
* Popup management functions
* Popup management functions
...
...
modules/gui/wxwindows/wxwindows.h
View file @
382926a8
...
@@ -806,6 +806,7 @@ private:
...
@@ -806,6 +806,7 @@ private:
void
OnMenuOpen
(
wxMenuEvent
&
event
);
void
OnMenuOpen
(
wxMenuEvent
&
event
);
wxMenu
*
ViewMenu
();
wxMenu
*
ViewMenu
();
wxMenu
*
SDMenu
();
void
OnUp
(
wxCommandEvent
&
event
);
void
OnUp
(
wxCommandEvent
&
event
);
void
OnDown
(
wxCommandEvent
&
event
);
void
OnDown
(
wxCommandEvent
&
event
);
...
@@ -849,6 +850,9 @@ private:
...
@@ -849,6 +850,9 @@ private:
wxMenu
*
popup_menu
;
wxMenu
*
popup_menu
;
wxMenu
*
p_view_menu
;
wxMenu
*
p_view_menu
;
wxMenu
*
p_sd_menu
;
char
**
pp_sds
;
ItemInfoDialog
*
iteminfo_dialog
;
ItemInfoDialog
*
iteminfo_dialog
;
...
...
src/playlist/playlist.c
View file @
382926a8
...
@@ -60,6 +60,7 @@ int playlist_vaControl( playlist_t * p_playlist, int i_query, va_list args );
...
@@ -60,6 +60,7 @@ int playlist_vaControl( playlist_t * p_playlist, int i_query, va_list args );
*/
*/
playlist_t
*
__playlist_Create
(
vlc_object_t
*
p_parent
)
playlist_t
*
__playlist_Create
(
vlc_object_t
*
p_parent
)
{
{
int
i_index
;
playlist_t
*
p_playlist
;
playlist_t
*
p_playlist
;
playlist_view_t
*
p_view
;
playlist_view_t
*
p_view
;
vlc_value_t
val
;
vlc_value_t
val
;
...
@@ -91,6 +92,7 @@ playlist_t * __playlist_Create ( vlc_object_t *p_parent )
...
@@ -91,6 +92,7 @@ playlist_t * __playlist_Create ( vlc_object_t *p_parent )
val
.
b_bool
=
VLC_TRUE
;
val
.
b_bool
=
VLC_TRUE
;
var_Set
(
p_playlist
,
"intf-show"
,
val
);
var_Set
(
p_playlist
,
"intf-show"
,
val
);
/* Variables to control playback */
/* Variables to control playback */
var_CreateGetBool
(
p_playlist
,
"play-and-stop"
);
var_CreateGetBool
(
p_playlist
,
"play-and-stop"
);
var_CreateGetBool
(
p_playlist
,
"random"
);
var_CreateGetBool
(
p_playlist
,
"random"
);
...
@@ -923,6 +925,7 @@ static int ItemChange( vlc_object_t *p_obj, const char *psz_var,
...
@@ -923,6 +925,7 @@ static int ItemChange( vlc_object_t *p_obj, const char *psz_var,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
param
)
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
param
)
{
{
playlist_t
*
p_playlist
=
(
playlist_t
*
)
param
;
playlist_t
*
p_playlist
=
(
playlist_t
*
)
param
;
int
i_index
;
//p_playlist->b_need_update = VLC_TRUE;
//p_playlist->b_need_update = VLC_TRUE;
var_SetInteger
(
p_playlist
,
"item-change"
,
newval
.
i_int
);
var_SetInteger
(
p_playlist
,
"item-change"
,
newval
.
i_int
);
...
...
src/playlist/services_discovery.c
View file @
382926a8
...
@@ -113,6 +113,25 @@ void playlist_ServicesDiscoveryRemove( playlist_t * p_playlist,
...
@@ -113,6 +113,25 @@ void playlist_ServicesDiscoveryRemove( playlist_t * p_playlist,
return
;
return
;
}
}
vlc_bool_t
playlist_IsServicesDiscoveryLoaded
(
playlist_t
*
p_playlist
,
const
char
*
psz_module
)
{
int
i
;
vlc_mutex_lock
(
&
p_playlist
->
object_lock
);
for
(
i
=
0
;
i
<
p_playlist
->
i_sds
;
i
++
)
{
if
(
!
strcmp
(
psz_module
,
p_playlist
->
pp_sds
[
i
]
->
psz_module
)
)
{
vlc_mutex_unlock
(
&
p_playlist
->
object_lock
);
return
VLC_TRUE
;
}
}
vlc_mutex_unlock
(
&
p_playlist
->
object_lock
);
return
VLC_FALSE
;
}
/**
/**
* Load all service discovery modules in a string
* Load all service discovery modules in a string
*
*
...
...
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