Commit 876dc9a6 authored by David Fuhrmann's avatar David Fuhrmann

macosx: simplify more updaters

parent 91751dbd
......@@ -145,8 +145,6 @@ static NSString * VLCInputChangedNotification = @"VLCInputChangedNotification";
- (void)plItemUpdated;
- (void)playbackModeUpdated;
- (void)updateVolume;
- (void)showMainWindow;
- (void)showFullscreenController;
- (void)updateTogglePlaylistState;
......
......@@ -359,22 +359,21 @@ static int PlaybackModeUpdated(vlc_object_t *p_this, const char *psz_var,
static int VolumeUpdated(vlc_object_t *p_this, const char *psz_var,
vlc_value_t oldval, vlc_value_t new_val, void *param)
{
NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init];
[[VLCMain sharedInstance] performSelectorOnMainThread:@selector(updateVolume) withObject:nil waitUntilDone:NO];
dispatch_async(dispatch_get_main_queue(), ^{
[[[VLCMain sharedInstance] mainWindow] updateVolumeSlider];
});
[o_pool release];
return VLC_SUCCESS;
}
static int BossCallback(vlc_object_t *p_this, const char *psz_var,
vlc_value_t oldval, vlc_value_t new_val, void *param)
{
NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init];
[[VLCCoreInteraction sharedInstance] performSelectorOnMainThread:@selector(pause) withObject:nil waitUntilDone:NO];
[[VLCApplication sharedApplication] hide:nil];
dispatch_async(dispatch_get_main_queue(), ^{
[[VLCCoreInteraction sharedInstance] pause];
[[VLCApplication sharedApplication] hide:nil];
});
[o_pool release];
return VLC_SUCCESS;
}
......@@ -386,15 +385,21 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
static int ShowController(vlc_object_t *p_this, const char *psz_variable,
vlc_value_t old_val, vlc_value_t new_val, void *param)
{
intf_thread_t * p_intf = VLCIntf;
if (p_intf) {
playlist_t * p_playlist = pl_Get(p_intf);
BOOL b_fullscreen = var_GetBool(p_playlist, "fullscreen");
if (b_fullscreen)
[[VLCMain sharedInstance] performSelectorOnMainThread:@selector(showFullscreenController) withObject:nil waitUntilDone:NO];
else if (!strcmp(psz_variable, "intf-show"))
[[VLCMain sharedInstance] performSelectorOnMainThread:@selector(showMainWindow) withObject:nil waitUntilDone:NO];
}
dispatch_async(dispatch_get_main_queue(), ^{
intf_thread_t * p_intf = VLCIntf;
if (p_intf) {
playlist_t * p_playlist = pl_Get(p_intf);
BOOL b_fullscreen = var_GetBool(p_playlist, "fullscreen");
if (b_fullscreen)
[[VLCMain sharedInstance] showFullscreenController];
else if (!strcmp(psz_variable, "intf-show"))
[[[VLCMain sharedInstance] mainWindow] makeKeyAndOrderFront:nil];
}
});
return VLC_SUCCESS;
}
......@@ -1225,11 +1230,6 @@ static VLCMain *_o_sharedMainInstance = nil;
[o_info updateMetadata];
}
- (void)showMainWindow
{
[o_mainwindow performSelectorOnMainThread:@selector(makeKeyAndOrderFront:) withObject:nil waitUntilDone:NO];
}
- (void)showFullscreenController
{
// defer selector here (possibly another time) to ensure that keyWindow is set properly
......@@ -1237,11 +1237,6 @@ static VLCMain *_o_sharedMainInstance = nil;
[o_mainwindow performSelectorOnMainThread:@selector(showFullscreenController) withObject:nil waitUntilDone:NO];
}
- (void)updateVolume
{
[o_mainwindow updateVolumeSlider];
}
- (void)playbackModeUpdated
{
playlist_t * p_playlist = pl_Get(VLCIntf);
......@@ -1263,9 +1258,6 @@ static VLCMain *_o_sharedMainInstance = nil;
[o_mainmenu setShuffle];
}
#pragma mark -
#pragma mark Window updater
- (void)setActiveVideoPlayback:(BOOL)b_value
{
assert([NSThread isMainThread]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment