Playback: Implement Always Stop After Current
A new menu option under the Control menu, disabled by default, which stops playback after the current track completes. Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This commit is contained in:
parent
5e324927c5
commit
a8902b4ee6
5 changed files with 22 additions and 0 deletions
|
@ -657,6 +657,8 @@ static BOOL consentLastEnabled = NO;
|
|||
[userDefaultsValuesDict setObject:@(2) forKey:@"synthDefaultLoopCount"];
|
||||
[userDefaultsValuesDict setObject:@(44100) forKey:@"synthSampleRate"];
|
||||
|
||||
[userDefaultsValuesDict setObject:@NO forKey:@"alwaysStopAfterCurrent"];
|
||||
|
||||
// Register and sync defaults
|
||||
[[NSUserDefaults standardUserDefaults] registerDefaults:userDefaultsValuesDict];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
|
|
|
@ -1882,6 +1882,12 @@
|
|||
<action selector="stopAfterCurrent:" target="218" id="1896"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Always Stop After Current" keyEquivalent="." id="y8c-n8-5Uh">
|
||||
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
|
||||
<connections>
|
||||
<binding destination="1689" name="value" keyPath="values.alwaysStopAfterCurrent" id="rwr-s6-PnE"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
|
|
|
@ -1288,6 +1288,10 @@ static void *playlistControllerContext = &playlistControllerContext;
|
|||
}
|
||||
|
||||
- (PlaylistEntry *)getNextEntry:(PlaylistEntry *)pe ignoreRepeatOne:(BOOL)ignoreRepeatOne {
|
||||
if(!ignoreRepeatOne && [[NSUserDefaults standardUserDefaults] boolForKey:@"alwaysStopAfterCurrent"]) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
if(!ignoreRepeatOne && [self repeat] == RepeatModeRepeatOne) {
|
||||
return pe;
|
||||
}
|
||||
|
@ -1357,6 +1361,10 @@ static void *playlistControllerContext = &playlistControllerContext;
|
|||
}
|
||||
|
||||
- (PlaylistEntry *)getPrevEntry:(PlaylistEntry *)pe ignoreRepeatOne:(BOOL)ignoreRepeatOne {
|
||||
if(!ignoreRepeatOne && [[NSUserDefaults standardUserDefaults] boolForKey:@"alwaysStopAfterCurrent"]) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
if(!ignoreRepeatOne && [self repeat] == RepeatModeRepeatOne) {
|
||||
return pe;
|
||||
}
|
||||
|
|
|
@ -461,6 +461,9 @@
|
|||
/* Class = "NSMenuItem"; title = "Stop After Current"; ObjectID = "1895"; */
|
||||
"1895.title" = "Stop After Current";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Always Stop After Current"; ObjectID = "y8c-n8-5Uh"; */
|
||||
"y8c-n8-5Uh.title" = "Always Stop After Current";
|
||||
|
||||
/* Class = "CocoaBindingsConnection"; ibShadowedIsNilPlaceholder = "Cog"; ObjectID = "1903"; */
|
||||
"1903.ibShadowedIsNilPlaceholder" = "Cog";
|
||||
|
||||
|
|
|
@ -461,6 +461,9 @@
|
|||
/* Class = "NSMenuItem"; title = "Stop After Current"; ObjectID = "1895"; */
|
||||
"1895.title" = "Detener después de la pista actual";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Always Stop After Current"; ObjectID = "y8c-n8-5Uh"; */
|
||||
"y8c-n8-5Uh.title" = "Detener siempre al finalizar";
|
||||
|
||||
/* Class = "CocoaBindingsConnection"; ibShadowedIsNilPlaceholder = "Cog"; ObjectID = "1903"; */
|
||||
"1903.ibShadowedIsNilPlaceholder" = "Cog";
|
||||
|
||||
|
|
Loading…
Reference in a new issue