]> git.sesse.net Git - vlc/commitdiff
Update the info displayed in the playlist when you change the play mode in the menu...
authorBenjamin Pracht <bigben@videolan.org>
Tue, 12 Apr 2005 18:46:26 +0000 (18:46 +0000)
committerBenjamin Pracht <bigben@videolan.org>
Tue, 12 Apr 2005 18:46:26 +0000 (18:46 +0000)
modules/gui/macosx/controls.m
modules/gui/macosx/intf.h
modules/gui/macosx/intf.m
modules/gui/macosx/playlist.h
modules/gui/macosx/playlist.m

index 8ec38f0edf1b04da2cb716a57b7fe53a02f1e781..da8ba321699752cc967d17b33c3b695781143cd8 100644 (file)
     else
     {
         vout_OSDMessage( p_intf, DEFAULT_CHAN, _( "Random Off" ) );
-    }    
+    }
 
-    p_intf->p_sys->b_playlist_update = VLC_TRUE;
+    p_intf->p_sys->b_playmode_update = VLC_TRUE;
     p_intf->p_sys->b_intf_update = VLC_TRUE;
     vlc_object_release( p_playlist );
 }
 
     var_Get( p_playlist, "repeat", &val );
     if (!val.b_bool)
-    {   
+    {
         var_Set( p_playlist, "loop", val );
-    } 
+    }
     val.b_bool = !val.b_bool;
     var_Set( p_playlist, "repeat", val );
     if( val.b_bool )
         vout_OSDMessage( p_intf, DEFAULT_CHAN, _( "Repeat Off" ) );
     }
 
-    p_intf->p_sys->b_playlist_update = VLC_TRUE;    
+    p_intf->p_sys->b_playmode_update = VLC_TRUE;
     p_intf->p_sys->b_intf_update = VLC_TRUE;
     vlc_object_release( p_playlist );
 }
     else
     {
         vout_OSDMessage( p_intf, DEFAULT_CHAN, _( "Repeat Off" ) );
-    }    
+    }
 
-    p_intf->p_sys->b_playlist_update = VLC_TRUE;
+    p_intf->p_sys->b_playmode_update = VLC_TRUE;
     p_intf->p_sys->b_intf_update = VLC_TRUE;
     vlc_object_release( p_playlist );
 }
index c63b52a1bfe8ce28ef5b2a9dcf9248a0ea782ec4..9e029a09611b07017815e4c74a397699c81f789a 100644 (file)
@@ -63,6 +63,7 @@ struct intf_sys_t
     /* interface update */
     vlc_bool_t b_intf_update;
     vlc_bool_t b_playlist_update;
+    vlc_bool_t b_playmode_update;
     vlc_bool_t b_current_title_update;
     vlc_bool_t b_fullscreen_update;
 
index b7eee97cc6f81ac8659e6241f0f6c35334eb1613..f4238101bc3620d2939ab120ec0b03a0bd325b8c 100644 (file)
@@ -179,6 +179,7 @@ int PlaylistChanged( vlc_object_t *p_this, const char *psz_variable,
     intf_thread_t * p_intf = VLCIntf;
     p_intf->p_sys->b_playlist_update = TRUE;
     p_intf->p_sys->b_intf_update = TRUE;
+    p_intf->p_sys->b_playmode_update = TRUE;
     return VLC_SUCCESS;
 }
 
@@ -876,7 +877,12 @@ static VLCMain *_o_sharedMainInstance = nil;
         p_intf->p_sys->b_intf_update = VLC_FALSE;
     }
 
-    if ( p_intf->p_sys->b_playlist_update )
+    if( p_intf->p_sys->b_playmode_update )
+    {
+        [o_playlist playModeUpdated];
+        p_intf->p_sys->b_playmode_update = VLC_FALSE;
+    }
+    if( p_intf->p_sys->b_playlist_update )
     {
         [o_playlist playlistUpdated];
         p_intf->p_sys->b_playlist_update = VLC_FALSE;
index 995265bb00826e4dd70a6af3f816baa026e626ea..f69b3fe548857db8af9d0b9249174e8884a1df91 100644 (file)
     IBOutlet id o_mi_selectall;
     IBOutlet id o_mi_sort_name;
     IBOutlet id o_mi_sort_author;
-    
+
     /* "services discovery" menu in the playlist menu */
     IBOutlet id o_mi_services;
     IBOutlet id o_mu_services;
-    
+
     /* "services discovery" menu in the main menu */
     IBOutlet id o_mm_mi_services;
     IBOutlet id o_mm_mu_services;
@@ -85,6 +85,7 @@
 - (IBAction)searchItem:(id)sender;
 
 - (void)playlistUpdated;
+- (void)playModeUpdated;
 - (void)sortNode:(int)i_mode;
 - (void)updateRowSelection;
 
index 8b79e77378d985dc43c3159e546862bb2696b844..3fe224f9c3b0c62171e9038b01f01bf0d6fdc962 100644 (file)
@@ -239,6 +239,38 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
     [o_outline_view reloadData];
 }
 
+- (void)playModeUpdated
+{
+    playlist_t *p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST,
+                                          FIND_ANYWHERE );
+    vlc_value_t val, val2;
+
+    if( p_playlist == NULL )
+    {
+        return;
+    }
+
+    var_Get( p_playlist, "loop", &val2 );
+    var_Get( p_playlist, "repeat", &val );
+    if( val.b_bool == VLC_TRUE )
+    {
+        [o_loop_popup selectItemAtIndex: 1];
+   }
+    else if( val2.b_bool == VLC_TRUE )
+    {
+        [o_loop_popup selectItemAtIndex: 2];
+    }
+    else
+    {
+        [o_loop_popup selectItemAtIndex: 0];
+    }
+
+    var_Get( p_playlist, "random", &val );
+    [o_random_ckb setState: val.b_bool];
+
+    vlc_object_release( p_playlist );
+}
+
 - (void)updateRowSelection
 {
     int i,i_row;