diff --git a/modules/gui/macosx/coreinteraction/VLCHotkeysController.m b/modules/gui/macosx/coreinteraction/VLCHotkeysController.m index 5a657370de..b36f237647 100644 --- a/modules/gui/macosx/coreinteraction/VLCHotkeysController.m +++ b/modules/gui/macosx/coreinteraction/VLCHotkeysController.m @@ -79,7 +79,7 @@ - (BOOL)handleVideoOutputKeyDown:(id)anEvent forVideoOutput:(vout_thread_t *)p_vout { - VLCPlayerController *playerController = [[[VLCMain sharedInstance] playlistController] playerController]; + VLCPlayerController * const playerController = VLCMain.sharedInstance.playlistController.playerController; unichar key = 0; vlc_value_t val; NSEventModifierFlags i_pressed_modifiers = 0; @@ -173,8 +173,8 @@ unichar key = [characters characterAtIndex: 0]; if (key) { - VLCPlayerController *playerController = [[[VLCMain sharedInstance] playlistController] playerController]; - vout_thread_t *p_vout = [playerController mainVideoOutputThread]; + VLCPlayerController * const playerController = VLCMain.sharedInstance.playlistController.playerController; + vout_thread_t * const p_vout = playerController.mainVideoOutputThread; if (p_vout != NULL) { /* Escape */ if (key == (unichar) 0x1b) { @@ -221,7 +221,7 @@ /* handle Lion's default key combo for fullscreen-toggle in addition to our own hotkeys */ if (key == 'f' && i_pressed_modifiers & NSControlKeyMask && i_pressed_modifiers & NSCommandKeyMask) { - [[[[VLCMain sharedInstance] playlistController] playerController] toggleFullscreen]; + [VLCMain.sharedInstance.playlistController.playerController toggleFullscreen]; return YES; } diff --git a/modules/gui/macosx/coreinteraction/VLCVideoFilterHelper.m b/modules/gui/macosx/coreinteraction/VLCVideoFilterHelper.m index b1dea0c0e2..f32394f186 100644 --- a/modules/gui/macosx/coreinteraction/VLCVideoFilterHelper.m +++ b/modules/gui/macosx/coreinteraction/VLCVideoFilterHelper.m @@ -66,7 +66,7 @@ return; } - VLCPlayerController *playerController = [[[VLCMain sharedInstance] playlistController] playerController]; + VLCPlayerController *playerController = [[VLCMain.sharedInstance playlistController] playerController]; vout_thread_t *vout = [playerController mainVideoOutputThread]; if (!vout) return; @@ -128,7 +128,7 @@ return; } - VLCPlayerController *playerController = [[[VLCMain sharedInstance] playlistController] playerController]; + VLCPlayerController *playerController = [[VLCMain.sharedInstance playlistController] playerController]; vout_thread_t *vout = [playerController mainVideoOutputThread]; if (!vout) return; diff --git a/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m b/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m index fbb85a0b11..eff3e03f28 100644 --- a/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m +++ b/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m @@ -187,7 +187,7 @@ const CGFloat VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95; - (void)setRepresentedItem:(id)representedItem { if (!_libraryController) { - _libraryController = [[VLCMain sharedInstance] libraryController]; + _libraryController = [VLCMain.sharedInstance libraryController]; } _representedItem = representedItem; @@ -280,7 +280,7 @@ const CGFloat VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95; - (IBAction)playInstantly:(id)sender { if (!_libraryController) { - _libraryController = [[VLCMain sharedInstance] libraryController]; + _libraryController = [VLCMain.sharedInstance libraryController]; } // We want to add all the tracks to the playlist but only play the first one immediately, @@ -298,7 +298,7 @@ const CGFloat VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95; - (IBAction)addToPlaylist:(id)sender { if (!_libraryController) { - _libraryController = [[VLCMain sharedInstance] libraryController]; + _libraryController = [VLCMain.sharedInstance libraryController]; } [_representedItem iterateMediaItemsWithBlock:^(VLCMediaLibraryMediaItem* mediaItem) { diff --git a/modules/gui/macosx/library/VLCLibraryCollectionViewMediaItemSupplementaryDetailView.m b/modules/gui/macosx/library/VLCLibraryCollectionViewMediaItemSupplementaryDetailView.m index f923e1d793..8373e1cca8 100644 --- a/modules/gui/macosx/library/VLCLibraryCollectionViewMediaItemSupplementaryDetailView.m +++ b/modules/gui/macosx/library/VLCLibraryCollectionViewMediaItemSupplementaryDetailView.m @@ -106,7 +106,7 @@ NSCollectionViewSupplementaryElementKind const VLCLibraryCollectionViewMediaItem - (IBAction)playAction:(id)sender { if (!_libraryController) { - _libraryController = [[VLCMain sharedInstance] libraryController]; + _libraryController = [VLCMain.sharedInstance libraryController]; } [_libraryController appendItemToPlaylist:_representedMediaItem playImmediately:YES]; @@ -115,7 +115,7 @@ NSCollectionViewSupplementaryElementKind const VLCLibraryCollectionViewMediaItem - (IBAction)enqueueAction:(id)sender { if (!_libraryController) { - _libraryController = [[VLCMain sharedInstance] libraryController]; + _libraryController = [VLCMain.sharedInstance libraryController]; } [_libraryController appendItemToPlaylist:_representedMediaItem playImmediately:NO]; diff --git a/modules/gui/macosx/library/VLCLibraryController.m b/modules/gui/macosx/library/VLCLibraryController.m index 686882b8d0..1b9cc90086 100644 --- a/modules/gui/macosx/library/VLCLibraryController.m +++ b/modules/gui/macosx/library/VLCLibraryController.m @@ -92,7 +92,7 @@ msg_Err(getIntf(), "No input item found for media id %lli", mediaItem.libraryID); return VLC_ENOENT; } - int ret = [[[VLCMain sharedInstance] playlistController] addInputItem:p_inputItem atPosition:-1 startPlayback:playImmediately]; + int ret = [[VLCMain.sharedInstance playlistController] addInputItem:p_inputItem atPosition:-1 startPlayback:playImmediately]; input_item_Release(p_inputItem); return ret; } diff --git a/modules/gui/macosx/library/VLCLibraryMenuController.m b/modules/gui/macosx/library/VLCLibraryMenuController.m index d4a86ee992..f3192ce2a7 100644 --- a/modules/gui/macosx/library/VLCLibraryMenuController.m +++ b/modules/gui/macosx/library/VLCLibraryMenuController.m @@ -185,7 +185,7 @@ NSModalResponse modalResponse = [openPanel runModal]; if (modalResponse == NSModalResponseOK) { - VLCLibraryController *libraryController = [[VLCMain sharedInstance] libraryController]; + VLCLibraryController *libraryController = [VLCMain.sharedInstance libraryController]; for (NSURL *url in [openPanel URLs]) { [libraryController addFolderWithFileURL:url]; } diff --git a/modules/gui/macosx/library/VLCLibrarySortingMenuController.m b/modules/gui/macosx/library/VLCLibrarySortingMenuController.m index a14798e397..160dec570b 100644 --- a/modules/gui/macosx/library/VLCLibrarySortingMenuController.m +++ b/modules/gui/macosx/library/VLCLibrarySortingMenuController.m @@ -42,7 +42,7 @@ self = [super init]; if (self) { [self createMenu]; - _libraryController = [[VLCMain sharedInstance] libraryController]; + _libraryController = [VLCMain.sharedInstance libraryController]; } return self; } diff --git a/modules/gui/macosx/library/VLCLibraryTableCellView.m b/modules/gui/macosx/library/VLCLibraryTableCellView.m index 0a58be08dc..7f8a48d50f 100644 --- a/modules/gui/macosx/library/VLCLibraryTableCellView.m +++ b/modules/gui/macosx/library/VLCLibraryTableCellView.m @@ -142,7 +142,7 @@ - (void)playInputItemInstantly:(id)sender { - [[[VLCMain sharedInstance] playlistController] addInputItem:_representedInputItem.vlcInputItem atPosition:-1 startPlayback:YES]; + [[VLCMain.sharedInstance playlistController] addInputItem:_representedInputItem.vlcInputItem atPosition:-1 startPlayback:YES]; } @end diff --git a/modules/gui/macosx/library/VLCLibraryWindow.m b/modules/gui/macosx/library/VLCLibraryWindow.m index acb817be8f..b5aa3c94f7 100644 --- a/modules/gui/macosx/library/VLCLibraryWindow.m +++ b/modules/gui/macosx/library/VLCLibraryWindow.m @@ -144,7 +144,7 @@ static void addShadow(NSImageView *__unsafe_unretained imageView) self.toolbar.allowsUserCustomization = NO; - VLCMain *mainInstance = [VLCMain sharedInstance]; + VLCMain *mainInstance = VLCMain.sharedInstance; _playlistController = [mainInstance playlistController]; libvlc_int_t *libvlc = vlc_object_instance(getIntf()); @@ -620,7 +620,7 @@ static void addShadow(NSImageView *__unsafe_unretained imageView) if (selectedRow == -1) return; - [[[VLCMain sharedInstance] playlistController] playItemAtIndex:selectedRow]; + [[VLCMain.sharedInstance playlistController] playItemAtIndex:selectedRow]; } - (IBAction)clearPlaylist:(id)sender @@ -646,7 +646,7 @@ static void addShadow(NSImageView *__unsafe_unretained imageView) - (IBAction)filterLibrary:(id)sender { - [[[VLCMain sharedInstance] libraryController] filterByString:_librarySearchField.stringValue]; + [[VLCMain.sharedInstance libraryController] filterByString:_librarySearchField.stringValue]; } - (void)clearLibraryFilterString @@ -657,7 +657,7 @@ static void addShadow(NSImageView *__unsafe_unretained imageView) - (IBAction)openMedia:(id)sender { - [[[VLCMain sharedInstance] open] openFileGeneric]; + [[VLCMain.sharedInstance open] openFileGeneric]; } - (BOOL)handlePasteBoardFromDragSession:(NSPasteboard *)paste @@ -899,7 +899,7 @@ static void addShadow(NSImageView *__unsafe_unretained imageView) - (void)disableVideoPlaybackAppearance { [self makeFirstResponder: _playlistTableView]; - [[[VLCMain sharedInstance] voutProvider] updateWindowLevelForHelperWindows: NSNormalWindowLevel]; + [[VLCMain.sharedInstance voutProvider] updateWindowLevelForHelperWindows: NSNormalWindowLevel]; // restore alpha value to 1 for the case that macosx-opaqueness is set to < 1 [self setAlphaValue:1.0]; diff --git a/modules/gui/macosx/library/VLCLibraryWindowController.m b/modules/gui/macosx/library/VLCLibraryWindowController.m index d5d0ef2fdb..1b4802fadd 100644 --- a/modules/gui/macosx/library/VLCLibraryWindowController.m +++ b/modules/gui/macosx/library/VLCLibraryWindowController.m @@ -61,11 +61,11 @@ return; } - if([VLCMain sharedInstance].libraryWindowController == nil) { - [VLCMain sharedInstance].libraryWindowController = [[VLCLibraryWindowController alloc] initWithLibraryWindow]; + if(VLCMain.sharedInstance.libraryWindowController == nil) { + VLCMain.sharedInstance.libraryWindowController = [[VLCLibraryWindowController alloc] initWithLibraryWindow]; } - VLCLibraryWindow *libraryWindow = [VLCMain sharedInstance].libraryWindow; + VLCLibraryWindow *libraryWindow = VLCMain.sharedInstance.libraryWindow; NSInteger rememberedSelectedLibrarySegment = [state decodeIntegerForKey:@"macosx-library-selected-segment"]; NSInteger rememberedSelectedLibraryViewAudioSegment = [state decodeIntegerForKey:@"macosx-library-audio-view-selected-segment"]; diff --git a/modules/gui/macosx/library/audio-library/VLCLibraryAlbumTableCellView.m b/modules/gui/macosx/library/audio-library/VLCLibraryAlbumTableCellView.m index 0acf438f7b..7f8f0dbb82 100644 --- a/modules/gui/macosx/library/audio-library/VLCLibraryAlbumTableCellView.m +++ b/modules/gui/macosx/library/audio-library/VLCLibraryAlbumTableCellView.m @@ -229,7 +229,7 @@ const CGFloat VLCLibraryAlbumTableCellViewDefaultHeight = 168.; - (IBAction)playInstantly:(id)sender { if (!_libraryController) { - _libraryController = [[VLCMain sharedInstance] libraryController]; + _libraryController = [VLCMain.sharedInstance libraryController]; } BOOL playImmediately = YES; @@ -284,7 +284,7 @@ const CGFloat VLCLibraryAlbumTableCellViewDefaultHeight = 168.; - (void)tracksTableViewDoubleClickAction:(id)sender { if (!_libraryController) { - _libraryController = [[VLCMain sharedInstance] libraryController]; + _libraryController = [VLCMain.sharedInstance libraryController]; } NSArray *tracks = [_representedAlbum tracksAsMediaItems]; diff --git a/modules/gui/macosx/library/audio-library/VLCLibraryAudioDataSource.m b/modules/gui/macosx/library/audio-library/VLCLibraryAudioDataSource.m index 99a6f6214e..4ef07a8675 100644 --- a/modules/gui/macosx/library/audio-library/VLCLibraryAudioDataSource.m +++ b/modules/gui/macosx/library/audio-library/VLCLibraryAudioDataSource.m @@ -816,7 +816,7 @@ NSString * const VLCLibraryYearSortDescriptorKey = @"VLCLibraryYearSortDescripto } NSArray *tracks = [listOfAlbums[clickedRow] tracksAsMediaItems]; - [[[VLCMain sharedInstance] libraryController] appendItemsToPlaylist:tracks playFirstItemImmediately:YES]; + [[VLCMain.sharedInstance libraryController] appendItemsToPlaylist:tracks playFirstItemImmediately:YES]; } - (void)collectionSelectionDoubleClickAction:(id)sender @@ -824,7 +824,7 @@ NSString * const VLCLibraryYearSortDescriptorKey = @"VLCLibraryYearSortDescripto id libraryItem = self.displayedCollection[self.collectionSelectionTableView.selectedRow]; [libraryItem iterateMediaItemsWithBlock:^(VLCMediaLibraryMediaItem* mediaItem) { - [[[VLCMain sharedInstance] libraryController] appendItemToPlaylist:mediaItem playImmediately:YES]; + [[VLCMain.sharedInstance libraryController] appendItemToPlaylist:mediaItem playImmediately:YES]; }]; } @@ -867,7 +867,7 @@ viewForSupplementaryElementOfKind:(NSCollectionViewSupplementaryElementKind)kind VLCMediaLibraryAlbum * const album = self.displayedCollection[indexPath.item]; albumSupplementaryDetailView.representedAlbum = album; albumSupplementaryDetailView.selectedItem = [collectionView itemAtIndex:indexPath.item]; - albumSupplementaryDetailView.parentScrollView = [VLCMain sharedInstance].libraryWindow.audioCollectionViewScrollView; + albumSupplementaryDetailView.parentScrollView = VLCMain.sharedInstance.libraryWindow.audioCollectionViewScrollView; albumSupplementaryDetailView.internalScrollView.scrollParentY = YES; return albumSupplementaryDetailView; @@ -879,7 +879,7 @@ viewForSupplementaryElementOfKind:(NSCollectionViewSupplementaryElementKind)kind id audioGroup = self.displayedCollection[indexPath.item]; audioGroupSupplementaryDetailView.representedAudioGroup = audioGroup; audioGroupSupplementaryDetailView.selectedItem = [collectionView itemAtIndex:indexPath.item]; - audioGroupSupplementaryDetailView.parentScrollView = [VLCMain sharedInstance].libraryWindow.audioCollectionViewScrollView; + audioGroupSupplementaryDetailView.parentScrollView = VLCMain.sharedInstance.libraryWindow.audioCollectionViewScrollView; audioGroupSupplementaryDetailView.internalScrollView.scrollParentY = YES; return audioGroupSupplementaryDetailView; diff --git a/modules/gui/macosx/library/audio-library/VLCLibraryAudioGroupDataSource.m b/modules/gui/macosx/library/audio-library/VLCLibraryAudioGroupDataSource.m index 957598e84d..d2c43fccd2 100644 --- a/modules/gui/macosx/library/audio-library/VLCLibraryAudioGroupDataSource.m +++ b/modules/gui/macosx/library/audio-library/VLCLibraryAudioGroupDataSource.m @@ -83,7 +83,7 @@ viewForSupplementaryElementOfKind:(NSCollectionViewSupplementaryElementKind)kind VLCMediaLibraryAlbum * const album = self.representedListOfAlbums[indexPath.item]; albumSupplementaryDetailView.representedAlbum = album; albumSupplementaryDetailView.selectedItem = [collectionView itemAtIndex:indexPath.item]; - albumSupplementaryDetailView.parentScrollView = [VLCMain sharedInstance].libraryWindow.audioCollectionViewScrollView; + albumSupplementaryDetailView.parentScrollView = VLCMain.sharedInstance.libraryWindow.audioCollectionViewScrollView; albumSupplementaryDetailView.internalScrollView.scrollParentY = YES; return albumSupplementaryDetailView; diff --git a/modules/gui/macosx/library/audio-library/VLCLibraryAudioViewController.m b/modules/gui/macosx/library/audio-library/VLCLibraryAudioViewController.m index f2443b9882..0f5f8fa0d0 100644 --- a/modules/gui/macosx/library/audio-library/VLCLibraryAudioViewController.m +++ b/modules/gui/macosx/library/audio-library/VLCLibraryAudioViewController.m @@ -131,7 +131,7 @@ NSString *VLCLibraryPlaceholderAudioViewIdentifier = @"VLCLibraryPlaceholderAudi - (void)setupAudioDataSource { _audioDataSource = [[VLCLibraryAudioDataSource alloc] init]; - _audioDataSource.libraryModel = [VLCMain sharedInstance].libraryController.libraryModel; + _audioDataSource.libraryModel = VLCMain.sharedInstance.libraryController.libraryModel; _audioDataSource.collectionSelectionTableView = _audioCollectionSelectionTableView; _audioDataSource.groupSelectionTableView = _audioGroupSelectionTableView; _audioDataSource.songsTableView = _audioSongTableView; diff --git a/modules/gui/macosx/library/audio-library/VLCLibraryCollectionViewAlbumSupplementaryDetailView.m b/modules/gui/macosx/library/audio-library/VLCLibraryCollectionViewAlbumSupplementaryDetailView.m index 5795988f06..a4e1e8da4b 100644 --- a/modules/gui/macosx/library/audio-library/VLCLibraryCollectionViewAlbumSupplementaryDetailView.m +++ b/modules/gui/macosx/library/audio-library/VLCLibraryCollectionViewAlbumSupplementaryDetailView.m @@ -136,7 +136,7 @@ NSCollectionViewSupplementaryElementKind const VLCLibraryCollectionViewAlbumSupp - (IBAction)playAction:(id)sender { if (!_libraryController) { - _libraryController = [[VLCMain sharedInstance] libraryController]; + _libraryController = [VLCMain.sharedInstance libraryController]; } // We want to add all the tracks to the playlist but only play the first one immediately, @@ -154,7 +154,7 @@ NSCollectionViewSupplementaryElementKind const VLCLibraryCollectionViewAlbumSupp - (IBAction)enqueueAction:(id)sender { if (!_libraryController) { - _libraryController = [[VLCMain sharedInstance] libraryController]; + _libraryController = [VLCMain.sharedInstance libraryController]; } [_representedAlbum iterateMediaItemsWithBlock:^(VLCMediaLibraryMediaItem* mediaItem) { diff --git a/modules/gui/macosx/library/audio-library/VLCLibrarySongTableCellView.m b/modules/gui/macosx/library/audio-library/VLCLibrarySongTableCellView.m index 9cb955eaf6..5c1ce23321 100644 --- a/modules/gui/macosx/library/audio-library/VLCLibrarySongTableCellView.m +++ b/modules/gui/macosx/library/audio-library/VLCLibrarySongTableCellView.m @@ -83,7 +83,7 @@ NSString *VLCAudioLibrarySongCellIdentifier = @"VLCAudioLibrarySongCellIdentifie } if (!_libraryController) { - _libraryController = [[VLCMain sharedInstance] libraryController]; + _libraryController = [VLCMain.sharedInstance libraryController]; } BOOL playImmediately = YES; diff --git a/modules/gui/macosx/library/media-source/VLCMediaSourceBaseDataSource.m b/modules/gui/macosx/library/media-source/VLCMediaSourceBaseDataSource.m index 25ab3f1b5a..fd78317493 100644 --- a/modules/gui/macosx/library/media-source/VLCMediaSourceBaseDataSource.m +++ b/modules/gui/macosx/library/media-source/VLCMediaSourceBaseDataSource.m @@ -493,7 +493,7 @@ referenceSizeForHeaderInSection:(NSInteger)section - (void)homeButtonAction:(id)sender { [self returnHome]; - VLCLibraryNavigationStack * const mainNavStack = [VLCMain sharedInstance].libraryWindow.navigationStack; + VLCLibraryNavigationStack * const mainNavStack = VLCMain.sharedInstance.libraryWindow.navigationStack; [mainNavStack clear]; } diff --git a/modules/gui/macosx/library/media-source/VLCMediaSourceCollectionViewItem.m b/modules/gui/macosx/library/media-source/VLCMediaSourceCollectionViewItem.m index 511a8dd86a..4ff7ce6fcb 100644 --- a/modules/gui/macosx/library/media-source/VLCMediaSourceCollectionViewItem.m +++ b/modules/gui/macosx/library/media-source/VLCMediaSourceCollectionViewItem.m @@ -156,12 +156,12 @@ NSString *VLCMediaSourceCellIdentifier = @"VLCLibraryCellIdentifier"; - (IBAction)playInstantly:(id)sender { - [[[VLCMain sharedInstance] playlistController] addInputItem:_representedInputItem.vlcInputItem atPosition:-1 startPlayback:YES]; + [[VLCMain.sharedInstance playlistController] addInputItem:_representedInputItem.vlcInputItem atPosition:-1 startPlayback:YES]; } - (IBAction)addToPlaylist:(id)sender { - [[[VLCMain sharedInstance] playlistController] addInputItem:_representedInputItem.vlcInputItem atPosition:-1 startPlayback:NO]; + [[VLCMain.sharedInstance playlistController] addInputItem:_representedInputItem.vlcInputItem atPosition:-1 startPlayback:NO]; } -(void)mouseDown:(NSEvent *)theEvent diff --git a/modules/gui/macosx/library/media-source/VLCMediaSourceDataSource.m b/modules/gui/macosx/library/media-source/VLCMediaSourceDataSource.m index e6fefae63b..f99c663be6 100644 --- a/modules/gui/macosx/library/media-source/VLCMediaSourceDataSource.m +++ b/modules/gui/macosx/library/media-source/VLCMediaSourceDataSource.m @@ -208,9 +208,9 @@ [self.displayedMediaSource preparseInputNodeWithinTree:node]; self.nodeToDisplay = node; - [[VLCMain sharedInstance].libraryWindow.navigationStack appendCurrentLibraryState]; + [VLCMain.sharedInstance.libraryWindow.navigationStack appendCurrentLibraryState]; } else if (childRootInput.inputType == ITEM_TYPE_FILE && allowPlayback) { - [[[VLCMain sharedInstance] playlistController] addInputItem:childRootInput.vlcInputItem atPosition:-1 startPlayback:YES]; + [[VLCMain.sharedInstance playlistController] addInputItem:childRootInput.vlcInputItem atPosition:-1 startPlayback:YES]; } } diff --git a/modules/gui/macosx/library/video-library/VLCLibraryVideoCollectionViewContainerViewDataSource.m b/modules/gui/macosx/library/video-library/VLCLibraryVideoCollectionViewContainerViewDataSource.m index d7ab4a1229..b0fcdd4519 100644 --- a/modules/gui/macosx/library/video-library/VLCLibraryVideoCollectionViewContainerViewDataSource.m +++ b/modules/gui/macosx/library/video-library/VLCLibraryVideoCollectionViewContainerViewDataSource.m @@ -77,7 +77,7 @@ name:VLCLibraryModelRecentsMediaItemDeleted object:nil]; - _libraryModel = [VLCMain sharedInstance].libraryController.libraryModel; + _libraryModel = VLCMain.sharedInstance.libraryController.libraryModel; self.collectionArray = [NSArray array]; } return self; diff --git a/modules/gui/macosx/main/VLCMain.h b/modules/gui/macosx/main/VLCMain.h index ac66dbff41..163587efe4 100644 --- a/modules/gui/macosx/main/VLCMain.h +++ b/modules/gui/macosx/main/VLCMain.h @@ -63,7 +63,7 @@ extern NSString *VLCConfigurationChangedNotification; @interface VLCMain : NSObject -+ (VLCMain *)sharedInstance; +@property (class, readonly) VLCMain *sharedInstance; + (void)relaunchApplication; @property (readonly) BOOL isTerminating; diff --git a/modules/gui/macosx/main/VLCMain.m b/modules/gui/macosx/main/VLCMain.m index 34f25a937a..68f730064b 100644 --- a/modules/gui/macosx/main/VLCMain.m +++ b/modules/gui/macosx/main/VLCMain.m @@ -146,7 +146,7 @@ int OpenIntf (vlc_object_t *p_this) @try { [VLCApplication sharedApplication]; - [VLCMain sharedInstance]; + VLCMain.sharedInstance; msg_Dbg(p_intf, "Finished loading macosx interface"); return VLC_SUCCESS; @@ -161,7 +161,7 @@ void CloseIntf (vlc_object_t *p_this) { @autoreleasepool { msg_Dbg(p_this, "Closing macosx interface"); - [[VLCMain sharedInstance] applicationWillTerminate:nil]; + [VLCMain.sharedInstance applicationWillTerminate:nil]; [VLCMain killInstance]; } diff --git a/modules/gui/macosx/menus/VLCMainMenu.m b/modules/gui/macosx/menus/VLCMainMenu.m index d7e7009fdb..fef4c9023d 100644 --- a/modules/gui/macosx/menus/VLCMainMenu.m +++ b/modules/gui/macosx/menus/VLCMainMenu.m @@ -127,7 +127,7 @@ typedef NS_ENUM(NSInteger, VLCObjectType) { - (void)awakeFromNib { - _playlistController = [[VLCMain sharedInstance] playlistController]; + _playlistController = [VLCMain.sharedInstance playlistController]; _playerController = _playlistController.playerController; /* check whether the user runs OSX with a RTL language */ @@ -235,7 +235,7 @@ typedef NS_ENUM(NSInteger, VLCObjectType) { /* setup extensions menu */ /* Let the ExtensionsManager itself build the menu */ - VLCExtensionsManager *extMgr = [[VLCMain sharedInstance] extensionsManager]; + VLCExtensionsManager *extMgr = [VLCMain.sharedInstance extensionsManager]; [extMgr buildMenu:_extensionsMenu]; [_extensions setEnabled:([_extensionsMenu numberOfItems] > 0)]; @@ -1332,29 +1332,29 @@ typedef NS_ENUM(NSInteger, VLCObjectType) { - (IBAction)intfOpenFile:(id)sender { - [[[VLCMain sharedInstance] open] openFileWithAction:^(NSArray *files) { + [[VLCMain.sharedInstance open] openFileWithAction:^(NSArray *files) { [self->_playlistController addPlaylistItems:files]; }]; } - (IBAction)intfOpenFileGeneric:(id)sender { - [[[VLCMain sharedInstance] open] openFileGeneric]; + [[VLCMain.sharedInstance open] openFileGeneric]; } - (IBAction)intfOpenDisc:(id)sender { - [[[VLCMain sharedInstance] open] openDisc]; + [[VLCMain.sharedInstance open] openDisc]; } - (IBAction)intfOpenNet:(id)sender { - [[[VLCMain sharedInstance] open] openNet]; + [[VLCMain.sharedInstance open] openNet]; } - (IBAction)intfOpenCapture:(id)sender { - [[[VLCMain sharedInstance] open] openCapture]; + [[VLCMain.sharedInstance open] openCapture]; } - (IBAction)savePlaylist:(id)sender @@ -1398,32 +1398,32 @@ typedef NS_ENUM(NSInteger, VLCObjectType) { - (IBAction)showConvertAndSave:(id)sender { - [[[VLCMain sharedInstance] convertAndSaveWindow] showWindow:self]; + [[VLCMain.sharedInstance convertAndSaveWindow] showWindow:self]; } - (IBAction)showVideoEffects:(id)sender { - [[[VLCMain sharedInstance] videoEffectsPanel] toggleWindow:sender]; + [[VLCMain.sharedInstance videoEffectsPanel] toggleWindow:sender]; } - (IBAction)showTrackSynchronization:(id)sender { - [[[VLCMain sharedInstance] trackSyncPanel] toggleWindow:sender]; + [[VLCMain.sharedInstance trackSyncPanel] toggleWindow:sender]; } - (IBAction)showAudioEffects:(id)sender { - [[[VLCMain sharedInstance] audioEffectsPanel] toggleWindow:sender]; + [[VLCMain.sharedInstance audioEffectsPanel] toggleWindow:sender]; } - (IBAction)showBookmarks:(id)sender { - [[[VLCMain sharedInstance] bookmarks] toggleWindow:sender]; + [[VLCMain.sharedInstance bookmarks] toggleWindow:sender]; } - (IBAction)showPreferences:(id)sender { - VLCMain *mainInstance = [VLCMain sharedInstance]; + VLCMain *mainInstance = VLCMain.sharedInstance; NSInteger i_level = [[mainInstance voutProvider] currentStatusWindowLevel]; [[mainInstance simplePreferences] showSimplePrefsWithLevel:i_level]; } @@ -1438,22 +1438,22 @@ typedef NS_ENUM(NSInteger, VLCObjectType) { - (IBAction)showErrorsAndWarnings:(id)sender { - [[[[VLCMain sharedInstance] coreDialogProvider] errorPanel] showWindow:self]; + [[[VLCMain.sharedInstance coreDialogProvider] errorPanel] showWindow:self]; } - (IBAction)showMessagesPanel:(id)showMessagesPanel { - [[[VLCMain sharedInstance] debugMsgPanel] showWindow:self]; + [[VLCMain.sharedInstance debugMsgPanel] showWindow:self]; } - (IBAction)showMainWindow:(id)sender { - [[[VLCMain sharedInstance] libraryWindow] makeKeyAndOrderFront:sender]; + [[VLCMain.sharedInstance libraryWindow] makeKeyAndOrderFront:sender]; } - (IBAction)showPlaylist:(id)sender { - [[[[VLCMain sharedInstance] libraryWindowController] window] makeKeyAndOrderFront:sender]; + [[[VLCMain.sharedInstance libraryWindowController] window] makeKeyAndOrderFront:sender]; } #pragma mark - Help and Docs diff --git a/modules/gui/macosx/menus/VLCStatusBarIcon.m b/modules/gui/macosx/menus/VLCStatusBarIcon.m index b2a96334c8..81ff62652c 100644 --- a/modules/gui/macosx/menus/VLCStatusBarIcon.m +++ b/modules/gui/macosx/menus/VLCStatusBarIcon.m @@ -279,12 +279,12 @@ - (void)hasPreviousChanged:(NSNotification *)aNotification { - backwardsButton.enabled = [[VLCMain sharedInstance] playlistController].hasPreviousPlaylistItem; + backwardsButton.enabled = [VLCMain.sharedInstance playlistController].hasPreviousPlaylistItem; } - (void)hasNextChanged:(NSNotification *)aNotification { - forwardButton.enabled = [[VLCMain sharedInstance] playlistController].hasNextPlaylistItem; + forwardButton.enabled = [VLCMain.sharedInstance playlistController].hasNextPlaylistItem; } /* Updates the Metadata for the currently @@ -373,7 +373,7 @@ - (void)updateMenuItemRandom { // Get current random status - [randomButton setState:[[VLCMain sharedInstance] playlistController].playbackOrder == VLC_PLAYLIST_PLAYBACK_ORDER_RANDOM ? NSOnState : NSOffState]; + [randomButton setState:[VLCMain.sharedInstance playlistController].playbackOrder == VLC_PLAYLIST_PLAYBACK_ORDER_RANDOM ? NSOnState : NSOffState]; } #pragma mark - @@ -443,13 +443,13 @@ - (IBAction)statusBarIconShowMainWindow:(id)sender { [[NSApplication sharedApplication] activateIgnoringOtherApps:YES]; - [(NSWindow *)[[VLCMain sharedInstance] libraryWindow] makeKeyAndOrderFront:sender]; + [(NSWindow *)[VLCMain.sharedInstance libraryWindow] makeKeyAndOrderFront:sender]; } // Action: Toggle Play / Pause - (IBAction)statusBarIconTogglePlayPause:(id)sender { - VLCPlaylistController *playlistController = [[VLCMain sharedInstance] playlistController]; + VLCPlaylistController *playlistController = [VLCMain.sharedInstance playlistController]; VLCPlayerController *playerController = playlistController.playerController; enum vlc_player_state playerState = playerController.playerState; if (playerState != VLC_PLAYER_STATE_PAUSED) { @@ -464,19 +464,19 @@ // Action: Go to next track - (IBAction)statusBarIconNext:(id)sender { - [[[VLCMain sharedInstance] playlistController] playNextItem]; + [[VLCMain.sharedInstance playlistController] playNextItem]; } // Action: Go to previous track - (IBAction)statusBarIconPrevious:(id)sender { - [[[VLCMain sharedInstance] playlistController] playPreviousItem]; + [[VLCMain.sharedInstance playlistController] playPreviousItem]; } // Action: Toggle random playback (shuffle) - (IBAction)statusBarIconToggleRandom:(id)sender { - VLCPlaylistController *playlistController = [[VLCMain sharedInstance] playlistController]; + VLCPlaylistController *playlistController = [VLCMain.sharedInstance playlistController]; playlistController.playbackOrder = (playlistController.playbackOrder == VLC_PLAYLIST_PLAYBACK_ORDER_RANDOM) ? VLC_PLAYLIST_PLAYBACK_ORDER_NORMAL : VLC_PLAYLIST_PLAYBACK_ORDER_RANDOM; } diff --git a/modules/gui/macosx/menus/renderers/VLCRendererMenuController.m b/modules/gui/macosx/menus/renderers/VLCRendererMenuController.m index e80817b8cb..390b5082f3 100644 --- a/modules/gui/macosx/menus/renderers/VLCRendererMenuController.m +++ b/modules/gui/macosx/menus/renderers/VLCRendererMenuController.m @@ -172,7 +172,7 @@ _selectedItem = sender; VLCRendererItem *item = [sender representedObject]; - VLCPlayerController *playerController = [[[VLCMain sharedInstance] playlistController] playerController]; + VLCPlayerController *playerController = [[VLCMain.sharedInstance playlistController] playerController]; if (item) { [item setRendererForPlayerController:playerController]; diff --git a/modules/gui/macosx/os-integration/VLCClickerManager.m b/modules/gui/macosx/os-integration/VLCClickerManager.m index 3c20d76463..91408472b0 100644 --- a/modules/gui/macosx/os-integration/VLCClickerManager.m +++ b/modules/gui/macosx/os-integration/VLCClickerManager.m @@ -54,7 +54,7 @@ { self = [super init]; if (self) { - _playlistController = [[VLCMain sharedInstance] playlistController]; + _playlistController = [VLCMain.sharedInstance playlistController]; _playerController = [_playlistController playerController]; NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; @@ -117,7 +117,7 @@ if (b_mediaKeySupport && !_mediaKeyController) _mediaKeyController = [[SPMediaKeyTap alloc] initWithDelegate:self]; - VLCMain *main = [VLCMain sharedInstance]; + VLCMain *main = VLCMain.sharedInstance; if (b_mediaKeySupport && ([[[main playlistController] playlistModel] numberOfPlaylistItems] > 0)) { if (!b_mediaKeyTrapEnabled) { [self enableMediaKeySupport]; @@ -155,7 +155,7 @@ return; } - BOOL numberOfMediaLargerThanZero = [[[[VLCMain sharedInstance] playlistController] playlistModel] numberOfPlaylistItems] > 0; + BOOL numberOfMediaLargerThanZero = [[[VLCMain.sharedInstance playlistController] playlistModel] numberOfPlaylistItems] > 0; if (b_mediaKeyTrapEnabled && !numberOfMediaLargerThanZero) { [self disableMediaKeySupport]; diff --git a/modules/gui/macosx/os-integration/VLCRemoteControlService.m b/modules/gui/macosx/os-integration/VLCRemoteControlService.m index 0c2456033d..a71675a16c 100644 --- a/modules/gui/macosx/os-integration/VLCRemoteControlService.m +++ b/modules/gui/macosx/os-integration/VLCRemoteControlService.m @@ -67,7 +67,7 @@ static inline NSArray * RemoteCommandCenterCommandsToHandle() { self = [super init]; if (self) { - _playlistController = [[VLCMain sharedInstance] playlistController]; + _playlistController = [VLCMain.sharedInstance playlistController]; _playerController = [_playlistController playerController]; NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; diff --git a/modules/gui/macosx/os-integration/applescript.m b/modules/gui/macosx/os-integration/applescript.m index 7babde2250..fd9b3e4f1b 100644 --- a/modules/gui/macosx/os-integration/applescript.m +++ b/modules/gui/macosx/os-integration/applescript.m @@ -50,7 +50,7 @@ VLCOpenInputMetadata *inputMetadata = [[VLCOpenInputMetadata alloc] init]; inputMetadata.MRLString = parameterString; - [[[VLCMain sharedInstance] playlistController] addPlaylistItems:@[inputMetadata]]; + [[VLCMain.sharedInstance playlistController] addPlaylistItems:@[inputMetadata]]; } } return nil; @@ -70,7 +70,7 @@ - (id)performDefaultImplementation { - VLCPlaylistController *playlistController = [[VLCMain sharedInstance] playlistController]; + VLCPlaylistController *playlistController = [VLCMain.sharedInstance playlistController]; VLCPlayerController *playerController = [playlistController playerController]; NSString *commandString = [[self commandDescription] commandName]; @@ -152,9 +152,9 @@ } else [playerController jumpBackwardShort]; } else if ([commandString isEqualToString:@"incrementPlaybackRate"]) { - [[[[VLCMain sharedInstance] playlistController] playerController] incrementPlaybackRate]; + [[[VLCMain.sharedInstance playlistController] playerController] incrementPlaybackRate]; } else if ([commandString isEqualToString:@"decrementPlaybackRate"]) { - [[[[VLCMain sharedInstance] playlistController] playerController] decrementPlaybackRate]; + [[[VLCMain.sharedInstance playlistController] playerController] decrementPlaybackRate]; } else { msg_Err(getIntf(), "Unhandled AppleScript command '%s'", [commandString UTF8String]); } @@ -171,22 +171,22 @@ - (BOOL)scriptFullscreenMode { - return [[[[VLCMain sharedInstance] playlistController] playerController] fullscreen]; + return [[[VLCMain.sharedInstance playlistController] playerController] fullscreen]; } - (void)setScriptFullscreenMode:(BOOL)mode { - [[[[VLCMain sharedInstance] playlistController] playerController] setFullscreen:mode]; + [[[VLCMain.sharedInstance playlistController] playerController] setFullscreen:mode]; } - (BOOL)muted { - return [[[[VLCMain sharedInstance] playlistController] playerController] mute]; + return [[[VLCMain.sharedInstance playlistController] playerController] mute]; } - (BOOL)playing { - enum vlc_player_state playerState = [[[[VLCMain sharedInstance] playlistController] playerController] playerState]; + enum vlc_player_state playerState = [[[VLCMain.sharedInstance playlistController] playerController] playerState]; if (playerState == VLC_PLAYER_STATE_STARTED || playerState == VLC_PLAYER_STATE_PLAYING) { return YES; @@ -197,62 +197,62 @@ - (float)audioVolume { - return [[[[VLCMain sharedInstance] playlistController] playerController] volume]; + return [[[VLCMain.sharedInstance playlistController] playerController] volume]; } - (void)setAudioVolume:(float)volume { - [[[[VLCMain sharedInstance] playlistController] playerController] setVolume:volume]; + [[[VLCMain.sharedInstance playlistController] playerController] setVolume:volume]; } - (long long)audioDesync { - return MS_FROM_VLC_TICK([[[[VLCMain sharedInstance] playlistController] playerController] audioDelay]); + return MS_FROM_VLC_TICK([[[VLCMain.sharedInstance playlistController] playerController] audioDelay]); } - (void)setAudioDesync:(long long)audioDelay { - [[[[VLCMain sharedInstance] playlistController] playerController] setAudioDelay: VLC_TICK_FROM_MS(audioDelay)]; + [[[VLCMain.sharedInstance playlistController] playerController] setAudioDelay: VLC_TICK_FROM_MS(audioDelay)]; } - (int)currentTime { - return (int)SEC_FROM_VLC_TICK([[[[VLCMain sharedInstance] playlistController] playerController] time]); + return (int)SEC_FROM_VLC_TICK([[[VLCMain.sharedInstance playlistController] playerController] time]); } - (void)setCurrentTime:(int)currentTime { - [[[[VLCMain sharedInstance] playlistController] playerController] setTimeFast: VLC_TICK_FROM_SEC(currentTime)]; + [[[VLCMain.sharedInstance playlistController] playerController] setTimeFast: VLC_TICK_FROM_SEC(currentTime)]; } - (float)playbackRate { - return [[[[VLCMain sharedInstance] playlistController] playerController] playbackRate]; + return [[[VLCMain.sharedInstance playlistController] playerController] playbackRate]; } - (void)setPlaybackRate:(float)playbackRate { - [[[[VLCMain sharedInstance] playlistController] playerController] setPlaybackRate:playbackRate]; + [[[VLCMain.sharedInstance playlistController] playerController] setPlaybackRate:playbackRate]; } - (NSInteger)durationOfCurrentItem { - return SEC_FROM_VLC_TICK([[[VLCMain sharedInstance] playlistController] playerController].durationOfCurrentMediaItem); + return SEC_FROM_VLC_TICK([[VLCMain.sharedInstance playlistController] playerController].durationOfCurrentMediaItem); } - (NSString *)pathOfCurrentItem { - return [[[[VLCMain sharedInstance] playlistController] playerController].URLOfCurrentMediaItem path]; + return [[[VLCMain.sharedInstance playlistController] playerController].URLOfCurrentMediaItem path]; } - (NSString *)nameOfCurrentItem { - return [[[[VLCMain sharedInstance] playlistController] playerController] nameOfCurrentMediaItem]; + return [[[VLCMain.sharedInstance playlistController] playerController] nameOfCurrentMediaItem]; } - (BOOL)playbackShowsMenu { - const struct vlc_player_title *currentTitle = [[[[VLCMain sharedInstance] playlistController] playerController] selectedTitle]; + const struct vlc_player_title *currentTitle = [[[VLCMain.sharedInstance playlistController] playerController] selectedTitle]; if (currentTitle == NULL) { return NO; } @@ -266,50 +266,50 @@ - (BOOL)recordable { - return [[[[VLCMain sharedInstance] playlistController] playerController] recordable]; + return [[[VLCMain.sharedInstance playlistController] playerController] recordable]; } - (BOOL)recordingEnabled { - return [[[[VLCMain sharedInstance] playlistController] playerController] enableRecording]; + return [[[VLCMain.sharedInstance playlistController] playerController] enableRecording]; } - (void)setRecordingEnabled:(BOOL)recordingEnabled { - [[[[VLCMain sharedInstance] playlistController] playerController] setEnableRecording:recordingEnabled]; + [[[VLCMain.sharedInstance playlistController] playerController] setEnableRecording:recordingEnabled]; } - (BOOL)shuffledPlayback { - enum vlc_playlist_playback_order playbackOrder = [[[VLCMain sharedInstance] playlistController] playbackOrder]; + enum vlc_playlist_playback_order playbackOrder = [[VLCMain.sharedInstance playlistController] playbackOrder]; return playbackOrder == VLC_PLAYLIST_PLAYBACK_ORDER_RANDOM ? YES : NO; } - (void)setShuffledPlayback:(BOOL)shuffledPlayback { - [[[VLCMain sharedInstance] playlistController] setPlaybackOrder: shuffledPlayback ? VLC_PLAYLIST_PLAYBACK_ORDER_RANDOM : VLC_PLAYLIST_PLAYBACK_ORDER_NORMAL]; + [[VLCMain.sharedInstance playlistController] setPlaybackOrder: shuffledPlayback ? VLC_PLAYLIST_PLAYBACK_ORDER_RANDOM : VLC_PLAYLIST_PLAYBACK_ORDER_NORMAL]; } - (BOOL)repeatOne { - enum vlc_playlist_playback_repeat repeatMode = [[[VLCMain sharedInstance] playlistController] playbackRepeat]; + enum vlc_playlist_playback_repeat repeatMode = [[VLCMain.sharedInstance playlistController] playbackRepeat]; return repeatMode == VLC_PLAYLIST_PLAYBACK_REPEAT_CURRENT ? YES : NO; } - (void)setRepeatOne:(BOOL)repeatOne { - [[[VLCMain sharedInstance] playlistController] setPlaybackRepeat: repeatOne == YES ? VLC_PLAYLIST_PLAYBACK_REPEAT_CURRENT : VLC_PLAYLIST_PLAYBACK_REPEAT_NONE]; + [[VLCMain.sharedInstance playlistController] setPlaybackRepeat: repeatOne == YES ? VLC_PLAYLIST_PLAYBACK_REPEAT_CURRENT : VLC_PLAYLIST_PLAYBACK_REPEAT_NONE]; } - (BOOL)repeatAll { - enum vlc_playlist_playback_repeat repeatMode = [[[VLCMain sharedInstance] playlistController] playbackRepeat]; + enum vlc_playlist_playback_repeat repeatMode = [[VLCMain.sharedInstance playlistController] playbackRepeat]; return repeatMode == VLC_PLAYLIST_PLAYBACK_REPEAT_ALL ? YES : NO; } - (void)setRepeatAll:(BOOL)repeatAll { - [[[VLCMain sharedInstance] playlistController] setPlaybackRepeat: repeatAll == YES ? VLC_PLAYLIST_PLAYBACK_REPEAT_ALL : VLC_PLAYLIST_PLAYBACK_REPEAT_NONE]; + [[VLCMain.sharedInstance playlistController] setPlaybackRepeat: repeatAll == YES ? VLC_PLAYLIST_PLAYBACK_REPEAT_ALL : VLC_PLAYLIST_PLAYBACK_REPEAT_NONE]; } @end diff --git a/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m b/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m index e3f71fdb44..5c7912153c 100644 --- a/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m +++ b/modules/gui/macosx/panels/VLCAudioEffectsWindowController.m @@ -119,7 +119,7 @@ static inline void enableTextField(NSTextField *const __unsafe_unretained textFi self = [super initWithWindowNibName:@"AudioEffects"]; if (self) { dispatch_async(dispatch_get_main_queue(), ^{ - self->_playerController = [[[VLCMain sharedInstance] playlistController] playerController]; + self->_playerController = [[VLCMain.sharedInstance playlistController] playerController]; NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; if ([defaults boolForKey:@"AudioEffectApplyProfileOnStartup"]) @@ -386,7 +386,7 @@ static inline void enableTextField(NSTextField *const __unsafe_unretained textFi if ([self.window isKeyWindow]) [self.window orderOut:sender]; else { - [self.window setLevel: [[[VLCMain sharedInstance] voutProvider] currentStatusWindowLevel]]; + [self.window setLevel: [[VLCMain.sharedInstance voutProvider] currentStatusWindowLevel]]; [self.window makeKeyAndOrderFront:sender]; } } diff --git a/modules/gui/macosx/panels/VLCBookmarksWindowController.m b/modules/gui/macosx/panels/VLCBookmarksWindowController.m index 10000fc85a..e53044dc02 100644 --- a/modules/gui/macosx/panels/VLCBookmarksWindowController.m +++ b/modules/gui/macosx/panels/VLCBookmarksWindowController.m @@ -107,7 +107,7 @@ if ([self.window isVisible]) [self.window orderOut:sender]; else { - [self.window setLevel: [[[VLCMain sharedInstance] voutProvider] currentStatusWindowLevel]]; + [self.window setLevel: [[VLCMain.sharedInstance voutProvider] currentStatusWindowLevel]]; [self.window makeKeyAndOrderFront:sender]; } } diff --git a/modules/gui/macosx/panels/VLCInformationWindowController.m b/modules/gui/macosx/panels/VLCInformationWindowController.m index 62f7bbba3e..ce36c9ff0a 100644 --- a/modules/gui/macosx/panels/VLCInformationWindowController.m +++ b/modules/gui/macosx/panels/VLCInformationWindowController.m @@ -187,7 +187,7 @@ if ([self.window isKeyWindow]) [self.window orderOut:sender]; else { - [self.window setLevel: [[[VLCMain sharedInstance] voutProvider] currentStatusWindowLevel]]; + [self.window setLevel: [[VLCMain.sharedInstance voutProvider] currentStatusWindowLevel]]; [self.window makeKeyAndOrderFront:sender]; } } diff --git a/modules/gui/macosx/panels/VLCTrackSynchronizationWindowController.m b/modules/gui/macosx/panels/VLCTrackSynchronizationWindowController.m index ccde9fa1fc..4e88d1cb5e 100644 --- a/modules/gui/macosx/panels/VLCTrackSynchronizationWindowController.m +++ b/modules/gui/macosx/panels/VLCTrackSynchronizationWindowController.m @@ -57,7 +57,7 @@ - (void)windowDidLoad { - _playerController = [[[VLCMain sharedInstance] playlistController] playerController]; + _playerController = [[VLCMain.sharedInstance playlistController] playerController]; NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; [notificationCenter addObserver:self selector:@selector(updateValues:) @@ -133,7 +133,7 @@ if ([self.window isVisible]) [self.window orderOut:sender]; else { - [self.window setLevel: [[[VLCMain sharedInstance] voutProvider] currentStatusWindowLevel]]; + [self.window setLevel: [[VLCMain.sharedInstance voutProvider] currentStatusWindowLevel]]; [self.window makeKeyAndOrderFront:sender]; [self updateValues:nil]; diff --git a/modules/gui/macosx/panels/VLCVideoEffectsWindowController.m b/modules/gui/macosx/panels/VLCVideoEffectsWindowController.m index 5926e6a868..aa93d1b704 100644 --- a/modules/gui/macosx/panels/VLCVideoEffectsWindowController.m +++ b/modules/gui/macosx/panels/VLCVideoEffectsWindowController.m @@ -130,7 +130,7 @@ NSString *VLCVideoEffectsProfileNamesKey = @"VideoEffectProfileNames"; /* filter handling */ NSString *tempString = B64DecNSStr([items firstObject]); - VLCPlayerController *playerController = [[[VLCMain sharedInstance] playlistController] playerController]; + VLCPlayerController *playerController = [[VLCMain.sharedInstance playlistController] playerController]; vout_thread_t *vout = [playerController mainVideoOutputThread]; /* enable the new filters */ @@ -434,7 +434,7 @@ NSString *VLCVideoEffectsProfileNamesKey = @"VideoEffectProfileNames"; return; } - VLCPlayerController *playerController = [[[VLCMain sharedInstance] playlistController] playerController]; + VLCPlayerController *playerController = [[VLCMain.sharedInstance playlistController] playerController]; vout_thread_t *vout = [playerController mainVideoOutputThread]; if (!vout) return; @@ -493,7 +493,7 @@ NSString *VLCVideoEffectsProfileNamesKey = @"VideoEffectProfileNames"; /// Sets widget values based on variables - (void)resetValues { - VLCPlayerController *playerController = [[[VLCMain sharedInstance] playlistController] playerController]; + VLCPlayerController *playerController = [[VLCMain.sharedInstance playlistController] playerController]; vout_thread_t *vout = [playerController mainVideoOutputThread]; if (!vout) return; @@ -667,7 +667,7 @@ NSString *VLCVideoEffectsProfileNamesKey = @"VideoEffectProfileNames"; - (NSString *)generateProfileString { - VLCPlayerController *playerController = [[[VLCMain sharedInstance] playlistController] playerController]; + VLCPlayerController *playerController = [[VLCMain.sharedInstance playlistController] playerController]; vout_thread_t *vout = [playerController mainVideoOutputThread]; if (!vout) return nil; @@ -778,7 +778,7 @@ NSString *VLCVideoEffectsProfileNamesKey = @"VideoEffectProfileNames"; if ([self.window isKeyWindow]) [self.window orderOut:sender]; else { - [self.window setLevel: [[[VLCMain sharedInstance] voutProvider] currentStatusWindowLevel]]; + [self.window setLevel: [[VLCMain.sharedInstance voutProvider] currentStatusWindowLevel]]; [self.window makeKeyAndOrderFront:sender]; } } @@ -1029,7 +1029,7 @@ NSString *VLCVideoEffectsProfileNamesKey = @"VideoEffectProfileNames"; [self setCropRightValue: [self cropLeftValue]]; } - VLCPlayerController *playerController = [[[VLCMain sharedInstance] playlistController] playerController]; + VLCPlayerController *playerController = [[VLCMain.sharedInstance playlistController] playerController]; vout_thread_t *p_vout = [playerController mainVideoOutputThread]; if (p_vout) { var_SetInteger(p_vout, "crop-top", [_cropTopTextField intValue]); diff --git a/modules/gui/macosx/panels/dialogs/VLCResumeDialogController.m b/modules/gui/macosx/panels/dialogs/VLCResumeDialogController.m index d8480c898e..295ff6bbd1 100644 --- a/modules/gui/macosx/panels/dialogs/VLCResumeDialogController.m +++ b/modules/gui/macosx/panels/dialogs/VLCResumeDialogController.m @@ -87,7 +87,7 @@ repeats:YES]; NSWindow *window = [self window]; - [window setLevel:[[[VLCMain sharedInstance] voutProvider] currentStatusWindowLevel]]; + [window setLevel:[[VLCMain.sharedInstance voutProvider] currentStatusWindowLevel]]; [window center]; [window makeKeyAndOrderFront:nil]; } diff --git a/modules/gui/macosx/playlist/VLCPlaybackContinuityController.m b/modules/gui/macosx/playlist/VLCPlaybackContinuityController.m index 71e74a0329..f2169d3a96 100644 --- a/modules/gui/macosx/playlist/VLCPlaybackContinuityController.m +++ b/modules/gui/macosx/playlist/VLCPlaybackContinuityController.m @@ -87,7 +87,7 @@ static NSString *VLCRecentlyPlayedMediaListKey = @"recentlyPlayedMediaList"; if (_currentInput) { /* continue playback where you left off */ - [self storePlaybackPositionForItem:_currentInput player:[VLCMain sharedInstance].playlistController.playerController]; + [self storePlaybackPositionForItem:_currentInput player:VLCMain.sharedInstance.playlistController.playerController]; } } @@ -110,7 +110,7 @@ static NSString *VLCRecentlyPlayedMediaListKey = @"recentlyPlayedMediaList"; { // On shutdown, input might not be dead yet. Cleanup actions like itunes playback // and playback positon are done in different code paths (dealloc and appWillTerminate:). - if ([[VLCMain sharedInstance] isTerminating]) { + if ([VLCMain.sharedInstance isTerminating]) { return; } diff --git a/modules/gui/macosx/playlist/VLCPlaylistMenuController.m b/modules/gui/macosx/playlist/VLCPlaylistMenuController.m index 17879916df..d16a171940 100644 --- a/modules/gui/macosx/playlist/VLCPlaylistMenuController.m +++ b/modules/gui/macosx/playlist/VLCPlaylistMenuController.m @@ -57,7 +57,7 @@ self = [super init]; if (self) { [self createMenu]; - _playlistController = [[VLCMain sharedInstance] playlistController]; + _playlistController = [VLCMain.sharedInstance playlistController]; } return self; } @@ -148,7 +148,7 @@ { NSInteger selectedRow = self.playlistTableView.selectedRow; - [[[VLCMain sharedInstance] open] openFileWithAction:^(NSArray *files) { + [[VLCMain.sharedInstance open] openFileWithAction:^(NSArray *files) { [self->_playlistController addPlaylistItems:files atPosition:selectedRow startPlayback:NO]; diff --git a/modules/gui/macosx/playlist/VLCPlaylistSortingMenuController.m b/modules/gui/macosx/playlist/VLCPlaylistSortingMenuController.m index 0ba9f6bd46..c59521950c 100644 --- a/modules/gui/macosx/playlist/VLCPlaylistSortingMenuController.m +++ b/modules/gui/macosx/playlist/VLCPlaylistSortingMenuController.m @@ -39,7 +39,7 @@ self = [super init]; if (self) { [self createMenu]; - _playlistController = [[VLCMain sharedInstance] playlistController]; + _playlistController = [VLCMain.sharedInstance playlistController]; } return self; } diff --git a/modules/gui/macosx/playlist/VLCPlaylistTableView.m b/modules/gui/macosx/playlist/VLCPlaylistTableView.m index 3a814cc2fb..d5987b92c2 100644 --- a/modules/gui/macosx/playlist/VLCPlaylistTableView.m +++ b/modules/gui/macosx/playlist/VLCPlaylistTableView.m @@ -70,14 +70,14 @@ case NSDeleteCharFunctionKey: case NSBackspaceCharacter: { - VLCPlaylistController *playlistController = [[VLCMain sharedInstance] playlistController]; + VLCPlaylistController *playlistController = [VLCMain.sharedInstance playlistController]; [playlistController removeItemsAtIndexes:selectedIndexes]; break; } case NSEnterCharacter: case NSCarriageReturnCharacter: - [[[VLCMain sharedInstance] playlistController] playItemAtIndex:indexOfSelectedItem]; + [[VLCMain.sharedInstance playlistController] playItemAtIndex:indexOfSelectedItem]; break; default: diff --git a/modules/gui/macosx/preferences/VLCHotkeyChangeWindow.m b/modules/gui/macosx/preferences/VLCHotkeyChangeWindow.m index f4352fa207..2209f12f7d 100644 --- a/modules/gui/macosx/preferences/VLCHotkeyChangeWindow.m +++ b/modules/gui/macosx/preferences/VLCHotkeyChangeWindow.m @@ -124,7 +124,7 @@ else return NO; - return [[[VLCMain sharedInstance] simplePreferences] changeHotkeyTo: tempString]; + return [[VLCMain.sharedInstance simplePreferences] changeHotkeyTo: tempString]; } @end diff --git a/modules/gui/macosx/preferences/VLCSimplePrefsController.m b/modules/gui/macosx/preferences/VLCSimplePrefsController.m index 9c44c5ea5d..287a08619a 100644 --- a/modules/gui/macosx/preferences/VLCSimplePrefsController.m +++ b/modules/gui/macosx/preferences/VLCSimplePrefsController.m @@ -305,7 +305,7 @@ create_toolbar_item(NSString *itemIdent, NSString *name, NSString *desc, NSStrin static NSArray *toolbarIdentifiers = nil; dispatch_once(&onceToken, ^{ - if ([[[VLCMain sharedInstance] libraryController] libraryModel]) { + if ([[VLCMain.sharedInstance libraryController] libraryModel]) { toolbarIdentifiers = @[VLCIntfSettingToolbarIdentifier, VLCAudioSettingToolbarIdentifier, VLCVideoSettingToolbarIdentifier, @@ -888,7 +888,7 @@ static inline const char * __config_GetLabel(vlc_object_t *p_this, const char *p [self.window orderOut: sender]; } else if (sender == _showAllButton) { [self.window orderOut: self]; - [[[VLCMain sharedInstance] preferences] showPrefsWithLevel:[self.window level]]; + [[VLCMain.sharedInstance preferences] showPrefsWithLevel:[self.window level]]; } else msg_Warn(p_intf, "unknown buttonAction sender"); } @@ -908,7 +908,7 @@ static inline const char * __config_GetLabel(vlc_object_t *p_this, const char *p [alert addButtonWithTitle:_NS("Continue")]; [alert beginSheetModalForWindow:[sender window] completionHandler:^(NSModalResponse returnCode) { if (returnCode == NSAlertSecondButtonReturn) { - [[VLCMain sharedInstance] resetPreferences]; + [VLCMain.sharedInstance resetPreferences]; } }]; } @@ -1536,7 +1536,7 @@ static inline void save_string_list(intf_thread_t * p_intf, id object, const cha { self = [super init]; if (self) { - _libraryController = [[VLCMain sharedInstance] libraryController]; + _libraryController = [VLCMain.sharedInstance libraryController]; _libraryModel = _libraryController.libraryModel; NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; diff --git a/modules/gui/macosx/preferences/VLCSimplePrefsWindow.m b/modules/gui/macosx/preferences/VLCSimplePrefsWindow.m index daa7cc2760..5d211a8f8b 100644 --- a/modules/gui/macosx/preferences/VLCSimplePrefsWindow.m +++ b/modules/gui/macosx/preferences/VLCSimplePrefsWindow.m @@ -33,7 +33,7 @@ - (void)changeFont:(id)sender { - [[[VLCMain sharedInstance] simplePreferences] changeFont: sender]; + [[VLCMain.sharedInstance simplePreferences] changeFont: sender]; } @end diff --git a/modules/gui/macosx/preferences/prefs.m b/modules/gui/macosx/preferences/prefs.m index ff44d53096..fa6489a800 100644 --- a/modules/gui/macosx/preferences/prefs.m +++ b/modules/gui/macosx/preferences/prefs.m @@ -230,12 +230,12 @@ enum VLCTreeBranchType { - (IBAction)showSimplePrefs: (id)sender { [self.window orderOut: self]; - [[[VLCMain sharedInstance] simplePreferences] showSimplePrefs]; + [[VLCMain.sharedInstance simplePreferences] showSimplePrefs]; } - (IBAction)resetPrefs:(id)sender { - [[[VLCMain sharedInstance] simplePreferences] resetPreferences:sender]; + [[VLCMain.sharedInstance simplePreferences] resetPreferences:sender]; } - (void)loadConfigTree diff --git a/modules/gui/macosx/views/VLCTimeField.m b/modules/gui/macosx/views/VLCTimeField.m index 14165a5b14..21380ddbc1 100644 --- a/modules/gui/macosx/views/VLCTimeField.m +++ b/modules/gui/macosx/views/VLCTimeField.m @@ -72,7 +72,7 @@ NSString *VLCTimeFieldDisplayTimeAsRemaining = @"DisplayTimeAsTimeRemaining"; - (void)mouseDown: (NSEvent *)ourEvent { if ( [ourEvent clickCount] > 1 ) { - [[[VLCMain sharedInstance] mainMenu] goToSpecificTime: nil]; + [[VLCMain.sharedInstance mainMenu] goToSpecificTime: nil]; } else { self.isTimeRemaining = !self.isTimeRemaining; } diff --git a/modules/gui/macosx/windows/VLCDetachedAudioWindow.m b/modules/gui/macosx/windows/VLCDetachedAudioWindow.m index 92df65fd24..94bfdd6885 100644 --- a/modules/gui/macosx/windows/VLCDetachedAudioWindow.m +++ b/modules/gui/macosx/windows/VLCDetachedAudioWindow.m @@ -45,7 +45,7 @@ self.title = @""; self.imageView.cropsImagesToRoundedCorners = NO; - _playerController = [[[VLCMain sharedInstance] playlistController] playerController]; + _playerController = [[VLCMain.sharedInstance playlistController] playerController]; VLCTrackingView *trackingView = self.contentView; trackingView.viewToHide = self.wrapperView; trackingView.animatesTransition = YES; diff --git a/modules/gui/macosx/windows/VLCOpenWindowController.m b/modules/gui/macosx/windows/VLCOpenWindowController.m index f69402d167..26f794486b 100644 --- a/modules/gui/macosx/windows/VLCOpenWindowController.m +++ b/modules/gui/macosx/windows/VLCOpenWindowController.m @@ -418,7 +418,7 @@ NSString *const VLCOpenTextFieldWasClicked = @"VLCOpenTextFieldWasClicked"; /* apply the options to our item(s) */ inputMetadata.playbackOptions = options; - [[[VLCMain sharedInstance] playlistController] addPlaylistItems:@[inputMetadata]]; + [[VLCMain.sharedInstance playlistController] addPlaylistItems:@[inputMetadata]]; } - (void)addSubtitleOptionsToArray:(NSMutableArray *)options diff --git a/modules/gui/macosx/windows/convertandsave/VLCConvertAndSaveWindowController.m b/modules/gui/macosx/windows/convertandsave/VLCConvertAndSaveWindowController.m index c60a964286..c876b96ff9 100644 --- a/modules/gui/macosx/windows/convertandsave/VLCConvertAndSaveWindowController.m +++ b/modules/gui/macosx/windows/convertandsave/VLCConvertAndSaveWindowController.m @@ -316,7 +316,7 @@ NSString *VLCConvertAndSaveProfileNamesKey = @"CASProfileNames"; } inputMetaItem.playbackOptions = options; - VLCPlaylistController *playlistController = [[VLCMain sharedInstance] playlistController]; + VLCPlaylistController *playlistController = [VLCMain.sharedInstance playlistController]; [playlistController addPlaylistItems:@[inputMetaItem]]; [playlistController playItemAtIndex:(playlistController.playlistModel.numberOfPlaylistItems -1)]; diff --git a/modules/gui/macosx/windows/mainwindow/VLCControlsBarCommon.m b/modules/gui/macosx/windows/mainwindow/VLCControlsBarCommon.m index d3e1a9bcbe..120aec4847 100644 --- a/modules/gui/macosx/windows/mainwindow/VLCControlsBarCommon.m +++ b/modules/gui/macosx/windows/mainwindow/VLCControlsBarCommon.m @@ -69,7 +69,7 @@ { [super awakeFromNib]; - _playlistController = [[VLCMain sharedInstance] playlistController]; + _playlistController = [VLCMain.sharedInstance playlistController]; _playerController = _playlistController.playerController; NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; diff --git a/modules/gui/macosx/windows/mainwindow/VLCMainWindowControlsBar.m b/modules/gui/macosx/windows/mainwindow/VLCMainWindowControlsBar.m index 8d40c8fd68..c19710a132 100644 --- a/modules/gui/macosx/windows/mainwindow/VLCMainWindowControlsBar.m +++ b/modules/gui/macosx/windows/mainwindow/VLCMainWindowControlsBar.m @@ -61,7 +61,7 @@ - (void)awakeFromNib { [super awakeFromNib]; - _playlistController = [[VLCMain sharedInstance] playlistController]; + _playlistController = [VLCMain.sharedInstance playlistController]; _playerController = _playlistController.playerController; NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; @@ -132,7 +132,7 @@ - (IBAction)artworkButtonAction:(id)sender { - [[VLCMain sharedInstance].libraryWindow reopenVideoView]; + [VLCMain.sharedInstance.libraryWindow reopenVideoView]; } #pragma mark - diff --git a/modules/gui/macosx/windows/video/VLCVideoOutputProvider.m b/modules/gui/macosx/windows/video/VLCVideoOutputProvider.m index bc74ef43ac..2d447dcf7c 100644 --- a/modules/gui/macosx/windows/video/VLCVideoOutputProvider.m +++ b/modules/gui/macosx/windows/video/VLCVideoOutputProvider.m @@ -57,7 +57,7 @@ static int WindowEnable(vlc_window_t *p_wnd, const vlc_window_cfg_t *cfg) NSRect proposedVideoViewPosition = NSMakeRect(cfg->x, cfg->y, cfg->width, cfg->height); - VLCVideoOutputProvider *voutProvider = [[VLCMain sharedInstance] voutProvider]; + VLCVideoOutputProvider *voutProvider = [VLCMain.sharedInstance voutProvider]; if (!voutProvider) { return VLC_EGENERIC; } @@ -83,7 +83,7 @@ static int WindowEnable(vlc_window_t *p_wnd, const vlc_window_cfg_t *cfg) static void WindowDisable(vlc_window_t *p_wnd) { @autoreleasepool { - VLCVideoOutputProvider *voutProvider = [[VLCMain sharedInstance] voutProvider]; + VLCVideoOutputProvider *voutProvider = [VLCMain.sharedInstance voutProvider]; dispatch_async(dispatch_get_main_queue(), ^{ [voutProvider removeVoutForDisplay:[NSValue valueWithPointer:p_wnd]]; @@ -95,7 +95,7 @@ static void WindowResize(vlc_window_t *p_wnd, unsigned i_width, unsigned i_height) { @autoreleasepool { - VLCVideoOutputProvider *voutProvider = [[VLCMain sharedInstance] voutProvider]; + VLCVideoOutputProvider *voutProvider = [VLCMain.sharedInstance voutProvider]; dispatch_async(dispatch_get_main_queue(), ^{ [voutProvider setNativeVideoSize:NSMakeSize(i_width, i_height) @@ -110,7 +110,7 @@ static void WindowSetState(vlc_window_t *p_wnd, unsigned i_state) msg_Dbg(p_wnd, "Ignore change to VLC_WINDOW_STATE_BELOW"); @autoreleasepool { - VLCVideoOutputProvider *voutProvider = [[VLCMain sharedInstance] voutProvider]; + VLCVideoOutputProvider *voutProvider = [VLCMain.sharedInstance voutProvider]; NSInteger i_cocoa_level = NSNormalWindowLevel; @@ -136,7 +136,7 @@ static void WindowSetFullscreen(vlc_window_t *p_wnd, const char *psz_id) BOOL b_animation = YES; @autoreleasepool { - VLCVideoOutputProvider *voutProvider = [[VLCMain sharedInstance] voutProvider]; + VLCVideoOutputProvider *voutProvider = [VLCMain.sharedInstance voutProvider]; dispatch_async(dispatch_get_main_queue(), ^{ [voutProvider setFullscreen:i_full @@ -223,7 +223,7 @@ int WindowOpen(vlc_window_t *p_wnd) - (VLCVideoWindowCommon *)borderlessVideoWindowAsVideoWallpaper:(BOOL)asVideoWallpaper withWindowDecorations:(BOOL)withWindowDecorations { - VLCMain *mainInstance = [VLCMain sharedInstance]; + VLCMain *mainInstance = VLCMain.sharedInstance; // videoWallpaper is priorized over !windowDecorations msg_Dbg(getIntf(), "Creating background / blank window"); @@ -272,7 +272,7 @@ int WindowOpen(vlc_window_t *p_wnd) - (VLCVideoWindowCommon *)setupMainLibraryVideoWindow { - VLCMain *mainInstance = [VLCMain sharedInstance]; + VLCMain *mainInstance = VLCMain.sharedInstance; b_mainWindowHasVideo = YES; return mainInstance.libraryWindow; } @@ -399,7 +399,7 @@ int WindowOpen(vlc_window_t *p_wnd) [voutView setVoutThread:(vout_thread_t *)vlc_object_parent(p_wnd)]; videoWindow.hasActiveVideo = YES; _playerController.activeVideoPlayback = YES; - [VLCMain sharedInstance].libraryWindow.nonembedded = !b_mainWindowHasVideo; + VLCMain.sharedInstance.libraryWindow.nonembedded = !b_mainWindowHasVideo; } - (void)setupFullscreenStartIfNeededForVout:(VLCVoutView *)voutView @@ -426,7 +426,7 @@ int WindowOpen(vlc_window_t *p_wnd) - (VLCVoutView *)setupVoutForWindow:(vlc_window_t *)p_wnd withProposedVideoViewPosition:(NSRect)videoViewPosition { - _playerController = [VLCMain sharedInstance].playlistController.playerController; + _playerController = VLCMain.sharedInstance.playlistController.playerController; VLCVideoWindowCommon *newVideoWindow = [self setupVideoWindow]; VLCVoutView *voutView = newVideoWindow.videoViewController.voutView; @@ -449,7 +449,7 @@ int WindowOpen(vlc_window_t *p_wnd) - (void)removeVoutForDisplay:(NSValue *)key { - VLCMain *mainInstance = [VLCMain sharedInstance]; + VLCMain *mainInstance = VLCMain.sharedInstance; VLCVideoWindowCommon *videoWindow = [_voutWindows objectForKey:key]; if (!videoWindow) { msg_Err(getIntf(), "Cannot close nonexisting window"); @@ -560,7 +560,7 @@ int WindowOpen(vlc_window_t *p_wnd) if (b_nativeFullscreenMode) { if(!o_current_window) - o_current_window = [[VLCMain sharedInstance] libraryWindow] ; + o_current_window = [VLCMain.sharedInstance libraryWindow] ; assert(o_current_window); // fullscreen might be triggered twice (vout event) @@ -601,7 +601,7 @@ int WindowOpen(vlc_window_t *p_wnd) _currentStatusWindowLevel = i_level + 1; } - VLCMain *main = [VLCMain sharedInstance]; + VLCMain *main = VLCMain.sharedInstance; [[main libraryWindow] setWindowLevel:i_level]; [[NSNotificationCenter defaultCenter] postNotificationName:VLCWindowShouldUpdateLevel object:self userInfo:@{VLCWindowLevelKey : @(_currentWindowLevel)}]; diff --git a/modules/gui/macosx/windows/video/VLCVideoWindowCommon.m b/modules/gui/macosx/windows/video/VLCVideoWindowCommon.m index c8a7f29637..a6a4c0260c 100644 --- a/modules/gui/macosx/windows/video/VLCVideoWindowCommon.m +++ b/modules/gui/macosx/windows/video/VLCVideoWindowCommon.m @@ -127,7 +127,7 @@ NSString *VLCWindowShouldShowController = @"VLCWindowShouldShowController"; o_temp_view = [[NSView alloc] init]; [o_temp_view setAutoresizingMask:NSViewHeightSizable | NSViewWidthSizable]; - _playerController = [[[VLCMain sharedInstance] playlistController] playerController]; + _playerController = [[VLCMain.sharedInstance playlistController] playerController]; _videoViewController = [[VLCMainVideoViewController alloc] init]; [self mediaMetadataChanged:nil]; @@ -144,7 +144,7 @@ NSString *VLCWindowShouldShowController = @"VLCWindowShouldShowController"; - (void)mediaMetadataChanged:(NSNotification *)aNotification { - VLCPlaylistController *playlistController = [[VLCMain sharedInstance] playlistController]; + VLCPlaylistController *playlistController = [VLCMain.sharedInstance playlistController]; VLCInputItem *inputItem = [playlistController currentlyPlayingInputItem]; if (inputItem == NULL || _playerController.playerState == VLC_PLAYER_STATE_STOPPED) { [self setTitle:_NS("VLC media player")]; @@ -250,7 +250,7 @@ NSString *VLCWindowShouldShowController = @"VLCWindowShouldShowController"; NSInteger i_currLevel = [self level]; // self.fullscreen and _inFullscreenTransition must not be true yet - [[[VLCMain sharedInstance] voutProvider] updateWindowLevelForHelperWindows: NSNormalWindowLevel]; + [[VLCMain.sharedInstance voutProvider] updateWindowLevelForHelperWindows: NSNormalWindowLevel]; [self setLevel:NSNormalWindowLevel]; i_originalLevel = i_currLevel; @@ -317,7 +317,7 @@ NSString *VLCWindowShouldShowController = @"VLCWindowShouldShowController"; { _inFullscreenTransition = NO; - [[[VLCMain sharedInstance] voutProvider] updateWindowLevelForHelperWindows: i_originalLevel]; + [[VLCMain.sharedInstance voutProvider] updateWindowLevelForHelperWindows: i_originalLevel]; [self setLevel:i_originalLevel]; } @@ -351,7 +351,7 @@ NSString *VLCWindowShouldShowController = @"VLCWindowShouldShowController"; /* Make sure we don't see the window flashes in float-on-top mode */ NSInteger i_currLevel = [self level]; // self.fullscreen must not be true yet - [[[VLCMain sharedInstance] voutProvider] updateWindowLevelForHelperWindows: NSNormalWindowLevel]; + [[VLCMain.sharedInstance voutProvider] updateWindowLevelForHelperWindows: NSNormalWindowLevel]; [self setLevel:NSNormalWindowLevel]; i_originalLevel = i_currLevel; // would be overwritten by previous call @@ -614,7 +614,7 @@ NSString *VLCWindowShouldShowController = @"VLCWindowShouldShowController"; o_fullscreen_window = nil; - [[[VLCMain sharedInstance] voutProvider] updateWindowLevelForHelperWindows: i_originalLevel]; + [[VLCMain.sharedInstance voutProvider] updateWindowLevelForHelperWindows: i_originalLevel]; [self setLevel:i_originalLevel]; [self setAlphaValue: config_GetFloat("macosx-opaqueness")]; diff --git a/modules/gui/macosx/windows/video/VLCVoutView.m b/modules/gui/macosx/windows/video/VLCVoutView.m index 7ad7d8ae16..45f31d80e1 100644 --- a/modules/gui/macosx/windows/video/VLCVoutView.m +++ b/modules/gui/macosx/windows/video/VLCVoutView.m @@ -155,7 +155,7 @@ } else if (([o_event type] == NSRightMouseDown) || (([o_event type] == NSLeftMouseDown) && ([o_event modifierFlags] & NSControlKeyMask))) - [NSMenu popUpContextMenu: [[[VLCMain sharedInstance] mainMenu] voutMenu] withEvent: o_event forView: self]; + [NSMenu popUpContextMenu: [[VLCMain.sharedInstance mainMenu] voutMenu] withEvent: o_event forView: self]; [super mouseDown: o_event]; } @@ -163,7 +163,7 @@ - (void)rightMouseDown:(NSEvent *)o_event { if ([o_event type] == NSRightMouseDown) - [NSMenu popUpContextMenu: [[[VLCMain sharedInstance] mainMenu] voutMenu] withEvent: o_event forView: self]; + [NSMenu popUpContextMenu: [[VLCMain.sharedInstance mainMenu] voutMenu] withEvent: o_event forView: self]; [super mouseDown: o_event]; } @@ -171,7 +171,7 @@ - (void)rightMouseUp:(NSEvent *)o_event { if ([o_event type] == NSRightMouseUp) - [NSMenu popUpContextMenu: [[[VLCMain sharedInstance] mainMenu] voutMenu] withEvent: o_event forView: self]; + [NSMenu popUpContextMenu: [[VLCMain.sharedInstance mainMenu] voutMenu] withEvent: o_event forView: self]; [super mouseUp: o_event]; }