Commit cf04d7a8 authored by David Fuhrmann's avatar David Fuhrmann

fix play / pause and rename method for better clarity

parent 57df1568
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
- (IBAction)play:(id)sender - (IBAction)play:(id)sender
{ {
[[VLCCoreInteraction sharedInstance] play]; [[VLCCoreInteraction sharedInstance] playOrPause];
} }
- (void)resetPreviousButton - (void)resetPreviousButton
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
@property (readonly) NSString * nameOfCurrentPlaylistItem; @property (readonly) NSString * nameOfCurrentPlaylistItem;
@property (nonatomic, readwrite) BOOL mute; @property (nonatomic, readwrite) BOOL mute;
- (void)play; - (void)playOrPause;
- (void)pause; - (void)pause;
- (void)stop; - (void)stop;
- (void)faster; - (void)faster;
......
...@@ -78,14 +78,14 @@ static VLCCoreInteraction *_o_sharedInstance = nil; ...@@ -78,14 +78,14 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
#pragma mark - #pragma mark -
#pragma mark Playback Controls #pragma mark Playback Controls
- (void)play - (void)playOrPause
{ {
input_thread_t * p_input; input_thread_t * p_input;
p_input = pl_CurrentInput(VLCIntf); p_input = pl_CurrentInput(VLCIntf);
playlist_t * p_playlist = pl_Get(VLCIntf); playlist_t * p_playlist = pl_Get(VLCIntf);
if (p_input) { if (p_input) {
playlist_Play(p_playlist); playlist_Pause(p_playlist);
vlc_object_release(p_input); vlc_object_release(p_input);
} else { } else {
bool empty; bool empty;
......
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
[[VLCCoreInteraction sharedInstance] toggleFullscreen]; [[VLCCoreInteraction sharedInstance] toggleFullscreen];
else if (p_vout) { else if (p_vout) {
if (key == ' ') if (key == ' ')
[[VLCCoreInteraction sharedInstance] play]; [[VLCCoreInteraction sharedInstance] playOrPause];
else { else {
val.i_int |= (int)CocoaKeyToVLC(key); val.i_int |= (int)CocoaKeyToVLC(key);
var_Set(p_vout->p_libvlc, "key-pressed", val); var_Set(p_vout->p_libvlc, "key-pressed", val);
......
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
playlist_t * p_playlist = pl_Get(p_intf); playlist_t * p_playlist = pl_Get(p_intf);
if ([o_command isEqualToString:@"play"]) if ([o_command isEqualToString:@"play"])
[[VLCCoreInteraction sharedInstance] play]; [[VLCCoreInteraction sharedInstance] playOrPause];
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"])
......
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
- (IBAction)play:(id)sender - (IBAction)play:(id)sender
{ {
[[VLCCoreInteraction sharedInstance] play]; [[VLCCoreInteraction sharedInstance] playOrPause];
} }
- (IBAction)stop:(id)sender - (IBAction)stop:(id)sender
......
...@@ -534,7 +534,7 @@ ...@@ -534,7 +534,7 @@
- (IBAction)play:(id)sender - (IBAction)play:(id)sender
{ {
[[VLCCoreInteraction sharedInstance] play]; [[VLCCoreInteraction sharedInstance] playOrPause];
} }
- (IBAction)forward:(id)sender - (IBAction)forward:(id)sender
......
...@@ -932,7 +932,7 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -932,7 +932,7 @@ static VLCMain *_o_sharedMainInstance = nil;
int keyRepeat = (keyFlags & 0x1); int keyRepeat = (keyFlags & 0x1);
if (keyCode == NX_KEYTYPE_PLAY && keyState == 0) if (keyCode == NX_KEYTYPE_PLAY && keyState == 0)
[[VLCCoreInteraction sharedInstance] play]; [[VLCCoreInteraction sharedInstance] playOrPause];
if ((keyCode == NX_KEYTYPE_FAST || keyCode == NX_KEYTYPE_NEXT) && !b_mediakeyJustJumped) { if ((keyCode == NX_KEYTYPE_FAST || keyCode == NX_KEYTYPE_NEXT) && !b_mediakeyJustJumped) {
if (keyState == 0 && keyRepeat == 0) if (keyState == 0 && keyRepeat == 0)
...@@ -1078,13 +1078,13 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -1078,13 +1078,13 @@ static VLCMain *_o_sharedMainInstance = nil;
[[VLCCoreInteraction sharedInstance] toggleFullscreen]; [[VLCCoreInteraction sharedInstance] toggleFullscreen];
break; break;
case k2009RemoteButtonPlay: case k2009RemoteButtonPlay:
[[VLCCoreInteraction sharedInstance] play]; [[VLCCoreInteraction sharedInstance] playOrPause];
break; break;
case kRemoteButtonPlay: case kRemoteButtonPlay:
if (count >= 2) if (count >= 2)
[[VLCCoreInteraction sharedInstance] toggleFullscreen]; [[VLCCoreInteraction sharedInstance] toggleFullscreen];
else else
[[VLCCoreInteraction sharedInstance] play]; [[VLCCoreInteraction sharedInstance] playOrPause];
break; break;
case kRemoteButtonVolume_Plus: case kRemoteButtonVolume_Plus:
if (config_GetInt(VLCIntf, "macosx-appleremote-sysvol")) if (config_GetInt(VLCIntf, "macosx-appleremote-sysvol"))
...@@ -1192,7 +1192,7 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -1192,7 +1192,7 @@ static VLCMain *_o_sharedMainInstance = nil;
} }
if (key == 0x0020) { // space key if (key == 0x0020) { // space key
[[VLCCoreInteraction sharedInstance] play]; [[VLCCoreInteraction sharedInstance] playOrPause];
return YES; return YES;
} }
......
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