Commit 8a95e04e authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx/applescript: cosmetics

parent 0dd9d856
...@@ -39,13 +39,11 @@ ...@@ -39,13 +39,11 @@
NSString *o_command = [[self commandDescription] commandName]; NSString *o_command = [[self commandDescription] commandName];
NSString *o_urlString = [self directParameter]; NSString *o_urlString = [self directParameter];
if ( [o_command isEqualToString:@"GetURL"] || [o_command isEqualToString:@"OpenURL"] ) if ( [o_command isEqualToString:@"GetURL"] || [o_command isEqualToString:@"OpenURL"] ) {
{
intf_thread_t * p_intf = VLCIntf; intf_thread_t * p_intf = VLCIntf;
playlist_t * p_playlist = pl_Get( p_intf ); playlist_t * p_playlist = pl_Get( p_intf );
if ( o_urlString ) if ( o_urlString ) {
{
NSURL * o_url; NSURL * o_url;
input_item_t *p_input; input_item_t *p_input;
int returnValue; int returnValue;
...@@ -89,51 +87,28 @@ ...@@ -89,51 +87,28 @@
intf_thread_t * p_intf = VLCIntf; intf_thread_t * p_intf = VLCIntf;
playlist_t * p_playlist = pl_Get( p_intf ); playlist_t * p_playlist = pl_Get( p_intf );
if( p_playlist == NULL )
{
return nil;
}
if ( [o_command isEqualToString:@"play"] ) if ( [o_command isEqualToString:@"play"] )
{
[[VLCCoreInteraction sharedInstance] play]; [[VLCCoreInteraction sharedInstance] play];
}
else if ( [o_command isEqualToString:@"stop"] ) else if ( [o_command isEqualToString:@"stop"] )
{
[[VLCCoreInteraction sharedInstance] stop]; [[VLCCoreInteraction sharedInstance] stop];
}
else if ( [o_command isEqualToString:@"previous"] ) else if ( [o_command isEqualToString:@"previous"] )
{
[[VLCCoreInteraction sharedInstance] previous]; [[VLCCoreInteraction sharedInstance] previous];
}
else if ( [o_command isEqualToString:@"next"] ) else if ( [o_command isEqualToString:@"next"] )
{
[[VLCCoreInteraction sharedInstance] next]; [[VLCCoreInteraction sharedInstance] next];
}
else if ( [o_command isEqualToString:@"fullscreen"] ) else if ( [o_command isEqualToString:@"fullscreen"] )
{
[[VLCCoreInteraction sharedInstance] toggleFullscreen]; [[VLCCoreInteraction sharedInstance] toggleFullscreen];
}
else if ( [o_command isEqualToString:@"mute"] ) else if ( [o_command isEqualToString:@"mute"] )
{
[[VLCCoreInteraction sharedInstance] setMute: YES]; [[VLCCoreInteraction sharedInstance] setMute: YES];
}
else if ( [o_command isEqualToString:@"volumeUp"] ) else if ( [o_command isEqualToString:@"volumeUp"] )
{
[[VLCCoreInteraction sharedInstance] volumeUp]; [[VLCCoreInteraction sharedInstance] volumeUp];
}
else if ( [o_command isEqualToString:@"volumeDown"] ) else if ( [o_command isEqualToString:@"volumeDown"] )
{
[[VLCCoreInteraction sharedInstance] volumeDown]; [[VLCCoreInteraction sharedInstance] volumeDown];
} else if ( [o_command isEqualToString:@"stepForward"] ) {
else if ( [o_command isEqualToString:@"stepForward"] )
{
//default: forwardShort //default: forwardShort
if (o_parameter) if (o_parameter) {
{
int i_parameter = [o_parameter intValue]; int i_parameter = [o_parameter intValue];
switch (i_parameter) switch (i_parameter) {
{
case 1: case 1:
[[VLCCoreInteraction sharedInstance] forwardExtraShort]; [[VLCCoreInteraction sharedInstance] forwardExtraShort];
break; break;
...@@ -150,20 +125,13 @@ ...@@ -150,20 +125,13 @@
[[VLCCoreInteraction sharedInstance] forwardShort]; [[VLCCoreInteraction sharedInstance] forwardShort];
break; break;
} }
} } else
else
{
[[VLCCoreInteraction sharedInstance] forwardShort]; [[VLCCoreInteraction sharedInstance] forwardShort];
} } else if ( [o_command isEqualToString:@"stepBackward"] ) {
}
else if ( [o_command isEqualToString:@"stepBackward"] )
{
//default: backwardShort //default: backwardShort
if (o_parameter) if (o_parameter) {
{
int i_parameter = [o_parameter intValue]; int i_parameter = [o_parameter intValue];
switch (i_parameter) switch (i_parameter) {
{
case 1: case 1:
[[VLCCoreInteraction sharedInstance] backwardExtraShort]; [[VLCCoreInteraction sharedInstance] backwardExtraShort];
break; break;
...@@ -180,12 +148,9 @@ ...@@ -180,12 +148,9 @@
[[VLCCoreInteraction sharedInstance] backwardShort]; [[VLCCoreInteraction sharedInstance] backwardShort];
break; break;
} }
} } else
else
{
[[VLCCoreInteraction sharedInstance] backwardShort]; [[VLCCoreInteraction sharedInstance] backwardShort];
} }
}
return nil; return nil;
} }
...@@ -208,8 +173,7 @@ ...@@ -208,8 +173,7 @@
vout_thread_t * p_vout = getVout(); vout_thread_t * p_vout = getVout();
if( !p_vout ) if( !p_vout )
return; return;
if (var_GetBool( p_vout, "fullscreen") == mode) if (var_GetBool( p_vout, "fullscreen") == mode) {
{
vlc_object_release( p_vout ); vlc_object_release( p_vout );
return; return;
} }
...@@ -271,8 +235,6 @@ ...@@ -271,8 +235,6 @@
} }
} }
#pragma mark -
//TODO:whenever VLC should implement NSDocument, the methods below should move or be additionaly implemented in the NSDocument category
- (int) durationOfCurrentItem { - (int) durationOfCurrentItem {
return [[VLCCoreInteraction sharedInstance] durationOfCurrentPlaylistItem]; return [[VLCCoreInteraction sharedInstance] durationOfCurrentPlaylistItem];
} }
......
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