Commit 48aa40d4 authored by David Fuhrmann's avatar David Fuhrmann

macosx: remove remnants of old playlist update mechanism

parent 07e7944d
...@@ -120,8 +120,6 @@ static NSString * VLCInputChangedNotification = @"VLCInputChangedNotification"; ...@@ -120,8 +120,6 @@ static NSString * VLCInputChangedNotification = @"VLCInputChangedNotification";
BOOL b_has_spotify_paused; BOOL b_has_spotify_paused;
NSTimer *o_itunes_play_timer; NSTimer *o_itunes_play_timer;
BOOL b_playlist_updated_selector_in_queue;
dispatch_queue_t informInputChangedQueue; dispatch_queue_t informInputChangedQueue;
} }
...@@ -160,7 +158,6 @@ static NSString * VLCInputChangedNotification = @"VLCInputChangedNotification"; ...@@ -160,7 +158,6 @@ static NSString * VLCInputChangedNotification = @"VLCInputChangedNotification";
- (void)updateVolume; - (void)updateVolume;
- (void)updatePlaybackPosition; - (void)updatePlaybackPosition;
- (void)updateName; - (void)updateName;
- (void)playlistUpdated;
- (void)updateRecordState: (BOOL)b_value; - (void)updateRecordState: (BOOL)b_value;
- (void)updateInfoandMetaPanel; - (void)updateInfoandMetaPanel;
- (void)updateMainMenu; - (void)updateMainMenu;
......
...@@ -87,8 +87,6 @@ static int PLItemChanged(vlc_object_t *, const char *, ...@@ -87,8 +87,6 @@ static int PLItemChanged(vlc_object_t *, const char *,
vlc_value_t, vlc_value_t, void *); vlc_value_t, vlc_value_t, void *);
static int PLItemUpdated(vlc_object_t *, const char *, static int PLItemUpdated(vlc_object_t *, const char *,
vlc_value_t, vlc_value_t, void *); 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 *, static int PlaybackModeUpdated(vlc_object_t *, const char *,
vlc_value_t, vlc_value_t, void *); vlc_value_t, vlc_value_t, void *);
...@@ -363,7 +361,8 @@ static int InputEvent(vlc_object_t *p_this, const char *psz_var, ...@@ -363,7 +361,8 @@ static int InputEvent(vlc_object_t *p_this, const char *psz_var,
case INPUT_EVENT_ITEM_NAME: case INPUT_EVENT_ITEM_NAME:
[[VLCMain sharedInstance] performSelectorOnMainThread:@selector(updateName) withObject: nil waitUntilDone:NO]; [[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; break;
case INPUT_EVENT_AUDIO_DELAY: case INPUT_EVENT_AUDIO_DELAY:
...@@ -434,26 +433,6 @@ static int PLItemRemoved(vlc_object_t *p_this, const char *psz_var, ...@@ -434,26 +433,6 @@ static int PLItemRemoved(vlc_object_t *p_this, const char *psz_var,
return VLC_SUCCESS; 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, static int PlaybackModeUpdated(vlc_object_t *p_this, const char *psz_var,
vlc_value_t oldval, vlc_value_t new_val, void *param) vlc_value_t oldval, vlc_value_t new_val, void *param)
{ {
...@@ -628,7 +607,6 @@ audio_output_t *getAout(void) ...@@ -628,7 +607,6 @@ audio_output_t *getAout(void)
@synthesize voutController=o_vout_controller; @synthesize voutController=o_vout_controller;
@synthesize nativeFullscreenMode=b_nativeFullscreenMode; @synthesize nativeFullscreenMode=b_nativeFullscreenMode;
@synthesize playlistUpdatedSelectorInQueue=b_playlist_updated_selector_in_queue;
#pragma mark - #pragma mark -
#pragma mark Initialization #pragma mark Initialization
...@@ -702,7 +680,6 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -702,7 +680,6 @@ static VLCMain *_o_sharedMainInstance = nil;
var_AddCallback(p_intf->p_libvlc, "intf-boss", BossCallback, self); var_AddCallback(p_intf->p_libvlc, "intf-boss", BossCallback, self);
var_AddCallback(p_playlist, "item-change", PLItemUpdated, self); var_AddCallback(p_playlist, "item-change", PLItemUpdated, self);
var_AddCallback(p_playlist, "activity", PLItemChanged, 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-append", PLItemAppended, self);
var_AddCallback(p_playlist, "playlist-item-deleted", PLItemRemoved, self); var_AddCallback(p_playlist, "playlist-item-deleted", PLItemRemoved, self);
var_AddCallback(p_playlist, "random", PlaybackModeUpdated, self); var_AddCallback(p_playlist, "random", PlaybackModeUpdated, self);
...@@ -876,7 +853,6 @@ static bool f_appExit = false; ...@@ -876,7 +853,6 @@ static bool f_appExit = false;
var_DelCallback(p_intf, "dialog-progress-bar", DialogCallback, self); var_DelCallback(p_intf, "dialog-progress-bar", DialogCallback, self);
var_DelCallback(p_playlist, "item-change", PLItemUpdated, self); var_DelCallback(p_playlist, "item-change", PLItemUpdated, self);
var_DelCallback(p_playlist, "activity", PLItemChanged, 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-append", PLItemAppended, self);
var_DelCallback(p_playlist, "playlist-item-deleted", PLItemRemoved, self); var_DelCallback(p_playlist, "playlist-item-deleted", PLItemRemoved, self);
var_DelCallback(p_playlist, "random", PlaybackModeUpdated, self); var_DelCallback(p_playlist, "random", PlaybackModeUpdated, self);
...@@ -1317,6 +1293,10 @@ static bool f_appExit = false; ...@@ -1317,6 +1293,10 @@ static bool f_appExit = false;
int i_item = [[o_val objectAtIndex:1] intValue]; int i_item = [[o_val objectAtIndex:1] intValue];
[[[self playlist] model] addItem:i_item withParentNode:i_node]; [[[self playlist] model] addItem:i_item withParentNode:i_node];
[[NSNotificationCenter defaultCenter] postNotificationName: @"VLCMediaKeySupportSettingChanged"
object: nil
userInfo: nil];
} }
- (void)plItemRemoved:(NSNumber *)o_val - (void)plItemRemoved:(NSNumber *)o_val
...@@ -1325,6 +1305,10 @@ static bool f_appExit = false; ...@@ -1325,6 +1305,10 @@ static bool f_appExit = false;
[[[self playlist] model] removeItem:i_item]; [[[self playlist] model] removeItem:i_item];
[[self playlist] deletionCompleted]; [[self playlist] deletionCompleted];
[[NSNotificationCenter defaultCenter] postNotificationName: @"VLCMediaKeySupportSettingChanged"
object: nil
userInfo: nil];
} }
...@@ -1435,22 +1419,6 @@ static bool f_appExit = false; ...@@ -1435,22 +1419,6 @@ static bool f_appExit = false;
[o_mainwindow updateVolumeSlider]; [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 - (void)updateRecordState: (BOOL)b_value
{ {
[o_mainmenu updateRecordState:b_value]; [o_mainmenu updateRecordState:b_value];
......
...@@ -300,21 +300,7 @@ ...@@ -300,21 +300,7 @@
- (void)playlistUpdated - (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]; [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 - (void)outlineViewSelectionDidChange:(NSNotification *)notification
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment