vlc | branch: master | David Fuhrmann <[email protected]> | Sat Mar 7 12:37:31 2015 +0100| [48aa40d47ff742abc8b85741991aa92cbbf1b5f1] | committer: David Fuhrmann
macosx: remove remnants of old playlist update mechanism > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=48aa40d47ff742abc8b85741991aa92cbbf1b5f1 --- modules/gui/macosx/intf.h | 3 --- modules/gui/macosx/intf.m | 52 ++++++++--------------------------------- modules/gui/macosx/playlist.m | 14 ----------- 3 files changed, 10 insertions(+), 59 deletions(-) diff --git a/modules/gui/macosx/intf.h b/modules/gui/macosx/intf.h index db5bacc..4109e62 100644 --- a/modules/gui/macosx/intf.h +++ b/modules/gui/macosx/intf.h @@ -120,8 +120,6 @@ static NSString * VLCInputChangedNotification = @"VLCInputChangedNotification"; BOOL b_has_spotify_paused; NSTimer *o_itunes_play_timer; - BOOL b_playlist_updated_selector_in_queue; - dispatch_queue_t informInputChangedQueue; } @@ -160,7 +158,6 @@ static NSString * VLCInputChangedNotification = @"VLCInputChangedNotification"; - (void)updateVolume; - (void)updatePlaybackPosition; - (void)updateName; -- (void)playlistUpdated; - (void)updateRecordState: (BOOL)b_value; - (void)updateInfoandMetaPanel; - (void)updateMainMenu; diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m index d75d5d7..57eb845 100644 --- a/modules/gui/macosx/intf.m +++ b/modules/gui/macosx/intf.m @@ -87,8 +87,6 @@ static int PLItemChanged(vlc_object_t *, const char *, vlc_value_t, vlc_value_t, void *); static int PLItemUpdated(vlc_object_t *, const char *, vlc_value_t, vlc_value_t, void *); -static int PlaylistUpdated(vlc_object_t *, const char *, - vlc_value_t, vlc_value_t, void *); static int PlaybackModeUpdated(vlc_object_t *, const char *, vlc_value_t, vlc_value_t, void *); @@ -363,7 +361,8 @@ static int InputEvent(vlc_object_t *p_this, const char *psz_var, case INPUT_EVENT_ITEM_NAME: [[VLCMain sharedInstance] performSelectorOnMainThread:@selector(updateName) withObject: nil waitUntilDone:NO]; - [[VLCMain sharedInstance] performSelectorOnMainThread:@selector(playlistUpdated) withObject: nil waitUntilDone:NO]; + // TODO update playlist item with new name +// [[VLCMain sharedInstance] performSelectorOnMainThread:@selector(playlistUpdated) withObject: nil waitUntilDone:NO]; break; case INPUT_EVENT_AUDIO_DELAY: @@ -434,26 +433,6 @@ static int PLItemRemoved(vlc_object_t *p_this, const char *psz_var, return VLC_SUCCESS; } -static int PlaylistUpdated(vlc_object_t *p_this, const char *psz_var, - vlc_value_t oldval, vlc_value_t new_val, void *param) -{ - NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init]; - - /* Avoid event queue flooding with playlistUpdated selectors, leading to UI freezes. - * Therefore, only enqueue if no selector already enqueued. - */ - VLCMain *o_main = [VLCMain sharedInstance]; - @synchronized(o_main) { - if(![o_main playlistUpdatedSelectorInQueue]) { - [o_main setPlaylistUpdatedSelectorInQueue:YES]; - [o_main performSelectorOnMainThread:@selector(playlistUpdated) withObject:nil waitUntilDone:NO]; - } - } - - [o_pool release]; - return VLC_SUCCESS; -} - static int PlaybackModeUpdated(vlc_object_t *p_this, const char *psz_var, vlc_value_t oldval, vlc_value_t new_val, void *param) { @@ -628,7 +607,6 @@ audio_output_t *getAout(void) @synthesize voutController=o_vout_controller; @synthesize nativeFullscreenMode=b_nativeFullscreenMode; -@synthesize playlistUpdatedSelectorInQueue=b_playlist_updated_selector_in_queue; #pragma mark - #pragma mark Initialization @@ -702,7 +680,6 @@ static VLCMain *_o_sharedMainInstance = nil; var_AddCallback(p_intf->p_libvlc, "intf-boss", BossCallback, self); var_AddCallback(p_playlist, "item-change", PLItemUpdated, self); var_AddCallback(p_playlist, "activity", PLItemChanged, self); - var_AddCallback(p_playlist, "leaf-to-parent", PlaylistUpdated, self); var_AddCallback(p_playlist, "playlist-item-append", PLItemAppended, self); var_AddCallback(p_playlist, "playlist-item-deleted", PLItemRemoved, self); var_AddCallback(p_playlist, "random", PlaybackModeUpdated, self); @@ -876,7 +853,6 @@ static bool f_appExit = false; var_DelCallback(p_intf, "dialog-progress-bar", DialogCallback, self); var_DelCallback(p_playlist, "item-change", PLItemUpdated, self); var_DelCallback(p_playlist, "activity", PLItemChanged, self); - var_DelCallback(p_playlist, "leaf-to-parent", PlaylistUpdated, self); var_DelCallback(p_playlist, "playlist-item-append", PLItemAppended, self); var_DelCallback(p_playlist, "playlist-item-deleted", PLItemRemoved, self); var_DelCallback(p_playlist, "random", PlaybackModeUpdated, self); @@ -1317,6 +1293,10 @@ static bool f_appExit = false; int i_item = [[o_val objectAtIndex:1] intValue]; [[[self playlist] model] addItem:i_item withParentNode:i_node]; + + [[NSNotificationCenter defaultCenter] postNotificationName: @"VLCMediaKeySupportSettingChanged" + object: nil + userInfo: nil]; } - (void)plItemRemoved:(NSNumber *)o_val @@ -1325,6 +1305,10 @@ static bool f_appExit = false; [[[self playlist] model] removeItem:i_item]; [[self playlist] deletionCompleted]; + + [[NSNotificationCenter defaultCenter] postNotificationName: @"VLCMediaKeySupportSettingChanged" + object: nil + userInfo: nil]; } @@ -1435,22 +1419,6 @@ static bool f_appExit = false; [o_mainwindow updateVolumeSlider]; } -- (void)playlistUpdated -{ - @synchronized(self) { - b_playlist_updated_selector_in_queue = NO; - } - - [self playbackStatusUpdated]; - [o_playlist playlistUpdated]; - [o_mainwindow updateWindow]; - [o_mainwindow updateName]; - - [[NSNotificationCenter defaultCenter] postNotificationName: @"VLCMediaKeySupportSettingChanged" - object: nil - userInfo: nil]; -} - - (void)updateRecordState: (BOOL)b_value { [o_mainmenu updateRecordState:b_value]; diff --git a/modules/gui/macosx/playlist.m b/modules/gui/macosx/playlist.m index b1f30b5..ddd1d68 100644 --- a/modules/gui/macosx/playlist.m +++ b/modules/gui/macosx/playlist.m @@ -300,21 +300,7 @@ - (void)playlistUpdated { - /* Clear indications of any existing column sorting */ - NSUInteger count = [[o_outline_view tableColumns] count]; - for (NSUInteger i = 0 ; i < count ; i++) - [o_outline_view setIndicatorImage:nil inTableColumn: [[o_outline_view tableColumns] objectAtIndex:i]]; - - [o_outline_view setHighlightedTableColumn:nil]; - o_tc_sortColumn = nil; - [o_outline_view reloadData]; - [[[[VLCMain sharedInstance] wizard] playlistWizard] reloadOutlineView]; - - [o_outline_view selectRowIndexes:[NSIndexSet indexSetWithIndex:retainedRowSelection] byExtendingSelection:NO]; - - [self outlineViewSelectionDidChange: nil]; - [[VLCMain sharedInstance] updateMainWindow]; } - (void)outlineViewSelectionDidChange:(NSNotification *)notification _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
