Browse Source

macosx: Use dot notation to acces NSNotificationCenter defaultCenter

Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
pull/162/head
Claudio Cambra 3 years ago
committed by Jean-Baptiste Kempf
parent
commit
0bbcf88691
  1. 6
      modules/gui/macosx/library/VLCInputItem.m
  2. 4
      modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
  3. 4
      modules/gui/macosx/library/VLCLibraryController.m
  4. 2
      modules/gui/macosx/library/VLCLibraryModel.m
  5. 10
      modules/gui/macosx/library/VLCLibraryWindow.m
  6. 2
      modules/gui/macosx/library/audio-library/VLCLibraryAlbumTableCellView.m
  7. 2
      modules/gui/macosx/library/audio-library/VLCLibraryAudioViewController.m
  8. 4
      modules/gui/macosx/library/audio-library/VLCLibrarySongsTableViewSongPlayingTableCellView.m
  9. 14
      modules/gui/macosx/library/media-source/VLCMediaSource.m
  10. 2
      modules/gui/macosx/library/media-source/VLCMediaSourceBaseDataSource.m
  11. 2
      modules/gui/macosx/library/media-source/VLCMediaSourceCollectionViewItem.m
  12. 2
      modules/gui/macosx/library/video-library/VLCLibraryVideoCollectionViewContainerView.m
  13. 2
      modules/gui/macosx/library/video-library/VLCLibraryVideoCollectionViewContainerViewDataSource.m
  14. 2
      modules/gui/macosx/library/video-library/VLCLibraryVideoTableViewDataSource.m
  15. 2
      modules/gui/macosx/library/video-library/VLCLibraryVideoViewController.m
  16. 4
      modules/gui/macosx/main/VLCApplication.m
  17. 2
      modules/gui/macosx/main/VLCMain.m
  18. 4
      modules/gui/macosx/menus/VLCMainMenu.m
  19. 4
      modules/gui/macosx/menus/VLCStatusBarIcon.m
  20. 4
      modules/gui/macosx/os-integration/VLCClickerManager.m
  21. 4
      modules/gui/macosx/os-integration/VLCRemoteControlService.m
  22. 4
      modules/gui/macosx/panels/VLCAudioEffectsWindowController.m
  23. 4
      modules/gui/macosx/panels/VLCBookmarksWindowController.m
  24. 4
      modules/gui/macosx/panels/VLCInformationWindowController.m
  25. 4
      modules/gui/macosx/panels/VLCTrackSynchronizationWindowController.m
  26. 4
      modules/gui/macosx/panels/VLCVideoEffectsWindowController.m
  27. 4
      modules/gui/macosx/panels/dialogs/VLCResumeDialogController.m
  28. 4
      modules/gui/macosx/playlist/VLCPlaybackContinuityController.m
  29. 2
      modules/gui/macosx/playlist/VLCPlayerController.m
  30. 2
      modules/gui/macosx/playlist/VLCPlaylistController.m
  31. 2
      modules/gui/macosx/playlist/VLCPlaylistTableCellView.m
  32. 6
      modules/gui/macosx/preferences/VLCSimplePrefsController.m
  33. 2
      modules/gui/macosx/preferences/prefs.m
  34. 8
      modules/gui/macosx/preferences/prefs_widgets.m
  35. 2
      modules/gui/macosx/views/VLCCustomWindowButton.m
  36. 2
      modules/gui/macosx/windows/VLCAboutWindowController.m
  37. 4
      modules/gui/macosx/windows/VLCDetachedAudioWindow.m
  38. 8
      modules/gui/macosx/windows/VLCOpenWindowController.m
  39. 2
      modules/gui/macosx/windows/addons/VLCAddonsWindowController.m
  40. 20
      modules/gui/macosx/windows/convertandsave/VLCOutput.m
  41. 4
      modules/gui/macosx/windows/extensions/VLCExtensionsDialogProvider.m
  42. 4
      modules/gui/macosx/windows/mainwindow/VLCControlsBarCommon.m
  43. 2
      modules/gui/macosx/windows/mainwindow/VLCMainVideoViewControlsBar.m
  44. 2
      modules/gui/macosx/windows/mainwindow/VLCMainWindowControlsBar.m
  45. 2
      modules/gui/macosx/windows/video/VLCFullVideoViewWindow.m
  46. 2
      modules/gui/macosx/windows/video/VLCMainVideoViewController.m
  47. 2
      modules/gui/macosx/windows/video/VLCVideoOutputProvider.m
  48. 8
      modules/gui/macosx/windows/video/VLCVideoWindowCommon.m
  49. 2
      modules/gui/macosx/windows/video/VLCVoutView.m
  50. 2
      modules/notify/osx_notifications.m
  51. 4
      modules/video_output/macosx.m

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

