- Helper modules<br />\r
- ** ASX and B4S parsers (see below)<br />\r
- * Rewrite SLP announce discovery<br />\r
- - *** Finish new SAP parser (see above)<br />\r
- ** Adapt CDDAX<br />\r
- ** Fix MP4, LIVE.COM<br />\r
- *** Implement in MacOS X and Skins 2 interfaces<br />\r
- ** Support item move/copy<br />\r
- * Explorer view<br />\r
- *** Fix search<br />\r
- - *** Play Node vs Play all<br />\r
- ** Clever update using i_serial<br />\r
- * Playlist preferences panel<br />\r
- ** Improve iteminfo dialog<br />\r
- - ** Support item types<br />\r
Status: Assigned to zorglub\r
\r
Task\r
typedef struct playlist_export_t playlist_export_t;
typedef struct services_discovery_t services_discovery_t;
typedef struct services_discovery_sys_t services_discovery_sys_t;
+typedef struct playlist_add_t playlist_add_t;
/* Modules */
typedef struct module_bank_t module_bank_t;
#define INTF_DIALOG_CAPTURE 5
#define INTF_DIALOG_SAT 6
+#define INTF_DIALOG_DIRECTORY 7
+
#define INTF_DIALOG_STREAMWIZARD 8
#define INTF_DIALOG_WIZARD 9
/*@}*/
};
+/* Helper to add an item */
+struct playlist_add_t
+{
+ playlist_item_t *p_parent;
+ playlist_item_t *p_item;
+ int i_view;
+ int i_position;
+};
+
#define SORT_ID 0
#define SORT_TITLE 1
#define SORT_AUTHOR 2
VLC_EXPORT( playlist_item_t *, playlist_ItemGetById, (playlist_t *, int) );
VLC_EXPORT( playlist_item_t *, playlist_ItemGetByPos, (playlist_t *, int) );
VLC_EXPORT( int, playlist_GetPositionById, (playlist_t *,int ) );
+VLC_EXPORT( playlist_item_t *, playlist_ItemGetByInput, (playlist_t *,input_item_t * ) );
/* Info functions */
VLC_EXPORT( char * , playlist_GetInfo, ( playlist_t * , int, const char *, const char *) );
void OnOpenFileGeneric( wxCommandEvent& event );
void OnOpenFileSimple( wxCommandEvent& event );
+ void OnOpenDirectory( wxCommandEvent& event );
void OnOpenFile( wxCommandEvent& event );
void OnOpenDisc( wxCommandEvent& event );
void OnOpenNet( wxCommandEvent& event );
/* Secondary windows */
OpenDialog *p_open_dialog;
wxFileDialog *p_file_dialog;
+ wxDirDialog *p_dir_dialog;
Playlist *p_playlist_dialog;
Messages *p_messages_dialog;
FileInfo *p_fileinfo_dialog;
DialogsProvider::OnOpenFileSimple)
EVT_COMMAND(INTF_DIALOG_FILE_GENERIC, wxEVT_DIALOG,
DialogsProvider::OnOpenFileGeneric)
+ EVT_COMMAND(INTF_DIALOG_DIRECTORY, wxEVT_DIALOG,
+ DialogsProvider::OnOpenDirectory)
EVT_COMMAND(INTF_DIALOG_PLAYLIST, wxEVT_DIALOG,
DialogsProvider::OnPlaylist)
vlc_object_release( p_playlist );
}
+void DialogsProvider::OnOpenDirectory( wxCommandEvent& event )
+{
+ playlist_t *p_playlist =
+ (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
+ FIND_ANYWHERE );
+ if( p_playlist == NULL )
+ {
+ return;
+ }
+
+ if( p_dir_dialog == NULL )
+ p_dir_dialog = new wxDirDialog( NULL );
+
+ if( p_dir_dialog && p_dir_dialog->ShowModal() == wxID_OK )
+ {
+ playlist_item_t *p_item;
+ wxString path = p_dir_dialog->GetPath();
+
+ int i_id = playlist_Add( p_playlist, (const char *)path.mb_str(),
+ (const char *)path.mb_str(),
+ PLAYLIST_APPEND, PLAYLIST_END );
+ p_item = playlist_ItemGetById( p_playlist, i_id );
+ if( p_item )
+ {
+ input_CreateThread( p_intf, &p_item->input );
+ }
+ }
+
+ vlc_object_release( p_playlist );
+}
+
void DialogsProvider::OnOpenFile( wxCommandEvent& event )
{
Open( FILE_ACCESS, event.GetInt() );
{
/* menu items */
AddFile_Event = 1,
+ AddDir_Event,
AddMRL_Event,
Close_Event,
Open_Event,
/* Menu events */
EVT_MENU(AddFile_Event, Playlist::OnAddFile)
+ EVT_MENU(AddDir_Event, Playlist::OnAddDir)
EVT_MENU(AddMRL_Event, Playlist::OnAddMRL)
EVT_MENU(Close_Event, Playlist::OnClose)
EVT_MENU(Open_Event, Playlist::OnOpen)
/* Create our "Manage" menu */
wxMenu *manage_menu = new wxMenu;
- manage_menu->Append( AddFile_Event, wxU(_("&Simple Add...")) );
+ manage_menu->Append( AddFile_Event, wxU(_("&Simple Add File...")) );
+ manage_menu->Append( AddDir_Event, wxU(_("Add &Directory...")) );
manage_menu->Append( AddMRL_Event, wxU(_("&Add MRL...")) );
manage_menu->AppendSeparator();
manage_menu->Append( MenuDummy_Event, wxU(_("Services discovery")),
}
+void Playlist::OnAddDir( wxCommandEvent& WXUNUSED(event) )
+{
+ p_intf->p_sys->pf_show_dialog( p_intf, INTF_DIALOG_DIRECTORY, 0, 0 );
+
+}
+
void Playlist::OnAddMRL( wxCommandEvent& WXUNUSED(event) )
{
p_intf->p_sys->pf_show_dialog( p_intf, INTF_DIALOG_FILE, 0, 0 );
void OnAbout( wxCommandEvent& event );
void OnOpenFileSimple( wxCommandEvent& event );
+ void OnOpenDir( wxCommandEvent& event );
void OnOpenFile( wxCommandEvent& event );
void OnOpenDisc( wxCommandEvent& event );
void OnOpenNet( wxCommandEvent& event );
/* Menu Handlers */
void OnAddFile( wxCommandEvent& event );
+ void OnAddDir( wxCommandEvent& event );
void OnAddMRL( wxCommandEvent& event );
void OnClose( wxCommandEvent& event );
void OnSearch( wxCommandEvent& event );
return NULL;
}
+/**
+ * Search an item by its input_item_t
+ *
+ * \param p_playlist the playlist
+ * \param p_item the input_item_t to find
+ * \return the item, or NULL on failure
+ */
+playlist_item_t * playlist_ItemGetByInput( playlist_t * p_playlist ,
+ input_item_t *p_item )
+{
+ int i;
+ for( i = 0 ; i < p_playlist->i_size ; i++ )
+ {
+ if( &p_playlist->pp_items[i]->input == p_item )
+ {
+ return p_playlist->pp_items[i];
+ }
+ }
+ return NULL;
+}