]> git.sesse.net Git - vlc/blobdiff - modules/gui/beos/InterfaceWindow.cpp
Merge commit 'origin/base'
[vlc] / modules / gui / beos / InterfaceWindow.cpp
index 5fe92d4f648ee47b58edd35f9809bb0358bf5441..79873d589765e21f995f9ac42bed5ccf72237500 100644 (file)
@@ -207,9 +207,9 @@ InterfaceWindow::InterfaceWindow( intf_thread_t * _p_intf, BRect frame,
 
     var_AddCallback( p_playlist, "intf-change", PlaylistChanged, this );
     var_AddCallback( p_playlist, "item-change", PlaylistChanged, this );
-    var_AddCallback( p_playlist, "item-append", PlaylistChanged, this );
-    var_AddCallback( p_playlist, "item-deleted", PlaylistChanged, this );
-    var_AddCallback( p_playlist, "playlist-current", PlaylistChanged, this );
+    var_AddCallback( p_playlist, "playlist-item-append", PlaylistChanged, this );
+    var_AddCallback( p_playlist, "playlist-item-deleted", PlaylistChanged, this );
+    var_AddCallback( p_playlist, "item-current", PlaylistChanged, this );
 
     char psz_tmp[1024];
 #define ADD_ELLIPSIS( a ) \
@@ -662,38 +662,26 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
         case NAVIGATE_NEXT:
             if( p_input )
             {
-                vlc_value_t val, val_list;
-
                 /* First try to go to next chapter */
                 if( !var_Get( p_input, "chapter", &val ) )
                 {
-                    var_Change( p_input, "chapter", VLC_VAR_GETCHOICES,
-                                &val_list, NULL );
-                    if( val_list.p_list->i_count > val.i_int )
+                    int i_chapter_count = var_CountChoices( p_input, "chapter" );
+                    if( i_chapter_count > val.i_int )
                     {
-                        var_Change( p_input, "chapter", VLC_VAR_FREELIST,
-                                    &val_list, NULL );
                         var_SetVoid( p_input, "next-chapter" );
                         break;
                     }
-                    var_Change( p_input, "chapter", VLC_VAR_FREELIST,
-                                &val_list, NULL );
                 }
 
                 /* Try to go to next title */
                 if( !var_Get( p_input, "title", &val ) )
                 {
-                    var_Change( p_input, "title", VLC_VAR_GETCHOICES,
-                                &val_list, NULL );
-                    if( val_list.p_list->i_count > val.i_int )
+                    int i_title_count = var_CountChoices( p_input, "title" );
+                    if( i_title_count > val.i_int )
                     {
-                        var_Change( p_input, "title", VLC_VAR_FREELIST,
-                                    &val_list, NULL );
                         var_SetVoid( p_input, "next-title" );
                         break;
                     }
-                    var_Change( p_input, "title", VLC_VAR_FREELIST,
-                                &val_list, NULL );
                 }
 
                 /* Try to go to next file */
@@ -1264,7 +1252,7 @@ void LanguageMenu::AttachedToWindow()
         }
         AddItem( item );
     }
-    var_Change( p_input, psz_variable, VLC_VAR_FREELIST, &val_list, &text_list );
+    var_FreeList( &val_list, &text_list );
 
     vlc_object_release( p_input );
 
@@ -1327,8 +1315,7 @@ void TitleMenu::AttachedToWindow()
             AddItem( item );
         }
 
-        var_Change( p_input, "title", VLC_VAR_FREELIST,
-                    &val_list, &text_list );
+        var_FreeList( &val_list, &text_list );
     }
     vlc_object_release( p_input );
     BMenu::AttachedToWindow();
@@ -1391,8 +1378,7 @@ void ChapterMenu::AttachedToWindow()
             AddItem( item );
         }
 
-        var_Change( p_input, "chapter", VLC_VAR_FREELIST,
-                    &val_list, &text_list );
+        var_FreeList( &val_list, &text_list );
     }
     vlc_object_release( p_input );
     BMenu::AttachedToWindow();