macosx: Use dot notation to acces NSNotificationCenter defaultCenter

Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
This commit is contained in:
Claudio Cambra 2023-06-10 14:51:12 +08:00 committed by Jean-Baptiste Kempf
parent 0b4e882f7f
commit 0bbcf88691
51 changed files with 102 additions and 102 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -173,7 +173,7 @@ const CGFloat VLCLibraryAlbumTableCellViewDefaultHeight = 168.;
[self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:horizontalVisualConstraints 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
selector:@selector(handleTableViewSelectionIsChanging:)
name:NSTableViewSelectionIsChangingNotification

View File

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

View File

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

View File

@ -46,7 +46,7 @@ static void cb_children_reset(vlc_media_tree_t *p_tree,
{
dispatch_async(dispatch_get_main_queue(), ^{
VLCMediaSource *mediaSource = (__bridge VLCMediaSource *)p_data;
[[NSNotificationCenter defaultCenter] postNotificationName:VLCMediaSourceChildrenReset
[NSNotificationCenter.defaultCenter postNotificationName:VLCMediaSourceChildrenReset
object:mediaSource];
});
}
@ -59,7 +59,7 @@ static void cb_children_added(vlc_media_tree_t *p_tree,
{
dispatch_async(dispatch_get_main_queue(), ^{
VLCMediaSource *mediaSource = (__bridge VLCMediaSource *)p_data;
[[NSNotificationCenter defaultCenter] postNotificationName:VLCMediaSourceChildrenAdded
[NSNotificationCenter.defaultCenter postNotificationName:VLCMediaSourceChildrenAdded
object:mediaSource];
});
}
@ -72,7 +72,7 @@ static void cb_children_removed(vlc_media_tree_t *p_tree,
{
dispatch_async(dispatch_get_main_queue(), ^{
VLCMediaSource *mediaSource = (__bridge VLCMediaSource *)p_data;
[[NSNotificationCenter defaultCenter] postNotificationName:VLCMediaSourceChildrenRemoved
[NSNotificationCenter.defaultCenter postNotificationName:VLCMediaSourceChildrenRemoved
object:mediaSource];
});
}
@ -84,7 +84,7 @@ static void cb_preparse_ended(vlc_media_tree_t *p_tree,
{
dispatch_async(dispatch_get_main_queue(), ^{
VLCMediaSource *mediaSource = (__bridge VLCMediaSource *)p_data;
[[NSNotificationCenter defaultCenter] postNotificationName:VLCMediaSourcePreparsingEnded
[NSNotificationCenter.defaultCenter postNotificationName:VLCMediaSourcePreparsingEnded
object:mediaSource];
});
}
@ -275,7 +275,7 @@ static const char *const localDevicesDescription = "My Machine";
}
dispatch_async(dispatch_get_main_queue(), ^{
[[NSNotificationCenter defaultCenter] postNotificationName:VLCMediaSourceChildrenReset object:self];
[NSNotificationCenter.defaultCenter postNotificationName:VLCMediaSourceChildrenReset object:self];
if (!self->_respondsToDiskChanges) {
// 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(), ^{
[[NSNotificationCenter defaultCenter] postNotificationName:VLCMediaSourceChildrenAdded
[NSNotificationCenter.defaultCenter postNotificationName:VLCMediaSourceChildrenAdded
object:self];
});
});
@ -442,7 +442,7 @@ static const char *const localDevicesDescription = "My Machine";
input_item_node_Delete(nodeToRemove);
dispatch_async(dispatch_get_main_queue(), ^{
[[NSNotificationCenter defaultCenter] postNotificationName:VLCMediaSourceChildrenRemoved
[NSNotificationCenter.defaultCenter postNotificationName:VLCMediaSourceChildrenRemoved
object:self];
});

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -55,7 +55,7 @@
{
self = [super initWithWindowNibName:@"Bookmarks"];
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;
}
@ -65,7 +65,7 @@
//if (p_old_input)
// input_Release(p_old_input);
[[NSNotificationCenter defaultCenter] removeObserver:self];
[NSNotificationCenter.defaultCenter removeObserver:self];
}
- (void)windowDidLoad

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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 */
config_SaveConfigFile(p_intf);
[[NSNotificationCenter defaultCenter] postNotificationName:VLCConfigurationChangedNotification object:nil];
[NSNotificationCenter.defaultCenter postNotificationName:VLCConfigurationChangedNotification object:nil];
}
- (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;
_libraryModel = _libraryController.libraryModel;
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
NSNotificationCenter *notificationCenter = NSNotificationCenter.defaultCenter;
[notificationCenter addObserver:self
selector:@selector(listOfMonitoredFoldersUpdated:)
name:VLCLibraryModelListOfMonitoredFoldersUpdated
@ -1550,7 +1550,7 @@ static inline void save_string_list(intf_thread_t * p_intf, id object, const cha
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
[NSNotificationCenter.defaultCenter removeObserver:self];
}
- (void)listOfMonitoredFoldersUpdated:(NSNotification *)aNotification

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -71,7 +71,7 @@ static NSView *createControlFromWidget(extension_widget_t *widget, id self)
[field setAutoresizingMask:NSViewWidthSizable];
[field setFont:[NSFont systemFontOfSize:0]];
[[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;
}
case EXTENSION_WIDGET_PASSWORD:
@ -81,7 +81,7 @@ static NSView *createControlFromWidget(extension_widget_t *widget, id self)
[field setAutoresizingMask:NSViewWidthSizable];
[field setFont:[NSFont systemFontOfSize:0]];
[[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;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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