]> git.sesse.net Git - vlc/blobdiff - modules/gui/wxwidgets/dialogs/playlist.cpp
Fixes wxwidgets compilation
[vlc] / modules / gui / wxwidgets / dialogs / playlist.cpp
index be17e11f46261409f316072c9a96c3c3b8777506..6ce94cf7c5c72e88d3f5af6b402fc94edf8c3e90 100644 (file)
@@ -505,7 +505,7 @@ void Playlist::UpdateTreeItem( wxTreeItemId item )
     if( !p_data ) return;
 
     playlist_item_t *p_item = playlist_ItemGetById( p_playlist,
-                                          ((PlaylistItem *)p_data)->i_id );
+                                    ((PlaylistItem *)p_data)->i_id, VLC_TRUE );
     if( !p_item )
     {
         UnlockPlaylist( p_intf->p_sys, p_playlist );
@@ -515,15 +515,15 @@ void Playlist::UpdateTreeItem( wxTreeItemId item )
     wxString msg;
     wxString duration = wxU( "" );
 
-    char *psz_author;
+    char *psz_artist;
     if( p_item->p_input->p_meta )
     {
-        psz_author= p_item->p_input->p_meta->psz_artist ?
+        psz_artist= p_item->p_input->p_meta->psz_artist ?
                         strdup( p_item->p_input->p_meta->psz_artist ) :
                         strdup("");
     }
     else
-        psz_author = strdup( "" );
+        psz_artist = strdup( "" );
 
     char psz_duration[MSTRTIME_MAX_SIZE];
     mtime_t dur = p_item->p_input->i_duration;
@@ -535,16 +535,16 @@ void Playlist::UpdateTreeItem( wxTreeItemId item )
                          wxU( " )" ) );
     }
 
-    if( !strcmp( psz_author, "" ) || p_item->p_input->b_fixed_name == VLC_TRUE )
+    if( !strcmp( psz_artist, "" ) || p_item->p_input->b_fixed_name == VLC_TRUE )
     {
         msg = wxString( wxU( p_item->p_input->psz_name ) ) + duration;
     }
     else
     {
-        msg = wxString(wxU( psz_author )) + wxT(" - ") +
+        msg = wxString(wxU( psz_artist )) + wxT(" - ") +
               wxString(wxU(p_item->p_input->psz_name)) + duration;
     }
-    free( psz_author );
+    free( psz_artist );
     treectrl->SetItemText( item , msg );
     treectrl->SetItemImage( item, p_item->p_input->i_type );
 
@@ -581,7 +581,7 @@ void Playlist::AppendItem( wxCommandEvent& event )
     node = FindItem( treectrl->GetRootItem(), p_add->i_node );
     if( !node.IsOk() ) goto update;
 
-    p_item = playlist_ItemGetById( p_playlist, p_add->i_item );
+    p_item = playlist_ItemGetById( p_playlist, p_add->i_item, VLC_TRUE );
     if( !p_item ) goto update;
     if( (p_item->i_flags & PLAYLIST_DBL_FLAG ) ) goto update;
 
