From: David Fuhrmann Date: Fri, 15 Feb 2013 18:27:39 +0000 (+0100) Subject: fix play / pause and rename method for better clarity X-Git-Tag: 2.1.0-git~1267 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=cf04d7a8a59430d9e15df30abb8c8e5c4ba31f61;p=vlc fix play / pause and rename method for better clarity --- diff --git a/modules/gui/macosx/ControlsBar.m b/modules/gui/macosx/ControlsBar.m index 00e1db91c8..1ebcef105d 100644 --- a/modules/gui/macosx/ControlsBar.m +++ b/modules/gui/macosx/ControlsBar.m @@ -155,7 +155,7 @@ - (IBAction)play:(id)sender { - [[VLCCoreInteraction sharedInstance] play]; + [[VLCCoreInteraction sharedInstance] playOrPause]; } - (void)resetPreviousButton diff --git a/modules/gui/macosx/CoreInteraction.h b/modules/gui/macosx/CoreInteraction.h index c673c2c9e2..2db0a04c2d 100644 --- a/modules/gui/macosx/CoreInteraction.h +++ b/modules/gui/macosx/CoreInteraction.h @@ -38,7 +38,7 @@ @property (readonly) NSString * nameOfCurrentPlaylistItem; @property (nonatomic, readwrite) BOOL mute; -- (void)play; +- (void)playOrPause; - (void)pause; - (void)stop; - (void)faster; diff --git a/modules/gui/macosx/CoreInteraction.m b/modules/gui/macosx/CoreInteraction.m index 933b1fe940..d5d9abbf8d 100644 --- a/modules/gui/macosx/CoreInteraction.m +++ b/modules/gui/macosx/CoreInteraction.m @@ -78,14 +78,14 @@ static VLCCoreInteraction *_o_sharedInstance = nil; #pragma mark - #pragma mark Playback Controls -- (void)play +- (void)playOrPause { input_thread_t * p_input; p_input = pl_CurrentInput(VLCIntf); playlist_t * p_playlist = pl_Get(VLCIntf); if (p_input) { - playlist_Play(p_playlist); + playlist_Pause(p_playlist); vlc_object_release(p_input); } else { bool empty; diff --git a/modules/gui/macosx/VideoView.m b/modules/gui/macosx/VideoView.m index 90b8881044..9d32c3907e 100644 --- a/modules/gui/macosx/VideoView.m +++ b/modules/gui/macosx/VideoView.m @@ -134,7 +134,7 @@ [[VLCCoreInteraction sharedInstance] toggleFullscreen]; else if (p_vout) { if (key == ' ') - [[VLCCoreInteraction sharedInstance] play]; + [[VLCCoreInteraction sharedInstance] playOrPause]; else { val.i_int |= (int)CocoaKeyToVLC(key); var_Set(p_vout->p_libvlc, "key-pressed", val); diff --git a/modules/gui/macosx/applescript.m b/modules/gui/macosx/applescript.m index 4806edfead..d9082caad4 100644 --- a/modules/gui/macosx/applescript.m +++ b/modules/gui/macosx/applescript.m @@ -88,7 +88,7 @@ playlist_t * p_playlist = pl_Get(p_intf); if ([o_command isEqualToString:@"play"]) - [[VLCCoreInteraction sharedInstance] play]; + [[VLCCoreInteraction sharedInstance] playOrPause]; else if ([o_command isEqualToString:@"stop"]) [[VLCCoreInteraction sharedInstance] stop]; else if ([o_command isEqualToString:@"previous"]) diff --git a/modules/gui/macosx/controls.m b/modules/gui/macosx/controls.m index cc7195b016..72607bd867 100644 --- a/modules/gui/macosx/controls.m +++ b/modules/gui/macosx/controls.m @@ -66,7 +66,7 @@ - (IBAction)play:(id)sender { - [[VLCCoreInteraction sharedInstance] play]; + [[VLCCoreInteraction sharedInstance] playOrPause]; } - (IBAction)stop:(id)sender diff --git a/modules/gui/macosx/fspanel.m b/modules/gui/macosx/fspanel.m index 54a1ee69e8..0de70bd01d 100644 --- a/modules/gui/macosx/fspanel.m +++ b/modules/gui/macosx/fspanel.m @@ -534,7 +534,7 @@ - (IBAction)play:(id)sender { - [[VLCCoreInteraction sharedInstance] play]; + [[VLCCoreInteraction sharedInstance] playOrPause]; } - (IBAction)forward:(id)sender diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m index 7223d50ae8..8da95b962f 100644 --- a/modules/gui/macosx/intf.m +++ b/modules/gui/macosx/intf.m @@ -932,7 +932,7 @@ static VLCMain *_o_sharedMainInstance = nil; int keyRepeat = (keyFlags & 0x1); 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 (keyState == 0 && keyRepeat == 0) @@ -1078,13 +1078,13 @@ static VLCMain *_o_sharedMainInstance = nil; [[VLCCoreInteraction sharedInstance] toggleFullscreen]; break; case k2009RemoteButtonPlay: - [[VLCCoreInteraction sharedInstance] play]; + [[VLCCoreInteraction sharedInstance] playOrPause]; break; case kRemoteButtonPlay: if (count >= 2) [[VLCCoreInteraction sharedInstance] toggleFullscreen]; else - [[VLCCoreInteraction sharedInstance] play]; + [[VLCCoreInteraction sharedInstance] playOrPause]; break; case kRemoteButtonVolume_Plus: if (config_GetInt(VLCIntf, "macosx-appleremote-sysvol")) @@ -1192,7 +1192,7 @@ static VLCMain *_o_sharedMainInstance = nil; } if (key == 0x0020) { // space key - [[VLCCoreInteraction sharedInstance] play]; + [[VLCCoreInteraction sharedInstance] playOrPause]; return YES; }