]> git.sesse.net Git - vlc/blobdiff - modules/gui/wxwidgets/dialogs/playlist.cpp
[patch] unifying meta-information access, the 2nd by Daniel Stränger
[vlc] / modules / gui / wxwidgets / dialogs / playlist.cpp
index c0bc2521f06b0e2ca82cd4d6d5b4e7d7655ec2a8..860ad376013e8f98434617b3de7394b54066e833 100644 (file)
@@ -4,8 +4,8 @@
  * Copyright (C) 2000-2005 the VideoLAN team
  * $Id$
  *
- * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
- *          Clément Stenac <zorglub@videolan.org>
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Clément Stenac <zorglub@videolan.org>
  *
  * This program is free software; you can redistribute it and/OR MODIFy
  * it under the terms of the GNU General Public License as published by
@@ -19,7 +19,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 /*****************************************************************************
@@ -47,6 +47,8 @@
 #include <wx/dynarray.h>
 #include <wx/imaglist.h>
 
+#include <vlc_meta.h>
+
 #define HELP_SHUFFLE N_( "Shuffle" )
 #define HELP_LOOP N_( "Repeat All" )
 #define HELP_REPEAT N_( "Repeat One" )
@@ -60,9 +62,9 @@ static int PlaylistNext( vlc_object_t *, const char *,
 static int ItemChanged( vlc_object_t *, const char *,
                         vlc_value_t, vlc_value_t, void * );
 static int ItemAppended( vlc_object_t *p_this, const char *psz_variable,
-                      vlc_value_t oval, vlc_value_t nval, void *param );
+                         vlc_value_t oval, vlc_value_t nval, void *param );
 static int ItemDeleted( vlc_object_t *p_this, const char *psz_variable,
-                      vlc_value_t oval, vlc_value_t nval, void *param );
+                        vlc_value_t oval, vlc_value_t nval, void *param );
 
 /*****************************************************************************
  * Event Table.
@@ -492,8 +494,7 @@ void Playlist::UpdateTreeItem( wxTreeItemId item )
     wxString msg;
     wxString duration = wxU( "" );
     char *psz_author = vlc_input_item_GetInfo( &p_item->input,
-                                                     _("Meta-information"),
-                                                     _("Artist"));
+                                               _(VLC_META_INFO_CAT), _(VLC_META_ARTIST) );
     if( !psz_author )
     {
         UnlockPlaylist( p_intf->p_sys, p_playlist );
@@ -517,7 +518,7 @@ void Playlist::UpdateTreeItem( wxTreeItemId item )
     else
     {
         msg = wxString(wxU( psz_author )) + wxT(" - ") +
-                    wxString(wxU(p_item->input.psz_name)) + duration;
+              wxString(wxU(p_item->input.psz_name)) + duration;
     }
     free( psz_author );
     treectrl->SetItemText( item , msg );
@@ -874,7 +875,7 @@ void Playlist::DeleteTreeItem( wxTreeItemId item )
 
 void Playlist::DeleteItem( int item_id )
 {
-    playlist_LockDelete( p_playlist, item_id );
+    playlist_Delete( p_playlist, item_id );
 }
 
 void Playlist::DeleteNode( playlist_item_t *p_item )
@@ -1016,6 +1017,7 @@ void Playlist::OnSearch( wxCommandEvent& WXUNUSED(event) )
     {
         search_current = found;
         treectrl->EnsureVisible( found );
+        treectrl->UnselectAll();
         treectrl->SelectItem( found, true );
     }
 }
@@ -1100,7 +1102,8 @@ void Playlist::OnActivateItem( wxTreeEvent& event )
     else
     {
         p_node = p_item2;
-        if( p_node && p_node->i_children > 0 &&
+        p_item = NULL;
+/*        if( p_node && p_node->i_children > 0 &&
             p_node->pp_children[0]->i_children == -1)
         {
             p_item = p_node->pp_children[0];
@@ -1108,7 +1111,7 @@ void Playlist::OnActivateItem( wxTreeEvent& event )
         else
         {
             p_item = NULL;
-        }
+        }*/
     }
 
     playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, i_current_view,