@@ -744,7 +744,7 @@ int Playlist::CountItems( wxTreeItemId root )
         {
             playlist_item_t *p_item;
             LockPlaylist( p_intf->p_sys, p_playlist );
-            p_item = playlist_ItemGetById( p_playlist, ((PlaylistItem *)treectrl->GetItemData( item ))->i_id );
+            p_item = playlist_ItemGetById( p_playlist, ((PlaylistItem *)treectrl->GetItemData( item ))->i_id, VLC_TRUE );
             if( p_item && p_item->i_children == -1 )
                 count++;
             UnlockPlaylist( p_intf->p_sys, p_playlist );
@@ -890,7 +890,7 @@ void Playlist::DeleteTreeItem( wxTreeItemId item )
    p_wxitem = (PlaylistItem *)treectrl->GetItemData( item );
 
    LockPlaylist( p_intf->p_sys, p_playlist );
-   p_item = playlist_ItemGetById( p_playlist, p_wxitem->i_id );
+   p_item = playlist_ItemGetById( p_playlist, p_wxitem->i_id, VLC_TRUE );
 
    if( !p_item )
    {
@@ -907,7 +907,7 @@ void Playlist::DeleteTreeItem( wxTreeItemId item )
 
 void Playlist::DeleteItem( int item_id )
 {
-    playlist_DeleteAllFromInput( p_playlist, item_id );
+    playlist_DeleteFromInput( p_playlist, item_id, VLC_TRUE );
 }
 
 void Playlist::DeleteNode( playlist_item_t *p_item )
@@ -938,7 +938,7 @@ void Playlist::OnSave( wxCommandEvent& WXUNUSED(event) )
 
     wxString filter = wxT("");
 
-    if( p_playlist->i_size == 0 )
+    if( playlist_IsEmpty( p_playlist ) )
     {
         wxMessageBox( wxU(_("Playlist is empty") ), wxU(_("Can't save")),
                       wxICON_WARNING | wxOK, this );
@@ -978,9 +978,7 @@ void Playlist::OnOpen( wxCommandEvent& WXUNUSED(event) )
 
     if( dialog.ShowModal() == wxID_OK )
     {
-        playlist_Import( p_playlist, dialog.GetPath().mb_str(),
-                         /*FIXME: where do we want to insert ? */
-                         p_playlist->p_local_category, VLC_TRUE );
+        playlist_Import( p_playlist, dialog.GetPath().mb_str() );
     }
 }
 
@@ -1015,12 +1013,14 @@ void Playlist::OnSort( wxCommandEvent& event )
     {
         case SortTitle_Event:
             playlist_RecursiveNodeSort( p_playlist,
-                            playlist_ItemGetById( p_playlist, p_wxitem->i_id ),
+                            playlist_ItemGetById( p_playlist, p_wxitem->i_id,
+                                                  VLC_TRUE ),
                             SORT_TITLE_NODES_FIRST, ORDER_NORMAL );
             break;
         case RSortTitle_Event:
             playlist_RecursiveNodeSort( p_playlist,
-                            playlist_ItemGetById( p_playlist, p_wxitem->i_id ),
+                            playlist_ItemGetById( p_playlist, p_wxitem->i_id,
+                                                  VLC_TRUE ),
                             SORT_TITLE_NODES_FIRST, ORDER_REVERSE );
     }
     UnlockPlaylist( p_intf->p_sys, p_playlist );
@@ -1041,7 +1041,8 @@ void Playlist::OnSearch( wxCommandEvent& WXUNUSED(event) )
     wxString search_string = search_text->GetValue();
     PlaylistItem *p_wxroot;
     p_wxroot = (PlaylistItem *)treectrl->GetItemData( treectrl->GetRootItem() );
-    playlist_item_t *p_root = playlist_ItemGetById( p_playlist, p_wxroot->i_id );
+    playlist_item_t *p_root = playlist_ItemGetById( p_playlist, p_wxroot->i_id,
+                                                    VLC_TRUE );
 
     assert( p_root );
     char *psz_name = wxFromLocale( search_string );
@@ -1117,7 +1118,7 @@ void Playlist::OnActivateItem( wxTreeEvent& event )
         UnlockPlaylist( p_intf->p_sys, p_playlist );
         return;
     }
-    p_item = playlist_ItemGetById( p_playlist, p_wxitem->i_id );
+    p_item = playlist_ItemGetById( p_playlist, p_wxitem->i_id, VLC_TRUE );
 
     p_parent = p_item;
     while( p_parent )
@@ -1129,7 +1130,7 @@ void Playlist::OnActivateItem( wxTreeEvent& event )
 
     if( p_parent )
     {
-        playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, p_parent, p_item );
+        playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, VLC_TRUE, p_parent, p_item );
     }
     UnlockPlaylist( p_intf->p_sys, p_playlist );
 }
@@ -1172,7 +1173,7 @@ void Playlist::OnDragItemEnd( wxTreeEvent& event )
 
     if( !dest_tree_item.IsOk() ) return;
 
-    /* check that we're not trying to move a node into one of it's children */
+    /* check that we're not trying to move a node into one of its children */
     wxTreeItemId parent = dest_tree_item;
     while( parent != treectrl->GetRootItem() )
     {
@@ -1193,9 +1194,9 @@ void Playlist::OnDragItemEnd( wxTreeEvent& event )
     }
 
     playlist_item_t *p_drageditem =
-        playlist_ItemGetById(p_playlist, p_wxdrageditem->i_id );
+        playlist_ItemGetById(p_playlist, p_wxdrageditem->i_id, VLC_TRUE );
     playlist_item_t *p_destitem =
-        playlist_ItemGetById(p_playlist, p_wxdestitem->i_id );
+        playlist_ItemGetById(p_playlist, p_wxdestitem->i_id, VLC_TRUE );
     if( !p_drageditem || !p_destitem )
     {
         UnlockPlaylist( p_intf->p_sys, p_playlist );
@@ -1214,7 +1215,7 @@ void Playlist::OnDragItemEnd( wxTreeEvent& event )
             return;
         }
         playlist_item_t *p_destitem2 =