@ -518,7 +518,7 @@ static const struct vlc_metadata_cbs preparseCallbacks = {
- (void)parsingEnded:(int)status - (void)parsingEnded:(int)status
{ {
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; NSNotificationCenter *notificationCenter = NSNotificationCenter.defaultCenter;
if (status) { if (status) {
[notificationCenter postNotificationName:VLCInputItemParsingSucceeded object:self]; [notificationCenter postNotificationName:VLCInputItemParsingSucceeded object:self];
} else { } else {
@ -546,7 +546,7 @@ static const struct vlc_metadata_cbs preparseCallbacks = {
- (void)preparsingEnded:(enum input_item_preparse_status)status - (void)preparsingEnded:(enum input_item_preparse_status)status
{ {
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; NSNotificationCenter *notificationCenter = NSNotificationCenter.defaultCenter;
switch (status) { switch (status) {
case ITEM_PREPARSE_SKIPPED: case ITEM_PREPARSE_SKIPPED:
[notificationCenter postNotificationName:VLCInputItemPreparsingSkipped object:self]; [notificationCenter postNotificationName:VLCInputItemPreparsingSkipped object:self];
@ -582,7 +582,7 @@ static const struct vlc_metadata_cbs preparseCallbacks = {
- (void)subTreeAdded:(input_item_node_t *)p_node - (void)subTreeAdded:(input_item_node_t *)p_node
{ {
_subTree = p_node; _subTree = p_node;
[[NSNotificationCenter defaultCenter] postNotificationName:VLCInputItemSubtreeAdded object:self]; [NSNotificationCenter.defaultCenter postNotificationName:VLCInputItemSubtreeAdded object:self];
} }
- (int)writeMetadataToFile - (int)writeMetadataToFile

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

@ -94,7 +94,7 @@ const CGFloat VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95;
{ {
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) { if (self) {
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; NSNotificationCenter *notificationCenter = NSNotificationCenter.defaultCenter;
[notificationCenter addObserver:self [notificationCenter addObserver:self
selector:@selector(mediaItemThumbnailGenerated:) selector:@selector(mediaItemThumbnailGenerated:)
name:VLCLibraryModelMediaItemThumbnailGenerated name:VLCLibraryModelMediaItemThumbnailGenerated
@ -105,7 +105,7 @@ const CGFloat VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95;
- (void)dealloc - (void)dealloc
{ {
[[NSNotificationCenter defaultCenter] removeObserver:self]; [NSNotificationCenter.defaultCenter removeObserver:self];
if (@available(macOS 10.14, *)) { if (@available(macOS 10.14, *)) {
[NSApplication.sharedApplication removeObserver:self forKeyPath:@"effectiveAppearance"]; [NSApplication.sharedApplication removeObserver:self forKeyPath:@"effectiveAppearance"];
} }

4
modules/gui/macosx/library/VLCLibraryController.m

@ -50,7 +50,7 @@
_libraryModel = [[VLCLibraryModel alloc] initWithLibrary:_p_libraryInstance]; _libraryModel = [[VLCLibraryModel alloc] initWithLibrary:_p_libraryInstance];
_unsorted = YES; _unsorted = YES;
NSNotificationCenter *defaultNotificationCenter = [NSNotificationCenter defaultCenter]; NSNotificationCenter *defaultNotificationCenter = NSNotificationCenter.defaultCenter;
[defaultNotificationCenter addObserver:self [defaultNotificationCenter addObserver:self
selector:@selector(playbackStateChanged:) selector:@selector(playbackStateChanged:)
name:VLCPlayerStateChanged name:VLCPlayerStateChanged
@ -61,7 +61,7 @@
- (void)dealloc - (void)dealloc
{ {
[[NSNotificationCenter defaultCenter] removeObserver:self]; [NSNotificationCenter.defaultCenter removeObserver:self];
_p_libraryInstance = NULL; _p_libraryInstance = NULL;
} }

2
modules/gui/macosx/library/VLCLibraryModel.m

@ -192,7 +192,7 @@ static void libraryCallback(void *p_data, const vlc_ml_event_t *p_event)
_artistCacheModificationQueue = dispatch_queue_create("artistCacheModificationQueue", 0); _artistCacheModificationQueue = dispatch_queue_create("artistCacheModificationQueue", 0);
_genreCacheModificationQueue = dispatch_queue_create("genreCacheModificationQueue", 0); _genreCacheModificationQueue = dispatch_queue_create("genreCacheModificationQueue", 0);
_defaultNotificationCenter = [NSNotificationCenter defaultCenter]; _defaultNotificationCenter = NSNotificationCenter.defaultCenter;
[_defaultNotificationCenter addObserver:self [_defaultNotificationCenter addObserver:self
selector:@selector(applicationWillTerminate:) selector:@selector(applicationWillTerminate:)
name:NSApplicationWillTerminateNotification name:NSApplicationWillTerminateNotification

10
modules/gui/macosx/library/VLCLibraryWindow.m

@ -97,7 +97,7 @@ static int ShowFullscreenController(vlc_object_t *p_this, const char *psz_variab
{ {
@autoreleasepool { @autoreleasepool {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
[[NSNotificationCenter defaultCenter] postNotificationName:VLCVideoWindowShouldShowFullscreenController [NSNotificationCenter.defaultCenter postNotificationName:VLCVideoWindowShouldShowFullscreenController
object:nil]; object:nil];
}); });
@ -110,7 +110,7 @@ static int ShowController(vlc_object_t *p_this, const char *psz_variable,
{ {
@autoreleasepool { @autoreleasepool {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
[[NSNotificationCenter defaultCenter] postNotificationName:VLCWindowShouldShowController [NSNotificationCenter.defaultCenter postNotificationName:VLCWindowShouldShowController
object:nil]; object:nil];
}); });
@ -167,7 +167,7 @@ static void addShadow(NSImageView *__unsafe_unretained imageView)
[self.librarySortButton setHidden:NO]; [self.librarySortButton setHidden:NO];
[self.librarySearchField setEnabled:YES]; [self.librarySearchField setEnabled:YES];
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; NSNotificationCenter *notificationCenter = NSNotificationCenter.defaultCenter;
[notificationCenter addObserver:self [notificationCenter addObserver:self
selector:@selector(shouldShowController:) selector:@selector(shouldShowController:)
name:VLCWindowShouldShowController name:VLCWindowShouldShowController
@ -256,7 +256,7 @@ static void addShadow(NSImageView *__unsafe_unretained imageView)
- (void)dealloc - (void)dealloc
{ {
[[NSNotificationCenter defaultCenter] removeObserver:self]; [NSNotificationCenter.defaultCenter removeObserver:self];
if (@available(macOS 10.14, *)) { if (@available(macOS 10.14, *)) {
[NSApplication.sharedApplication removeObserver:self forKeyPath:@"effectiveAppearance"]; [NSApplication.sharedApplication removeObserver:self forKeyPath:@"effectiveAppearance"];
} }
@ -928,7 +928,7 @@ static void addShadow(NSImageView *__unsafe_unretained imageView)
NSRect videoViewRect = [videoView convertRect:videoView.frame toView:self.contentView]; NSRect videoViewRect = [videoView convertRect:videoView.frame toView:self.contentView];
if ([self.contentView mouse:mouseLocation inRect:videoViewRect]) { if ([self.contentView mouse:mouseLocation inRect:videoViewRect]) {
[[NSNotificationCenter defaultCenter] postNotificationName:VLCVideoWindowShouldShowFullscreenController [NSNotificationCenter.defaultCenter postNotificationName:VLCVideoWindowShouldShowFullscreenController
object:self]; object:self];
} }
} }

2
modules/gui/macosx/library/audio-library/VLCLibraryAlbumTableCellView.m

@ -173,7 +173,7 @@ const CGFloat VLCLibraryAlbumTableCellViewDefaultHeight = 168.;
[self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:horizontalVisualConstraints options:0 metrics:0 views:dict]]; [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:horizontalVisualConstraints options:0 metrics:0 views:dict]];
[self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:verticalVisualContraints options:0 metrics:0 views:dict]]; [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:verticalVisualContraints options:0 metrics:0 views:dict]];
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; NSNotificationCenter *notificationCenter = NSNotificationCenter.defaultCenter;
[notificationCenter addObserver:self [notificationCenter addObserver:self
selector:@selector(handleTableViewSelectionIsChanging:) selector:@selector(handleTableViewSelectionIsChanging:)
name:NSTableViewSelectionIsChangingNotification name:NSTableViewSelectionIsChangingNotification

2
modules/gui/macosx/library/audio-library/VLCLibraryAudioViewController.m

@ -84,7 +84,7 @@ NSString *VLCLibraryPlaceholderAudioViewIdentifier = @"VLCLibraryPlaceholderAudi
[self setupAudioSegmentedControl]; [self setupAudioSegmentedControl];
[self setupAudioLibraryViews]; [self setupAudioLibraryViews];
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; NSNotificationCenter *notificationCenter = NSNotificationCenter.defaultCenter;
[notificationCenter addObserver:self [notificationCenter addObserver:self
selector:@selector(libraryModelUpdated:) selector:@selector(libraryModelUpdated:)
name:VLCLibraryModelAudioMediaListReset name:VLCLibraryModelAudioMediaListReset

4
modules/gui/macosx/library/audio-library/VLCLibrarySongsTableViewSongPlayingTableCellView.m

@ -32,7 +32,7 @@
- (void)awakeFromNib - (void)awakeFromNib
{ {
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; NSNotificationCenter *notificationCenter = NSNotificationCenter.defaultCenter;
[notificationCenter addObserver:self [notificationCenter addObserver:self
selector:@selector(playStateOrItemChanged:) selector:@selector(playStateOrItemChanged:)
name:VLCPlayerCurrentMediaItemChanged name:VLCPlayerCurrentMediaItemChanged
@ -45,7 +45,7 @@
- (void)dealloc - (void)dealloc
{ {
[[NSNotificationCenter defaultCenter] removeObserver:self]; [NSNotificationCenter.defaultCenter removeObserver:self];
} }
- (void)prepareForReuse - (void)prepareForReuse

14
modules/gui/macosx/library/media-source/VLCMediaSource.m

@ -46,7 +46,7 @@ static void cb_children_reset(vlc_media_tree_t *p_tree,
{ {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
VLCMediaSource *mediaSource = (__bridge VLCMediaSource *)p_data; VLCMediaSource *mediaSource = (__bridge VLCMediaSource *)p_data;
[[NSNotificationCenter defaultCenter] postNotificationName:VLCMediaSourceChildrenReset [NSNotificationCenter.defaultCenter postNotificationName:VLCMediaSourceChildrenReset
object:mediaSource]; object:mediaSource];
}); });
} }
@ -59,7 +59,7 @@ static void cb_children_added(vlc_media_tree_t *p_tree,
{ {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
VLCMediaSource *mediaSource = (__bridge VLCMediaSource *)p_data; VLCMediaSource *mediaSource = (__bridge VLCMediaSource *)p_data;
[[NSNotificationCenter defaultCenter] postNotificationName:VLCMediaSourceChildrenAdded [NSNotificationCenter.defaultCenter postNotificationName:VLCMediaSourceChildrenAdded
object:mediaSource]; object:mediaSource];
}); });
} }
@ -72,7 +72,7 @@ static void cb_children_removed(vlc_media_tree_t *p_tree,
{ {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
VLCMediaSource *mediaSource = (__bridge VLCMediaSource *)p_data; VLCMediaSource *mediaSource = (__bridge VLCMediaSource *)p_data;
[[NSNotificationCenter defaultCenter] postNotificationName:VLCMediaSourceChildrenRemoved [NSNotificationCenter.defaultCenter postNotificationName:VLCMediaSourceChildrenRemoved
object:mediaSource]; object:mediaSource];
}); });
} }
@ -84,7 +84,7 @@ static void cb_preparse_ended(vlc_media_tree_t *p_tree,
{ {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
VLCMediaSource *mediaSource = (__bridge VLCMediaSource *)p_data; VLCMediaSource *mediaSource = (__bridge VLCMediaSource *)p_data;
[[NSNotificationCenter defaultCenter] postNotificationName:VLCMediaSourcePreparsingEnded [NSNotificationCenter.defaultCenter postNotificationName:VLCMediaSourcePreparsingEnded
object:mediaSource]; object:mediaSource];
}); });
} }
@ -275,7 +275,7 @@ static const char *const localDevicesDescription = "My Machine";
} }
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
[[NSNotificationCenter defaultCenter] postNotificationName:VLCMediaSourceChildrenReset object:self]; [NSNotificationCenter.defaultCenter postNotificationName:VLCMediaSourceChildrenReset object:self];
if (!self->_respondsToDiskChanges) { if (!self->_respondsToDiskChanges) {
// We register the notifications here, as they are retrieved from the OS. // We register the notifications here, as they are retrieved from the OS.
@ -399,7 +399,7 @@ static const char *const localDevicesDescription = "My Machine";
} }
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
[[NSNotificationCenter defaultCenter] postNotificationName:VLCMediaSourceChildrenAdded [NSNotificationCenter.defaultCenter postNotificationName:VLCMediaSourceChildrenAdded
object:self]; object:self];
}); });
}); });
@ -442,7 +442,7 @@ static const char *const localDevicesDescription = "My Machine";
input_item_node_Delete(nodeToRemove); input_item_node_Delete(nodeToRemove);
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
[[NSNotificationCenter defaultCenter] postNotificationName:VLCMediaSourceChildrenRemoved [NSNotificationCenter.defaultCenter postNotificationName:VLCMediaSourceChildrenRemoved
object:self]; object:self];
}); });

2
modules/gui/macosx/library/media-source/VLCMediaSourceBaseDataSource.m

@ -85,7 +85,7 @@ NSString *VLCMediaSourceTableViewCellIdentifier = @"VLCMediaSourceTableViewCellI
- (void)dealloc - (void)dealloc
{ {
[[NSNotificationCenter defaultCenter] removeObserver:self]; [NSNotificationCenter.defaultCenter removeObserver:self];
} }
#pragma mark - view and model state management #pragma mark - view and model state management

2
modules/gui/macosx/library/media-source/VLCMediaSourceCollectionViewItem.m

@ -52,7 +52,7 @@ NSString *VLCMediaSourceCellIdentifier = @"VLCLibraryCellIdentifier";
- (void)dealloc - (void)dealloc
{ {
[[NSNotificationCenter defaultCenter] removeObserver:self]; [NSNotificationCenter.defaultCenter removeObserver:self];
if (@available(macOS 10.14, *)) { if (@available(macOS 10.14, *)) {
[NSApplication.sharedApplication removeObserver:self forKeyPath:@"effectiveAppearance"]; [NSApplication.sharedApplication removeObserver:self forKeyPath:@"effectiveAppearance"];
} }

2
modules/gui/macosx/library/video-library/VLCLibraryVideoCollectionViewContainerView.m

@ -143,7 +143,7 @@
- (void)setupCollectionViewSizeChangeListener - (void)setupCollectionViewSizeChangeListener
{ {
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; NSNotificationCenter *notificationCenter = NSNotificationCenter.defaultCenter;
[notificationCenter addObserver:self [notificationCenter addObserver:self
selector:@selector(collectionViewFrameChanged:) selector:@selector(collectionViewFrameChanged:)
name:NSViewFrameDidChangeNotification name:NSViewFrameDidChangeNotification

2
modules/gui/macosx/library/video-library/VLCLibraryVideoCollectionViewContainerViewDataSource.m

@ -50,7 +50,7 @@
{ {
self = [super init]; self = [super init];
if(self) { if(self) {
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; NSNotificationCenter *notificationCenter = NSNotificationCenter.defaultCenter;
[notificationCenter addObserver:self [notificationCenter addObserver:self
selector:@selector(libraryModelVideoListReset:) selector:@selector(libraryModelVideoListReset:)
name:VLCLibraryModelVideoMediaListReset name:VLCLibraryModelVideoMediaListReset

2
modules/gui/macosx/library/video-library/VLCLibraryVideoTableViewDataSource.m

@ -52,7 +52,7 @@
{ {
self = [super init]; self = [super init];
if(self) { if(self) {
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; NSNotificationCenter *notificationCenter = NSNotificationCenter.defaultCenter;
[notificationCenter addObserver:self [notificationCenter addObserver:self
selector:@selector(libraryModelVideoListReset:) selector:@selector(libraryModelVideoListReset:)
name:VLCLibraryModelVideoMediaListReset name:VLCLibraryModelVideoMediaListReset

2
modules/gui/macosx/library/video-library/VLCLibraryVideoViewController.m

@ -66,7 +66,7 @@
[self setupVideoPlaceholderView]; [self setupVideoPlaceholderView];
[self setupVideoLibraryViews]; [self setupVideoLibraryViews];
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; NSNotificationCenter *notificationCenter = NSNotificationCenter.defaultCenter;
[notificationCenter addObserver:self [notificationCenter addObserver:self
selector:@selector(libraryModelUpdated:) selector:@selector(libraryModelUpdated:)
name:VLCLibraryModelVideoMediaListReset name:VLCLibraryModelVideoMediaListReset

4
modules/gui/macosx/main/VLCApplication.m

@ -50,7 +50,7 @@
{ {
self = [super init]; self = [super init];
if (self) { if (self) {
[[NSNotificationCenter defaultCenter] addObserver:self [NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(appBecameActive:) selector:@selector(appBecameActive:)
name:NSApplicationDidBecomeActiveNotification name:NSApplicationDidBecomeActiveNotification
object:nil]; object:nil];
@ -64,7 +64,7 @@
- (void)dealloc - (void)dealloc
{ {
[[NSNotificationCenter defaultCenter] removeObserver:self]; [NSNotificationCenter.defaultCenter removeObserver:self];
} }
- (NSImage *)vlcAppIconImage - (NSImage *)vlcAppIconImage

2
modules/gui/macosx/main/VLCMain.m

@ -302,7 +302,7 @@ static VLCMain *sharedInstance = nil;
return; return;
_interfaceIsTerminating = true; _interfaceIsTerminating = true;
NSNotificationCenter *notiticationCenter = [NSNotificationCenter defaultCenter]; NSNotificationCenter *notiticationCenter = NSNotificationCenter.defaultCenter;
if (notification == nil) { if (notification == nil) {
[notiticationCenter postNotificationName: NSApplicationWillTerminateNotification object: nil]; [notiticationCenter postNotificationName: NSApplicationWillTerminateNotification object: nil];
} }

4
modules/gui/macosx/menus/VLCMainMenu.m

@ -120,7 +120,7 @@ typedef NS_ENUM(NSInteger, VLCObjectType) {
- (void)dealloc - (void)dealloc
{ {
msg_Dbg(getIntf(), "Deinitializing main menu"); msg_Dbg(getIntf(), "Deinitializing main menu");
[[NSNotificationCenter defaultCenter] removeObserver: self]; [NSNotificationCenter.defaultCenter removeObserver: self];
[self releaseRepresentedObjects:[NSApp mainMenu]]; [self releaseRepresentedObjects:[NSApp mainMenu]];
} }
@ -166,7 +166,7 @@ typedef NS_ENUM(NSInteger, VLCObjectType) {
[self updateTitleAndChapterMenus:nil]; [self updateTitleAndChapterMenus:nil];
[self updateProgramMenu:nil]; [self updateProgramMenu:nil];
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; NSNotificationCenter *notificationCenter = NSNotificationCenter.defaultCenter;
[notificationCenter addObserver:self [notificationCenter addObserver:self
selector:@selector(refreshVoutDeviceMenu:) selector:@selector(refreshVoutDeviceMenu:)
name:NSApplicationDidChangeScreenParametersNotification name:NSApplicationDidChangeScreenParametersNotification

4
modules/gui/macosx/menus/VLCStatusBarIcon.m

@ -107,7 +107,7 @@
[_vlcStatusBarIconMenu setDelegate:self]; [_vlcStatusBarIconMenu setDelegate:self];
// Register notifications // Register notifications
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; NSNotificationCenter *notificationCenter = NSNotificationCenter.defaultCenter;
[notificationCenter addObserver:self [notificationCenter addObserver:self
selector:@selector(updateTimeAndPosition:) selector:@selector(updateTimeAndPosition:)
name:VLCPlayerTimeAndPositionChanged name:VLCPlayerTimeAndPositionChanged
@ -213,7 +213,7 @@
} }
// Cleanup // Cleanup
[[NSNotificationCenter defaultCenter] removeObserver:self]; [NSNotificationCenter.defaultCenter removeObserver:self];
} }
#pragma mark - #pragma mark -

4
modules/gui/macosx/os-integration/VLCClickerManager.m

@ -56,7 +56,7 @@
if (self) { if (self) {
_playlistController = VLCMain.sharedInstance.playlistController; _playlistController = VLCMain.sharedInstance.playlistController;
_playerController = [_playlistController playerController]; _playerController = [_playlistController playerController];
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; NSNotificationCenter *notificationCenter = NSNotificationCenter.defaultCenter;
/* init media key support */ /* init media key support */
b_mediaKeySupport = var_InheritBool(getIntf(), "macosx-mediakeys"); b_mediaKeySupport = var_InheritBool(getIntf(), "macosx-mediakeys");
@ -96,7 +96,7 @@
{ {
_mediaKeyController = nil; _mediaKeyController = nil;
_remote = nil; _remote = nil;
[[NSNotificationCenter defaultCenter] removeObserver:self]; [NSNotificationCenter.defaultCenter removeObserver:self];
} }
#pragma mark - #pragma mark -

4
modules/gui/macosx/os-integration/VLCRemoteControlService.m

@ -70,7 +70,7 @@ static inline NSArray * RemoteCommandCenterCommandsToHandle()
_playlistController = VLCMain.sharedInstance.playlistController; _playlistController = VLCMain.sharedInstance.playlistController;
_playerController = [_playlistController playerController]; _playerController = [_playlistController playerController];
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; NSNotificationCenter *notificationCenter = NSNotificationCenter.defaultCenter;
[notificationCenter addObserver:self [notificationCenter addObserver:self
selector:@selector(playbackPositionUpdated:) selector:@selector(playbackPositionUpdated:)
name:VLCPlayerTimeAndPositionChanged name:VLCPlayerTimeAndPositionChanged
@ -97,7 +97,7 @@ static inline NSArray * RemoteCommandCenterCommandsToHandle()
- (void)dealloc - (void)dealloc
{ {
[[NSNotificationCenter defaultCenter] removeObserver:self]; [NSNotificationCenter.defaultCenter removeObserver:self];
} }
- (void)playbackStateChanged:(NSNotification *)aNotification - (void)playbackStateChanged:(NSNotification *)aNotification

4
modules/gui/macosx/panels/VLCAudioEffectsWindowController.m

@ -221,7 +221,7 @@ static inline void enableTextField(NSTextField *const __unsafe_unretained textFi
- (void)windowDidLoad - (void)windowDidLoad
{ {
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; NSNotificationCenter *notificationCenter = NSNotificationCenter.defaultCenter;
[notificationCenter addObserver:self [notificationCenter addObserver:self
selector:@selector(updateCocoaWindowLevel:) selector:@selector(updateCocoaWindowLevel:)
name:VLCWindowShouldUpdateLevel name:VLCWindowShouldUpdateLevel
@ -319,7 +319,7 @@ static inline void enableTextField(NSTextField *const __unsafe_unretained textFi
- (void)dealloc - (void)dealloc
{ {
[[NSNotificationCenter defaultCenter] removeObserver:self]; [NSNotificationCenter.defaultCenter removeObserver:self];
} }
#pragma mark - #pragma mark -

4
modules/gui/macosx/panels/VLCBookmarksWindowController.m

@ -55,7 +55,7 @@
{ {
self = [super initWithWindowNibName:@"Bookmarks"]; self = [super initWithWindowNibName:@"Bookmarks"];
if (self) { if (self) {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateCocoaWindowLevel:) name:VLCWindowShouldUpdateLevel object:nil]; [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(updateCocoaWindowLevel:) name:VLCWindowShouldUpdateLevel object:nil];
} }
return self; return self;
} }
@ -65,7 +65,7 @@
//if (p_old_input) //if (p_old_input)
// input_Release(p_old_input); // input_Release(p_old_input);
[[NSNotificationCenter defaultCenter] removeObserver:self]; [NSNotificationCenter.defaultCenter removeObserver:self];
} }
- (void)windowDidLoad - (void)windowDidLoad

4
modules/gui/macosx/panels/VLCInformationWindowController.m

@ -71,7 +71,7 @@
- (void)dealloc - (void)dealloc
{ {
[[NSNotificationCenter defaultCenter] removeObserver:self]; [NSNotificationCenter.defaultCenter removeObserver:self];
} }
- (void)awakeFromNib - (void)awakeFromNib
@ -82,7 +82,7 @@
_outlineView.dataSource = self; _outlineView.dataSource = self;
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; NSNotificationCenter *notificationCenter = NSNotificationCenter.defaultCenter;
if (_mainMenuInstance) { if (_mainMenuInstance) {
[notificationCenter addObserver:self [notificationCenter addObserver:self
selector:@selector(currentPlayingItemChanged:) selector:@selector(currentPlayingItemChanged:)

4
modules/gui/macosx/panels/VLCTrackSynchronizationWindowController.m

@ -52,13 +52,13 @@
- (void)dealloc - (void)dealloc
{ {
[[NSNotificationCenter defaultCenter] removeObserver:self]; [NSNotificationCenter.defaultCenter removeObserver:self];
} }
- (void)windowDidLoad - (void)windowDidLoad
{ {
_playerController = VLCMain.sharedInstance.playlistController.playerController; _playerController = VLCMain.sharedInstance.playlistController.playerController;
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; NSNotificationCenter *notificationCenter = NSNotificationCenter.defaultCenter;
[notificationCenter addObserver:self [notificationCenter addObserver:self
selector:@selector(updateValues:) selector:@selector(updateValues:)
name:VLCPlayerCurrentMediaItemChanged name:VLCPlayerCurrentMediaItemChanged

4
modules/gui/macosx/panels/VLCVideoEffectsWindowController.m

@ -82,7 +82,7 @@ NSString *VLCVideoEffectsProfileNamesKey = @"VideoEffectProfileNames";
self = [super initWithWindowNibName:@"VideoEffects"]; self = [super initWithWindowNibName:@"VideoEffects"];
if (self) { if (self) {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; NSNotificationCenter *notificationCenter = NSNotificationCenter.defaultCenter;
[notificationCenter addObserver:self [notificationCenter addObserver:self
selector:@selector(updateCocoaWindowLevel:) selector:@selector(updateCocoaWindowLevel:)
name:VLCWindowShouldUpdateLevel name:VLCWindowShouldUpdateLevel
@ -348,7 +348,7 @@ NSString *VLCVideoEffectsProfileNamesKey = @"VideoEffectProfileNames";
- (void)dealloc - (void)dealloc
{ {
[[NSNotificationCenter defaultCenter] removeObserver:self]; [NSNotificationCenter.defaultCenter removeObserver:self];
} }
- (void)updateCocoaWindowLevel:(NSNotification *)aNotification - (void)updateCocoaWindowLevel:(NSNotification *)aNotification

4
modules/gui/macosx/panels/dialogs/VLCResumeDialogController.m

@ -48,7 +48,7 @@
{ {
self = [super initWithWindowNibName:@"ResumeDialog"]; self = [super initWithWindowNibName:@"ResumeDialog"];
if (self) { if (self) {
[[NSNotificationCenter defaultCenter] addObserver:self [NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(updateCocoaWindowLevel:) selector:@selector(updateCocoaWindowLevel:)
name:VLCWindowShouldUpdateLevel name:VLCWindowShouldUpdateLevel
object:nil]; object:nil];
@ -58,7 +58,7 @@
- (void)dealloc - (void)dealloc
{ {
[[NSNotificationCenter defaultCenter] removeObserver:self]; [NSNotificationCenter.defaultCenter removeObserver:self];
} }
- (void)windowDidLoad - (void)windowDidLoad

4
modules/gui/macosx/playlist/VLCPlaybackContinuityController.m

@ -66,7 +66,7 @@ static NSString *VLCRecentlyPlayedMediaListKey = @"recentlyPlayedMediaList";
{ {
self = [super init]; self = [super init];
if (self) { if (self) {
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; NSNotificationCenter *notificationCenter = NSNotificationCenter.defaultCenter;
[notificationCenter addObserver:self [notificationCenter addObserver:self
selector:@selector(inputItemChanged:) selector:@selector(inputItemChanged:)
name:VLCPlayerCurrentMediaItemChanged name:VLCPlayerCurrentMediaItemChanged
@ -83,7 +83,7 @@ static NSString *VLCRecentlyPlayedMediaListKey = @"recentlyPlayedMediaList";
{ {
msg_Dbg(getIntf(), "Deinitializing input manager"); msg_Dbg(getIntf(), "Deinitializing input manager");
[[NSNotificationCenter defaultCenter] removeObserver:self]; [NSNotificationCenter.defaultCenter removeObserver:self];
if (_currentInput) { if (_currentInput) {
/* continue playback where you left off */ /* continue playback where you left off */

2
modules/gui/macosx/playlist/VLCPlayerController.m

@ -585,7 +585,7 @@ static int BossCallback(vlc_object_t *p_this,
{ {
self = [super init]; self = [super init];
if (self) { if (self) {
_defaultNotificationCenter = [NSNotificationCenter defaultCenter]; _defaultNotificationCenter = NSNotificationCenter.defaultCenter;
[_defaultNotificationCenter addObserver:self [_defaultNotificationCenter addObserver:self
selector:@selector(applicationWillTerminate:) selector:@selector(applicationWillTerminate:)
name:NSApplicationWillTerminateNotification name:NSApplicationWillTerminateNotification

2
modules/gui/macosx/playlist/VLCPlaylistController.m

@ -216,7 +216,7 @@ static const struct vlc_playlist_callbacks playlist_callbacks = {
{ {
self = [super init]; self = [super init];
if (self) { if (self) {
_defaultNotificationCenter = [NSNotificationCenter defaultCenter]; _defaultNotificationCenter = NSNotificationCenter.defaultCenter;
[_defaultNotificationCenter addObserver:self [_defaultNotificationCenter addObserver:self
selector:@selector(applicationWillTerminate:) selector:@selector(applicationWillTerminate:)
name:NSApplicationWillTerminateNotification name:NSApplicationWillTerminateNotification

2
modules/gui/macosx/playlist/VLCPlaylistTableCellView.m

@ -41,7 +41,7 @@
- (void)dealloc - (void)dealloc
{ {
[[NSNotificationCenter defaultCenter] removeObserver:self]; [NSNotificationCenter.defaultCenter removeObserver:self];
} }
- (void)setRepresentsCurrentPlaylistItem:(BOOL)representsCurrentPlaylistItem - (void)setRepresentsCurrentPlaylistItem:(BOOL)representsCurrentPlaylistItem

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

@ -1106,7 +1106,7 @@ static inline void save_string_list(intf_thread_t * p_intf, id object, const cha
/* okay, let's save our changes to vlcrc */ /* okay, let's save our changes to vlcrc */
config_SaveConfigFile(p_intf); config_SaveConfigFile(p_intf);
[[NSNotificationCenter defaultCenter] postNotificationName:VLCConfigurationChangedNotification object:nil]; [NSNotificationCenter.defaultCenter postNotificationName:VLCConfigurationChangedNotification object:nil];
} }
- (void)showSettingsForCategory:(NSView *)categoryView - (void)showSettingsForCategory:(NSView *)categoryView
@ -1539,7 +1539,7 @@ static inline void save_string_list(intf_thread_t * p_intf, id object, const cha
_libraryController = VLCMain.sharedInstance.libraryController; _libraryController = VLCMain.sharedInstance.libraryController;
_libraryModel = _libraryController.libraryModel; _libraryModel = _libraryController.libraryModel;
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; NSNotificationCenter *notificationCenter = NSNotificationCenter.defaultCenter;
[notificationCenter addObserver:self [notificationCenter addObserver:self
selector:@selector(listOfMonitoredFoldersUpdated:) selector:@selector(listOfMonitoredFoldersUpdated:)
name:VLCLibraryModelListOfMonitoredFoldersUpdated name:VLCLibraryModelListOfMonitoredFoldersUpdated
@ -1550,7 +1550,7 @@ static inline void save_string_list(intf_thread_t * p_intf, id object, const cha
- (void)dealloc - (void)dealloc
{ {
[[NSNotificationCenter defaultCenter] removeObserver:self]; [NSNotificationCenter.defaultCenter removeObserver:self];
} }
- (void)listOfMonitoredFoldersUpdated:(NSNotification *)aNotification - (void)listOfMonitoredFoldersUpdated:(NSNotification *)aNotification

2
modules/gui/macosx/preferences/prefs.m

@ -218,7 +218,7 @@ enum VLCTreeBranchType {
[_rootTreeItem applyChanges]; [_rootTreeItem applyChanges];
fixIntfSettings(); fixIntfSettings();
config_SaveConfigFile(getIntf()); config_SaveConfigFile(getIntf());
[[NSNotificationCenter defaultCenter] postNotificationName:VLCConfigurationChangedNotification object:nil]; [NSNotificationCenter.defaultCenter postNotificationName:VLCConfigurationChangedNotification object:nil];
[self.window orderOut:self]; [self.window orderOut:self];
} }

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

@ -1359,7 +1359,7 @@ my_width, tooltip, init_value) \
1, 49, toolTip, @"") 1, 49, toolTip, @"")
[o_textfield setIntegerValue: p_item->value.i]; [o_textfield setIntegerValue: p_item->value.i];
[o_textfield setDelegate: self]; [o_textfield setDelegate: self];
[[NSNotificationCenter defaultCenter] addObserver: self [NSNotificationCenter.defaultCenter addObserver: self
selector: @selector(textfieldChanged:) selector: @selector(textfieldChanged:)
name: NSControlTextDidChangeNotification name: NSControlTextDidChangeNotification
object: o_textfield]; object: o_textfield];
@ -1539,7 +1539,7 @@ my_width, tooltip, init_value) \
[o_textfield setIntegerValue: p_item->value.i]; [o_textfield setIntegerValue: p_item->value.i];
[o_textfield setAutoresizingMask:NSViewMaxXMargin ]; [o_textfield setAutoresizingMask:NSViewMaxXMargin ];
[o_textfield setDelegate: self]; [o_textfield setDelegate: self];
[[NSNotificationCenter defaultCenter] addObserver: self [NSNotificationCenter.defaultCenter addObserver: self
selector: @selector(textfieldChanged:) selector: @selector(textfieldChanged:)
name: NSControlTextDidChangeNotification name: NSControlTextDidChangeNotification
object: o_textfield]; object: o_textfield];
@ -1660,7 +1660,7 @@ my_width, tooltip, init_value) \
1, 49, toolTip, @"") 1, 49, toolTip, @"")
[o_textfield setFloatValue: p_item->value.f]; [o_textfield setFloatValue: p_item->value.f];
[o_textfield setDelegate: self]; [o_textfield setDelegate: self];
[[NSNotificationCenter defaultCenter] addObserver: self [NSNotificationCenter.defaultCenter addObserver: self
selector: @selector(textfieldChanged:) selector: @selector(textfieldChanged:)
name: NSControlTextDidChangeNotification name: NSControlTextDidChangeNotification
object: o_textfield]; object: o_textfield];
@ -1748,7 +1748,7 @@ my_width, tooltip, init_value) \
[o_textfield setFloatValue: p_item->value.f]; [o_textfield setFloatValue: p_item->value.f];
[o_textfield setAutoresizingMask:NSViewMaxXMargin ]; [o_textfield setAutoresizingMask:NSViewMaxXMargin ];
[o_textfield setDelegate: self]; [o_textfield setDelegate: self];
[[NSNotificationCenter defaultCenter] addObserver: self [NSNotificationCenter.defaultCenter addObserver: self
selector: @selector(textfieldChanged:) selector: @selector(textfieldChanged:)
name: NSControlTextDidChangeNotification name: NSControlTextDidChangeNotification
object: o_textfield]; object: o_textfield];

2
modules/gui/macosx/views/VLCCustomWindowButton.m

@ -99,7 +99,7 @@
- (void)commonInitializer - (void)commonInitializer
{ {
[[NSNotificationCenter defaultCenter] addObserver:self [NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(controlTintChanged:) selector:@selector(controlTintChanged:)
name:NSControlTintDidChangeNotification name:NSControlTintDidChangeNotification
object:nil]; object:nil];

2
modules/gui/macosx/windows/VLCAboutWindowController.m

@ -62,7 +62,7 @@
- (void)dealloc - (void)dealloc
{ {
[[NSNotificationCenter defaultCenter] removeObserver: self]; [NSNotificationCenter.defaultCenter removeObserver: self];
} }
/***************************************************************************** /*****************************************************************************

4
modules/gui/macosx/windows/VLCDetachedAudioWindow.m

@ -50,7 +50,7 @@
trackingView.viewToHide = self.wrapperView; trackingView.viewToHide = self.wrapperView;
trackingView.animatesTransition = YES; trackingView.animatesTransition = YES;
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; NSNotificationCenter *notificationCenter = NSNotificationCenter.defaultCenter;
[notificationCenter addObserver:self selector:@selector(inputItemChanged:) name:VLCPlayerCurrentMediaItemChanged object:nil]; [notificationCenter addObserver:self selector:@selector(inputItemChanged:) name:VLCPlayerCurrentMediaItemChanged object:nil];
[self inputItemChanged:nil]; [self inputItemChanged:nil];
@ -58,7 +58,7 @@
- (void)dealloc - (void)dealloc
{ {
[[NSNotificationCenter defaultCenter] removeObserver:self]; [NSNotificationCenter.defaultCenter removeObserver:self];
} }
- (void)inputItemChanged:(NSNotification *)aNotification - (void)inputItemChanged:(NSNotification *)aNotification

8
modules/gui/macosx/windows/VLCOpenWindowController.m

@ -76,7 +76,7 @@ NSString *const VLCOpenTextFieldWasClicked = @"VLCOpenTextFieldWasClicked";
- (void)mouseDown:(NSEvent *)theEvent - (void)mouseDown:(NSEvent *)theEvent
{ {
[[NSNotificationCenter defaultCenter] postNotificationName: VLCOpenTextFieldWasClicked [NSNotificationCenter.defaultCenter postNotificationName: VLCOpenTextFieldWasClicked
object: self]; object: self];
[super mouseDown: theEvent]; [super mouseDown: theEvent];
} }
@ -142,7 +142,7 @@ NSString *const VLCOpenTextFieldWasClicked = @"VLCOpenTextFieldWasClicked";
[self setupSubtitlesPanel]; [self setupSubtitlesPanel];
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; NSNotificationCenter *notificationCenter = NSNotificationCenter.defaultCenter;
[notificationCenter addObserver: self [notificationCenter addObserver: self
selector: @selector(openNetInfoChanged:) selector: @selector(openNetInfoChanged:)
name: NSControlTextDidChangeNotification name: NSControlTextDidChangeNotification
@ -963,13 +963,13 @@ NSString *const VLCOpenTextFieldWasClicked = @"VLCOpenTextFieldWasClicked";
if (i_tag == 0) { if (i_tag == 0) {
[_netUDPPortTextField setIntValue: [_netUDPPortStepper intValue]]; [_netUDPPortTextField setIntValue: [_netUDPPortStepper intValue]];
[[NSNotificationCenter defaultCenter] postNotificationName: VLCOpenTextFieldWasClicked [NSNotificationCenter.defaultCenter postNotificationName: VLCOpenTextFieldWasClicked
object: _netUDPPortTextField]; object: _netUDPPortTextField];
[self.window makeFirstResponder: _netUDPPortTextField]; [self.window makeFirstResponder: _netUDPPortTextField];
} }
else if (i_tag == 1) { else if (i_tag == 1) {
[_netUDPMPortTextField setIntValue: [_netUDPMPortStepper intValue]]; [_netUDPMPortTextField setIntValue: [_netUDPMPortStepper intValue]];
[[NSNotificationCenter defaultCenter] postNotificationName: VLCOpenTextFieldWasClicked [NSNotificationCenter.defaultCenter postNotificationName: VLCOpenTextFieldWasClicked
object: _netUDPMPortTextField]; object: _netUDPMPortTextField];
[self.window makeFirstResponder: _netUDPMPortTextField]; [self.window makeFirstResponder: _netUDPMPortTextField];
} }

2
modules/gui/macosx/windows/addons/VLCAddonsWindowController.m

@ -296,7 +296,7 @@ static void addonChangedCallback( addons_manager_t *manager,
// update ui // update ui
[_addonsTable reloadData]; [_addonsTable reloadData];
[[NSNotificationCenter defaultCenter] postNotificationName:NSTableViewSelectionDidChangeNotification object:_addonsTable]; [NSNotificationCenter.defaultCenter postNotificationName:NSTableViewSelectionDidChangeNotification object:_addonsTable];
} }
- (void)_findNewAddons - (void)_findNewAddons

20
modules/gui/macosx/windows/convertandsave/VLCOutput.m

@ -110,43 +110,43 @@
[_channelNameLabel setStringValue: _NS("Channel Name")]; [_channelNameLabel setStringValue: _NS("Channel Name")];
[_sdpURLLabel setStringValue: _NS("SDP URL")]; [_sdpURLLabel setStringValue: _NS("SDP URL")];
[[NSNotificationCenter defaultCenter] addObserver: self [NSNotificationCenter.defaultCenter addObserver: self
selector: @selector(outputInfoChanged:) selector: @selector(outputInfoChanged:)
name: NSControlTextDidChangeNotification name: NSControlTextDidChangeNotification
object: _fileTextField]; object: _fileTextField];
[[NSNotificationCenter defaultCenter] addObserver: self [NSNotificationCenter.defaultCenter addObserver: self
selector: @selector(outputInfoChanged:) selector: @selector(outputInfoChanged:)
name: NSControlTextDidChangeNotification name: NSControlTextDidChangeNotification
object: _streamAddressTextField]; object: _streamAddressTextField];
[[NSNotificationCenter defaultCenter] addObserver: self [NSNotificationCenter.defaultCenter addObserver: self
selector: @selector(outputInfoChanged:) selector: @selector(outputInfoChanged:)
name: NSControlTextDidChangeNotification name: NSControlTextDidChangeNotification
object: _streamPortTextField]; object: _streamPortTextField];
[[NSNotificationCenter defaultCenter] addObserver: self [NSNotificationCenter.defaultCenter addObserver: self
selector: @selector(TTLChanged:) selector: @selector(TTLChanged:)
name: NSControlTextDidChangeNotification name: NSControlTextDidChangeNotification
object: _streamTTLTextField]; object: _streamTTLTextField];
[[NSNotificationCenter defaultCenter] addObserver: self [NSNotificationCenter.defaultCenter addObserver: self
selector: @selector(transcodeInfoChanged:) selector: @selector(transcodeInfoChanged:)
name: NSControlTextDidChangeNotification name: NSControlTextDidChangeNotification
object: _transcodeVideoBitrateComboBox]; object: _transcodeVideoBitrateComboBox];
[[NSNotificationCenter defaultCenter] addObserver: self [NSNotificationCenter.defaultCenter addObserver: self
selector: @selector(transcodeInfoChanged:) selector: @selector(transcodeInfoChanged:)
name: NSControlTextDidChangeNotification name: NSControlTextDidChangeNotification
object: _transcodeVideoScaleComboBox]; object: _transcodeVideoScaleComboBox];
[[NSNotificationCenter defaultCenter] addObserver: self [NSNotificationCenter.defaultCenter addObserver: self
selector: @selector(transcodeInfoChanged:) selector: @selector(transcodeInfoChanged:)
name: NSControlTextDidChangeNotification name: NSControlTextDidChangeNotification
object: _transcodeAudioBitrateComboBox]; object: _transcodeAudioBitrateComboBox];
[[NSNotificationCenter defaultCenter] addObserver: self [NSNotificationCenter.defaultCenter addObserver: self
selector: @selector(transcodeInfoChanged:) selector: @selector(transcodeInfoChanged:)
name: NSControlTextDidChangeNotification name: NSControlTextDidChangeNotification
object: _transcodeAudioChannelsComboBox]; object: _transcodeAudioChannelsComboBox];
[[NSNotificationCenter defaultCenter] addObserver: self [NSNotificationCenter.defaultCenter addObserver: self
selector: @selector(transcodeInfoChanged:) selector: @selector(transcodeInfoChanged:)
name: NSControlTextDidChangeNotification name: NSControlTextDidChangeNotification
object: _channelNameTextField]; object: _channelNameTextField];
[[NSNotificationCenter defaultCenter] addObserver: self [NSNotificationCenter.defaultCenter addObserver: self
selector: @selector(transcodeInfoChanged:) selector: @selector(transcodeInfoChanged:)
name: NSControlTextDidChangeNotification name: NSControlTextDidChangeNotification
object: _sdpURLTextField]; object: _sdpURLTextField];

4
modules/gui/macosx/windows/extensions/VLCExtensionsDialogProvider.m

@ -71,7 +71,7 @@ static NSView *createControlFromWidget(extension_widget_t *widget, id self)
[field setAutoresizingMask:NSViewWidthSizable]; [field setAutoresizingMask:NSViewWidthSizable];
[field setFont:[NSFont systemFontOfSize:0]]; [field setFont:[NSFont systemFontOfSize:0]];
[[field cell] setControlSize:NSRegularControlSize]; [[field cell] setControlSize:NSRegularControlSize];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(syncTextField:) name:NSControlTextDidChangeNotification object:field]; [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(syncTextField:) name:NSControlTextDidChangeNotification object:field];
return field; return field;
} }
case EXTENSION_WIDGET_PASSWORD: case EXTENSION_WIDGET_PASSWORD:
@ -81,7 +81,7 @@ static NSView *createControlFromWidget(extension_widget_t *widget, id self)
[field setAutoresizingMask:NSViewWidthSizable]; [field setAutoresizingMask:NSViewWidthSizable];
[field setFont:[NSFont systemFontOfSize:0]]; [field setFont:[NSFont systemFontOfSize:0]];
[[field cell] setControlSize:NSRegularControlSize]; [[field cell] setControlSize:NSRegularControlSize];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(syncTextField:) name:NSControlTextDidChangeNotification object:field]; [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(syncTextField:) name:NSControlTextDidChangeNotification object:field];
return field; return field;
} }

4
modules/gui/macosx/windows/mainwindow/VLCControlsBarCommon.m

@ -72,7 +72,7 @@
_playlistController = VLCMain.sharedInstance.playlistController; _playlistController = VLCMain.sharedInstance.playlistController;
_playerController = _playlistController.playerController; _playerController = _playlistController.playerController;
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; NSNotificationCenter *notificationCenter = NSNotificationCenter.defaultCenter;
[notificationCenter addObserver:self [notificationCenter addObserver:self
selector:@selector(updateTimeSlider:) selector:@selector(updateTimeSlider:)
name:VLCPlayerTimeAndPositionChanged name:VLCPlayerTimeAndPositionChanged
@ -188,7 +188,7 @@
- (void)dealloc - (void)dealloc
{ {
[[NSNotificationCenter defaultCenter] removeObserver:self]; [NSNotificationCenter.defaultCenter removeObserver:self];
} }
- (CGFloat)height - (CGFloat)height

2
modules/gui/macosx/windows/mainwindow/VLCMainVideoViewControlsBar.m

@ -62,7 +62,7 @@
_playlistController = VLCMain.sharedInstance.playlistController; _playlistController = VLCMain.sharedInstance.playlistController;
_playerController = _playlistController.playerController; _playerController = _playlistController.playerController;
NSNotificationCenter * const notificationCenter = [NSNotificationCenter defaultCenter]; NSNotificationCenter * const notificationCenter = NSNotificationCenter.defaultCenter;
[notificationCenter addObserver:self [notificationCenter addObserver:self
selector:@selector(updateDetailLabel:) selector:@selector(updateDetailLabel:)
name:VLCPlayerCurrentMediaItemChanged name:VLCPlayerCurrentMediaItemChanged

2
modules/gui/macosx/windows/mainwindow/VLCMainWindowControlsBar.m

@ -64,7 +64,7 @@
_playlistController = VLCMain.sharedInstance.playlistController; _playlistController = VLCMain.sharedInstance.playlistController;
_playerController = _playlistController.playerController; _playerController = _playlistController.playerController;
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; NSNotificationCenter *notificationCenter = NSNotificationCenter.defaultCenter;
[notificationCenter addObserver:self [notificationCenter addObserver:self
selector:@selector(updatePlaybackControls:) selector:@selector(updatePlaybackControls:)
name:VLCPlayerCurrentMediaItemChanged name:VLCPlayerCurrentMediaItemChanged

2
modules/gui/macosx/windows/video/VLCFullVideoViewWindow.m

@ -46,7 +46,7 @@
[super setup]; [super setup];
_autohideTitlebar = NO; _autohideTitlebar = NO;
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; NSNotificationCenter *notificationCenter = NSNotificationCenter.defaultCenter;
[notificationCenter addObserver:self [notificationCenter addObserver:self
selector:@selector(shouldShowFullscreenController:) selector:@selector(shouldShowFullscreenController:)
name:VLCVideoWindowShouldShowFullscreenController name:VLCVideoWindowShouldShowFullscreenController

2
modules/gui/macosx/windows/video/VLCMainVideoViewController.m

@ -120,7 +120,7 @@
[self updatePlaylistToggleState]; [self updatePlaylistToggleState];
[self updateLibraryControls]; [self updateLibraryControls];
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; NSNotificationCenter *notificationCenter = NSNotificationCenter.defaultCenter;
[notificationCenter addObserver:self [notificationCenter addObserver:self
selector:@selector(shouldShowControls:) selector:@selector(shouldShowControls:)
name:VLCVideoWindowShouldShowFullscreenController name:VLCVideoWindowShouldShowFullscreenController

2
modules/gui/macosx/windows/video/VLCVideoOutputProvider.m

@ -604,7 +604,7 @@ int WindowOpen(vlc_window_t *p_wnd)
VLCMain *main = VLCMain.sharedInstance; VLCMain *main = VLCMain.sharedInstance;
[[main libraryWindow] setWindowLevel:i_level]; [[main libraryWindow] setWindowLevel:i_level];
[[NSNotificationCenter defaultCenter] postNotificationName:VLCWindowShouldUpdateLevel object:self userInfo:@{VLCWindowLevelKey : @(_currentWindowLevel)}]; [NSNotificationCenter.defaultCenter postNotificationName:VLCWindowShouldUpdateLevel object:self userInfo:@{VLCWindowLevelKey : @(_currentWindowLevel)}];
} }
@end @end

8
modules/gui/macosx/windows/video/VLCVideoWindowCommon.m

@ -95,7 +95,7 @@ NSString *VLCWindowShouldShowController = @"VLCWindowShouldShowController";
- (void)dealloc - (void)dealloc
{ {
[[NSNotificationCenter defaultCenter] removeObserver:self]; [NSNotificationCenter.defaultCenter removeObserver:self];
} }
- (void)awakeFromNib - (void)awakeFromNib
@ -110,7 +110,7 @@ NSString *VLCWindowShouldShowController = @"VLCWindowShouldShowController";
_videoViewController = [[VLCMainVideoViewController alloc] init]; _videoViewController = [[VLCMainVideoViewController alloc] init];
} }
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; NSNotificationCenter *notificationCenter = NSNotificationCenter.defaultCenter;
[notificationCenter addObserver:self [notificationCenter addObserver:self
selector:@selector(mediaMetadataChanged:) selector:@selector(mediaMetadataChanged:)
name:VLCPlayerMetadataChangedForCurrentMedia name:VLCPlayerMetadataChangedForCurrentMedia
@ -281,7 +281,7 @@ NSString *VLCWindowShouldShowController = @"VLCWindowShouldShowController";
_inFullscreenTransition = NO; _inFullscreenTransition = NO;
if ([self hasActiveVideo]) { if ([self hasActiveVideo]) {
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; NSNotificationCenter *notificationCenter = NSNotificationCenter.defaultCenter;
if (![_videoViewController.view isHidden]) { if (![_videoViewController.view isHidden]) {
[notificationCenter postNotificationName:VLCVideoWindowShouldShowFullscreenController object:self]; [notificationCenter postNotificationName:VLCVideoWindowShouldShowFullscreenController object:self];
} }
@ -484,7 +484,7 @@ NSString *VLCWindowShouldShowController = @"VLCWindowShouldShowController";
[o_fullscreen_window makeKeyWindow]; [o_fullscreen_window makeKeyWindow];
[o_fullscreen_window setAcceptsMouseMovedEvents: YES]; [o_fullscreen_window setAcceptsMouseMovedEvents: YES];
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; NSNotificationCenter *notificationCenter = NSNotificationCenter.defaultCenter;
[notificationCenter postNotificationName:VLCVideoWindowDidEnterFullscreen object:self]; [notificationCenter postNotificationName:VLCVideoWindowDidEnterFullscreen object:self];
[notificationCenter postNotificationName:VLCVideoWindowShouldShowFullscreenController object:self]; [notificationCenter postNotificationName:VLCVideoWindowShouldShowFullscreenController object:self];

2
modules/gui/macosx/windows/video/VLCVoutView.m

@ -180,7 +180,7 @@
{ {
NSPoint ml = [self convertPoint: [o_event locationInWindow] fromView: nil]; NSPoint ml = [self convertPoint: [o_event locationInWindow] fromView: nil];
if ([self mouse: ml inRect: [self bounds]]) { if ([self mouse: ml inRect: [self bounds]]) {
[[NSNotificationCenter defaultCenter] postNotificationName:VLCVideoWindowShouldShowFullscreenController [NSNotificationCenter.defaultCenter postNotificationName:VLCVideoWindowShouldShowFullscreenController
object:self]; object:self];
} }

2
modules/notify/osx_notifications.m

@ -189,7 +189,7 @@ static inline NSString* CharsToNSString(char * _Nullable cStr)
- (void)dealloc - (void)dealloc
{ {
[[NSNotificationCenter defaultCenter] removeObserver:self]; [NSNotificationCenter.defaultCenter removeObserver:self];
// Clear a remaining lastNotification in Notification Center, if any // Clear a remaining lastNotification in Notification Center, if any
if (_lastNotification) { if (_lastNotification) {

4
modules/video_output/macosx.m

@ -476,7 +476,7 @@ static void OpenglSwap (vlc_gl_t *gl)
GLint params[] = { 1 }; GLint params[] = { 1 };
CGLSetParameter ([[self openGLContext] CGLContextObj], kCGLCPSwapInterval, params); CGLSetParameter ([[self openGLContext] CGLContextObj], kCGLCPSwapInterval, params);
[[NSNotificationCenter defaultCenter] addObserverForName:NSApplicationDidChangeScreenParametersNotification [NSNotificationCenter.defaultCenter addObserverForName:NSApplicationDidChangeScreenParametersNotification
object:NSApplication.sharedApplication object:NSApplication.sharedApplication
queue:nil queue:nil
usingBlock:^(NSNotification *notification) { usingBlock:^(NSNotification *notification) {
@ -491,7 +491,7 @@ static void OpenglSwap (vlc_gl_t *gl)
- (void)dealloc - (void)dealloc
{ {
[[NSNotificationCenter defaultCenter] removeObserver:self]; [NSNotificationCenter.defaultCenter removeObserver:self];
[super dealloc]; [super dealloc];
} }

Loading…
Cancel
Save