From 67da2de6db3ffe2e8a74fd206f5c0290a21cdc15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org> Date: Mon, 8 Aug 2011 20:48:36 +0200 Subject: [PATCH] macosx: updated applescript binding to current API --- modules/gui/macosx/applescript.m | 70 +++++++++++++++----------------- 1 file changed, 32 insertions(+), 38 deletions(-) diff --git a/modules/gui/macosx/applescript.m b/modules/gui/macosx/applescript.m index 530557a52509..93e0d45a018e 100644 --- a/modules/gui/macosx/applescript.m +++ b/modules/gui/macosx/applescript.m @@ -26,8 +26,7 @@ *****************************************************************************/ #include "intf.h" #include "applescript.h" -#include "controls.h" -#include "open.h" +#include "CoreInteraction.h" /***************************************************************************** * VLGetURLScriptCommand implementation @@ -94,42 +93,37 @@ return nil; } - VLCControls * o_controls = [[VLCMain sharedInstance] controls]; - - if ( o_controls ) + if ( [o_command isEqualToString:@"play"] ) { - if ( [o_command isEqualToString:@"play"] ) - { - [o_controls play:self]; - } - else if ( [o_command isEqualToString:@"stop"] ) - { - [o_controls stop:self]; - } - else if ( [o_command isEqualToString:@"previous"] ) - { - [o_controls prev:self]; - } - else if ( [o_command isEqualToString:@"next"] ) - { - [o_controls next:self]; - } - else if ( [o_command isEqualToString:@"fullscreen"] ) - { - [o_controls toogleFullscreen: self]; - } - else if ( [o_command isEqualToString:@"mute"] ) - { - [o_controls mute:self]; - } - else if ( [o_command isEqualToString:@"volumeUp"] ) - { - [o_controls volumeUp:self]; - } - else if ( [o_command isEqualToString:@"volumeDown"] ) - { - [o_controls volumeDown:self]; - } + [[VLCCoreInteraction sharedInstance] play]; + } + else if ( [o_command isEqualToString:@"stop"] ) + { + [[VLCCoreInteraction sharedInstance] stop]; + } + else if ( [o_command isEqualToString:@"previous"] ) + { + [[VLCCoreInteraction sharedInstance] previous]; + } + else if ( [o_command isEqualToString:@"next"] ) + { + [[VLCCoreInteraction sharedInstance] next]; + } + else if ( [o_command isEqualToString:@"fullscreen"] ) + { + [[VLCCoreInteraction sharedInstance] toggleFullscreen]; + } + else if ( [o_command isEqualToString:@"mute"] ) + { + [[VLCCoreInteraction sharedInstance] mute]; + } + else if ( [o_command isEqualToString:@"volumeUp"] ) + { + [[VLCCoreInteraction sharedInstance] volumeUp]; + } + else if ( [o_command isEqualToString:@"volumeDown"] ) + { + [[VLCCoreInteraction sharedInstance] volumeDown]; } return nil; } @@ -147,7 +141,7 @@ - (void) setScriptFullscreenMode: (BOOL) mode { VLCControls * o_controls = [[VLCMain sharedInstance] controls]; if (mode == [o_controls isFullscreen]) return; - [o_controls toogleFullscreen: self]; + [[VLCCoreInteraction sharedInstance] toggleFullscreen]; } @end -- GitLab