-            playlist_ItemGetById( p_playlist, p_parent->i_id );
+            playlist_ItemGetById( p_playlist, p_parent->i_id, VLC_TRUE );
         if( !p_destitem2 )
         {
             UnlockPlaylist( p_intf->p_sys, p_playlist );
@@ -1269,13 +1270,13 @@ bool PlaylistFileDropTarget::OnDropFiles( wxCoord x, wxCoord y,
     {
         PlaylistItem *p_plitem =
             (PlaylistItem *)p->treectrl->GetItemData( item );
-        p_dest = playlist_ItemGetById( p->p_playlist, p_plitem->i_id );
+        p_dest = playlist_ItemGetById( p->p_playlist, p_plitem->i_id, VLC_TRUE );
 
         if( p_dest->i_children == -1 )
         {
             /* This is a leaf. Append right after it
              * We thus need to find the parrent node and the position of the
-             * leaf in it's children list */
+             * leaf in its children list */
             wxTreeItemId parent = p->treectrl->GetItemParent( item );
             PlaylistItem *p_parent =
                 (PlaylistItem *)p->treectrl->GetItemData( parent );
@@ -1285,7 +1286,7 @@ bool PlaylistFileDropTarget::OnDropFiles( wxCoord x, wxCoord y,
                 return FALSE;
             }
             playlist_item_t *p_node =
-                playlist_ItemGetById( p->p_playlist, p_parent->i_id );
+                playlist_ItemGetById( p->p_playlist, p_parent->i_id, VLC_TRUE );
             if( !p_node )
             {
                 UnlockPlaylist( p->p_intf->p_sys, p->p_playlist );
@@ -1488,7 +1489,7 @@ void Playlist::OnPopup( wxContextMenuEvent& event )
         treectrl->SelectItem( i_wx_popup_item );
 
         LockPlaylist( p_intf->p_sys, p_playlist );
-        p_item = playlist_ItemGetById( p_playlist, i_popup_item );
+        p_item = playlist_ItemGetById( p_playlist, i_popup_item, VLC_TRUE );
 
         if( !p_item )
         {
@@ -1514,7 +1515,7 @@ void Playlist::OnPopupPlay( wxCommandEvent& event )
 {
     playlist_item_t *p_popup_item, *p_popup_parent;
     LockPlaylist( p_intf->p_sys, p_playlist );
-    p_popup_item = playlist_ItemGetById( p_playlist, i_popup_item );
+    p_popup_item = playlist_ItemGetById( p_playlist, i_popup_item, VLC_TRUE );
 
     p_popup_parent = p_popup_item;
     while( p_popup_parent )
@@ -1526,7 +1527,7 @@ void Playlist::OnPopupPlay( wxCommandEvent& event )
 
     if( p_popup_parent )
     {
-        playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, p_popup_parent,
+        playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, VLC_TRUE, p_popup_parent,
                           p_popup_item );
     }
     UnlockPlaylist( p_intf->p_sys, p_playlist );
@@ -1541,7 +1542,7 @@ void Playlist::Preparse()
 {
     playlist_item_t *p_popup_item;
     LockPlaylist( p_intf->p_sys, p_playlist );
-    p_popup_item = playlist_ItemGetById( p_playlist, i_popup_item );
+    p_popup_item = playlist_ItemGetById( p_playlist, i_popup_item, VLC_TRUE );
 
     if( p_popup_item != NULL )
     {
@@ -1579,7 +1580,7 @@ void Playlist::OnPopupSort( wxCommandEvent& event )
     p_wxitem = (PlaylistItem *)treectrl->GetItemData( i_wx_popup_item );
     LockPlaylist( p_intf->p_sys, p_playlist );
 
-    p_item = playlist_ItemGetById( p_playlist, p_wxitem->i_id );
+    p_item = playlist_ItemGetById( p_playlist, p_wxitem->i_id, VLC_TRUE );
     if( p_item->i_children >= 0 )
     {
         playlist_RecursiveNodeSort( p_playlist, p_item,
@@ -1596,7 +1597,9 @@ void Playlist::OnPopupSort( wxCommandEvent& event )
 void Playlist::OnPopupInfo( wxCommandEvent& event )
 {
     LockPlaylist( p_intf->p_sys, p_playlist );
-    playlist_item_t *p_popup_item = playlist_ItemGetById( p_playlist, i_popup_item );
+    playlist_item_t *p_popup_item = playlist_ItemGetById( p_playlist,
+                                                          i_popup_item,
+                                                          VLC_TRUE );
     if( p_popup_item )
     {
         iteminfo_dialog = new ItemInfoDialog( p_intf, p_popup_item, this );
@@ -1624,7 +1627,7 @@ void Playlist::OnPopupAddNode( wxCommandEvent& event )
 
     p_wxitem = (PlaylistItem *)treectrl->GetItemData( i_wx_popup_item );
 
-    p_item = playlist_ItemGetById( p_playlist, p_wxitem->i_id );
+    p_item = playlist_ItemGetById( p_playlist, p_wxitem->i_id, VLC_TRUE );
 
     playlist_NodeCreate( p_playlist, psz_name, p_item );
 
@@ -1640,7 +1643,8 @@ void Playlist::OnSourceSelected( wxListEvent &event )
 
    if( p_current_treeroot && i_id != p_current_treeroot->i_id )
    {
-       playlist_item_t *p_item = playlist_ItemGetById( p_playlist, i_id );
+       playlist_item_t *p_item = playlist_ItemGetById( p_playlist, i_id,
+                                                       VLC_TRUE );
        if( p_item ) p_current_treeroot = p_item;
        Rebuild( VLC_TRUE );
    }