diff --git a/modules/gui/macosx/VLCMainMenu.m b/modules/gui/macosx/VLCMainMenu.m index c3984d48022e05f3aa7660c7bc749274f0797a36..2a73ec5faf3ed5067621e2e615d23a7949df4c19 100644 --- a/modules/gui/macosx/VLCMainMenu.m +++ b/modules/gui/macosx/VLCMainMenu.m @@ -63,6 +63,7 @@ VLCHelpWindowController *_helpWindowController; VLCAddonsWindowController *_addonsController; VLCRendererMenuController *_rendererMenuController; + VLCPlaylistController *_playlistController; NSTimer *_cancelRendererDiscoveryTimer; NSMenu *_playlistTableColumnsContextMenu; @@ -86,6 +87,7 @@ - (void)awakeFromNib { _timeSelectionPanel = [[VLCTimeSelectionPanelController alloc] init]; + _playlistController = [[VLCMain sharedInstance] playlistController]; /* check whether the user runs OSX with a RTL language */ NSArray* languages = [NSLocale preferredLanguages]; @@ -1604,19 +1606,19 @@ input_thread_t *p_input = playlist_CurrentInput(p_playlist); if (mi == _stop || mi == _voutMenustop || mi == _dockMenustop) { - if (!p_input) - enabled = NO; + // FIXME: disable the stop item as soon as we can detect if there is an input or not*/ +/* if (!p_input) + enabled = NO;*/ [self setupMenus]; /* Make sure input menu is up to date */ } else if (mi == _previous || mi == _voutMenuprev || - mi == _dockMenuprevious || + mi == _dockMenuprevious) { + enabled = _playlistController.hasPreviousPlaylistItem; + } else if ( mi == _next || mi == _voutMenunext || - mi == _dockMenunext - ) { - PL_LOCK; - enabled = playlist_CurrentSize(p_playlist) > 1; - PL_UNLOCK; + mi == _dockMenunext) { + enabled = _playlistController.hasNextPlaylistItem; } else if (mi == _record) { enabled = NO; if (p_input) diff --git a/modules/gui/macosx/VLCPlaylistController.m b/modules/gui/macosx/VLCPlaylistController.m index f43b95788d0972bfb745c600dbc3b7b222f415af..e72d6d54ec66ab907aa33ca23fa32ef3d80cfa0c 100644 --- a/modules/gui/macosx/VLCPlaylistController.m +++ b/modules/gui/macosx/VLCPlaylistController.m @@ -366,10 +366,8 @@ static const struct vlc_playlist_callbacks playlist_callbacks = { - (int)startPlaylist { - vlc_playlist_Lock(_p_playlist); - int ret = vlc_playlist_Start(_p_playlist); - vlc_playlist_Unlock(_p_playlist); - return ret; + NSInteger selectedIndex = [_playlistDataSource.tableView selectedRow]; + return [self playItemAtIndex:selectedIndex]; } - (int)playPreviousItem