Browse Source

macosx: Use class property and dot notation for VLCMain sharedInstance

Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
pull/162/head
Claudio Cambra 3 years ago
committed by Jean-Baptiste Kempf
parent
commit
e044070ff9
  1. 8
      modules/gui/macosx/coreinteraction/VLCHotkeysController.m
  2. 4
      modules/gui/macosx/coreinteraction/VLCVideoFilterHelper.m
  3. 6
      modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
  4. 4
      modules/gui/macosx/library/VLCLibraryCollectionViewMediaItemSupplementaryDetailView.m
  5. 2
      modules/gui/macosx/library/VLCLibraryController.m
  6. 2
      modules/gui/macosx/library/VLCLibraryMenuController.m
  7. 2
      modules/gui/macosx/library/VLCLibrarySortingMenuController.m
  8. 2
      modules/gui/macosx/library/VLCLibraryTableCellView.m
  9. 10
      modules/gui/macosx/library/VLCLibraryWindow.m
  10. 6
      modules/gui/macosx/library/VLCLibraryWindowController.m
  11. 4
      modules/gui/macosx/library/audio-library/VLCLibraryAlbumTableCellView.m
  12. 8
      modules/gui/macosx/library/audio-library/VLCLibraryAudioDataSource.m
  13. 2
      modules/gui/macosx/library/audio-library/VLCLibraryAudioGroupDataSource.m
  14. 2
      modules/gui/macosx/library/audio-library/VLCLibraryAudioViewController.m
  15. 4
      modules/gui/macosx/library/audio-library/VLCLibraryCollectionViewAlbumSupplementaryDetailView.m
  16. 2
      modules/gui/macosx/library/audio-library/VLCLibrarySongTableCellView.m
  17. 2
      modules/gui/macosx/library/media-source/VLCMediaSourceBaseDataSource.m
  18. 4
      modules/gui/macosx/library/media-source/VLCMediaSourceCollectionViewItem.m
  19. 4
      modules/gui/macosx/library/media-source/VLCMediaSourceDataSource.m
  20. 2
      modules/gui/macosx/library/video-library/VLCLibraryVideoCollectionViewContainerViewDataSource.m
  21. 2
      modules/gui/macosx/main/VLCMain.h
  22. 4
      modules/gui/macosx/main/VLCMain.m
  23. 34
      modules/gui/macosx/menus/VLCMainMenu.m
  24. 16
      modules/gui/macosx/menus/VLCStatusBarIcon.m
  25. 2
      modules/gui/macosx/menus/renderers/VLCRendererMenuController.m
  26. 6
      modules/gui/macosx/os-integration/VLCClickerManager.m
  27. 2
      modules/gui/macosx/os-integration/VLCRemoteControlService.m
  28. 58
      modules/gui/macosx/os-integration/applescript.m
  29. 4
      modules/gui/macosx/panels/VLCAudioEffectsWindowController.m
  30. 2
      modules/gui/macosx/panels/VLCBookmarksWindowController.m
  31. 2
      modules/gui/macosx/panels/VLCInformationWindowController.m
  32. 4
      modules/gui/macosx/panels/VLCTrackSynchronizationWindowController.m
  33. 12
      modules/gui/macosx/panels/VLCVideoEffectsWindowController.m
  34. 2
      modules/gui/macosx/panels/dialogs/VLCResumeDialogController.m
  35. 4
      modules/gui/macosx/playlist/VLCPlaybackContinuityController.m
  36. 4
      modules/gui/macosx/playlist/VLCPlaylistMenuController.m
  37. 2
      modules/gui/macosx/playlist/VLCPlaylistSortingMenuController.m
  38. 4
      modules/gui/macosx/playlist/VLCPlaylistTableView.m
  39. 2
      modules/gui/macosx/preferences/VLCHotkeyChangeWindow.m
  40. 8
      modules/gui/macosx/preferences/VLCSimplePrefsController.m
  41. 2
      modules/gui/macosx/preferences/VLCSimplePrefsWindow.m
  42. 4
      modules/gui/macosx/preferences/prefs.m
  43. 2
      modules/gui/macosx/views/VLCTimeField.m
  44. 2
      modules/gui/macosx/windows/VLCDetachedAudioWindow.m
  45. 2
      modules/gui/macosx/windows/VLCOpenWindowController.m
  46. 2
      modules/gui/macosx/windows/convertandsave/VLCConvertAndSaveWindowController.m
  47. 2
      modules/gui/macosx/windows/mainwindow/VLCControlsBarCommon.m
  48. 4
      modules/gui/macosx/windows/mainwindow/VLCMainWindowControlsBar.m
  49. 24
      modules/gui/macosx/windows/video/VLCVideoOutputProvider.m
  50. 12
      modules/gui/macosx/windows/video/VLCVideoWindowCommon.m
  51. 6
      modules/gui/macosx/windows/video/VLCVoutView.m

8
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;
}

4
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;

6
modules/gui/macosx/library/VLCLibraryCollectionViewItem.m

@ -187,7 +187,7 @@ const CGFloat VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95;
- (void)setRepresentedItem:(id<VLCMediaLibraryItemProtocol>)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) {

4
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];

2
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;
}

2
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];
}

2
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;
}

2
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

10
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];

6
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"];

4
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];

8
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<VLCMediaLibraryItemProtocol> 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<VLCMediaLibraryAudioGroupProtocol> 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;

2
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;

2
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;

4
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) {

2
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;

2
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];
}

4
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

4
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];
}
}

2
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;

2
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;

4
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];
}

34
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

16
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;
}

2
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];

6
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];

2
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];

58
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

4
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];
}
}

2
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];
}
}

2
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];
}
}

4
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];

12
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]);

2
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];
}

4
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;
}

4
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];

2
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;
}

4
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:

2
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

8
modules/gui/macosx/preferences/VLCSimplePrefsController.m

@ -305,7 +305,7 @@ create_toolbar_item(NSString *itemIdent, NSString *name, NSString *desc, NSStrin
static NSArray<NSString *> *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];

2
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

4
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

2
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;
}

2
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;

2
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

2
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)];

2
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];

4
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 -

24
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)}];

12
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")];

6
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];
}

Loading…
Cancel
Save