From 9778299925be8173a290893bce9112fd7e06d54b Mon Sep 17 00:00:00 2001 From: Benjamin Pracht Date: Tue, 12 Apr 2005 18:46:26 +0000 Subject: [PATCH] Update the info displayed in the playlist when you change the play mode in the menu (had this ever worked ?) --- modules/gui/macosx/controls.m | 14 +++++++------- modules/gui/macosx/intf.h | 1 + modules/gui/macosx/intf.m | 8 +++++++- modules/gui/macosx/playlist.h | 5 +++-- modules/gui/macosx/playlist.m | 32 ++++++++++++++++++++++++++++++++ 5 files changed, 50 insertions(+), 10 deletions(-) diff --git a/modules/gui/macosx/controls.m b/modules/gui/macosx/controls.m index 8ec38f0edf..da8ba32169 100644 --- a/modules/gui/macosx/controls.m +++ b/modules/gui/macosx/controls.m @@ -128,9 +128,9 @@ 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 ); } @@ -148,9 +148,9 @@ 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 ) @@ -162,7 +162,7 @@ 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 ); } @@ -192,9 +192,9 @@ 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 ); } diff --git a/modules/gui/macosx/intf.h b/modules/gui/macosx/intf.h index c63b52a1bf..9e029a0961 100644 --- a/modules/gui/macosx/intf.h +++ b/modules/gui/macosx/intf.h @@ -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; diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m index b7eee97cc6..f4238101bc 100644 --- a/modules/gui/macosx/intf.m +++ b/modules/gui/macosx/intf.m @@ -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; diff --git a/modules/gui/macosx/playlist.h b/modules/gui/macosx/playlist.h index 995265bb00..f69b3fe548 100644 --- a/modules/gui/macosx/playlist.h +++ b/modules/gui/macosx/playlist.h @@ -57,11 +57,11 @@ 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; diff --git a/modules/gui/macosx/playlist.m b/modules/gui/macosx/playlist.m index 8b79e77378..3fe224f9c3 100644 --- a/modules/gui/macosx/playlist.m +++ b/modules/gui/macosx/playlist.m @@ -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; -- 2.39.2