Add option to quit on natural stop
When the option is enabled, and playback comes to a completion, the player will quit on its own. Signed-off-by: Christopher Snowhill <kode54@gmail.com>CQTexperiment
parent
f9040dd1d3
commit
9614ec6e98
|
@ -458,6 +458,8 @@ void *kAppControllerContext = &kAppControllerContext;
|
|||
|
||||
[userDefaultsValuesDict setObject:[NSNumber numberWithBool:NO] forKey:@"resumePlaybackOnStartup"];
|
||||
|
||||
[userDefaultsValuesDict setObject:[NSNumber numberWithBool:NO] forKey:@"quitOnNaturalStop"];
|
||||
|
||||
// Register and sync defaults
|
||||
[[NSUserDefaults standardUserDefaults] registerDefaults:userDefaultsValuesDict];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
|
|
|
@ -626,7 +626,7 @@ NSDictionary *makeRGInfo(PlaylistEntry *pe) {
|
|||
break;
|
||||
|
||||
default:
|
||||
DLog(@"STOPED!");
|
||||
DLog(@"STOPPED!");
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -643,6 +643,12 @@ NSDictionary *makeRGInfo(PlaylistEntry *pe) {
|
|||
[self sendMetaData];
|
||||
}
|
||||
|
||||
- (void)audioPlayer:(AudioPlayer *)player didStopNaturally:(id)userInfo {
|
||||
if([[NSUserDefaults standardUserDefaults] boolForKey:@"quitOnNaturalStop"]) {
|
||||
[NSApp terminate:nil];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)audioPlayer:(AudioPlayer *)player sustainHDCD:(id)userInfo {
|
||||
MainWindow *mainWindow = (MainWindow *)appController.mainWindow;
|
||||
[mainWindow showHDCDLogo:YES];
|
||||
|
|
|
@ -121,6 +121,7 @@
|
|||
- (void)audioPlayer:(AudioPlayer *)player willEndStream:(id)userInfo; // You must use setNextStream in this method
|
||||
- (void)audioPlayer:(AudioPlayer *)player didBeginStream:(id)userInfo;
|
||||
- (void)audioPlayer:(AudioPlayer *)player didChangeStatus:(id)status userInfo:(id)userInfo;
|
||||
- (void)audioPlayer:(AudioPlayer *)player didStopNaturally:(id)userInfo;
|
||||
- (void)audioPlayer:(AudioPlayer *)player displayEqualizer:(AudioUnit)eq;
|
||||
- (void)audioPlayer:(AudioPlayer *)player refreshEqualizer:(AudioUnit)eq;
|
||||
- (void)audioPlayer:(AudioPlayer *)player removeEqualizer:(AudioUnit)eq;
|
||||
|
|
|
@ -259,6 +259,10 @@
|
|||
[self sendDelegateMethod:@selector(audioPlayer:didBeginStream:) withObject:userInfo waitUntilDone:YES];
|
||||
}
|
||||
|
||||
- (void)notifyPlaybackStopped:(id)userInfo {
|
||||
[self sendDelegateMethod:@selector(audioPlayer:didStopNaturally:) withObject:userInfo waitUntilDone:NO];
|
||||
}
|
||||
|
||||
- (void)beginEqualizer:(AudioUnit)eq {
|
||||
[self sendDelegateMethod:@selector(audioPlayer:displayEqualizer:) withVoid:eq waitUntilDone:YES];
|
||||
}
|
||||
|
@ -425,6 +429,8 @@
|
|||
|
||||
bufferChain = nil;
|
||||
|
||||
[self notifyPlaybackStopped:nil];
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -22,11 +22,11 @@
|
|||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<customView id="231" userLabel="PlaylistView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="530" height="139"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="530" height="173"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<subviews>
|
||||
<button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="310">
|
||||
<rect key="frame" x="18" y="41" width="395" height="18"/>
|
||||
<rect key="frame" x="18" y="75" width="395" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="check" title="Read CUE sheets when adding folders to playlist" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="311">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
|
@ -37,7 +37,7 @@
|
|||
</connections>
|
||||
</button>
|
||||
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="261">
|
||||
<rect key="frame" x="24" y="65" width="131" height="35"/>
|
||||
<rect key="frame" x="24" y="99" width="131" height="35"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="left" title="When opening file with ⇧ or ⌃⌘ held:" id="262">
|
||||
<font key="font" metaFont="system"/>
|
||||
|
@ -46,7 +46,7 @@
|
|||
</textFieldCell>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="259">
|
||||
<rect key="frame" x="24" y="106" width="131" height="17"/>
|
||||
<rect key="frame" x="24" y="140" width="131" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="left" title="When opening files:" id="260">
|
||||
<font key="font" metaFont="system"/>
|
||||
|
@ -55,7 +55,7 @@
|
|||
</textFieldCell>
|
||||
</textField>
|
||||
<popUpButton verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="253">
|
||||
<rect key="frame" x="158" y="62" width="257" height="26"/>
|
||||
<rect key="frame" x="158" y="96" width="257" height="26"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<popUpButtonCell key="cell" type="push" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" borderStyle="borderAndBezel" inset="2" id="254">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
|
@ -76,7 +76,7 @@
|
|||
</connections>
|
||||
</popUpButton>
|
||||
<popUpButton verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="247">
|
||||
<rect key="frame" x="158" y="100" width="257" height="26"/>
|
||||
<rect key="frame" x="158" y="134" width="257" height="26"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<popUpButtonCell key="cell" type="push" title="Item 1" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" inset="2" selectedItem="250" id="248">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
|
@ -97,7 +97,7 @@
|
|||
</connections>
|
||||
</popUpButton>
|
||||
<button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="6QS-GF-Vnc">
|
||||
<rect key="frame" x="18" y="13" width="388" height="18"/>
|
||||
<rect key="frame" x="18" y="47" width="388" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="check" title="Resume playback on startup" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="fUg-Cg-gXa">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
|
@ -107,8 +107,19 @@
|
|||
<binding destination="52" name="value" keyPath="values.resumePlaybackOnStartup" id="8OB-tj-Hd0"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="fDV-n8-dvO">
|
||||
<rect key="frame" x="18" y="19" width="212" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="check" title="Quit when playback completes" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="SBA-J5-rEd">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<binding destination="52" name="value" keyPath="values.quitOnNaturalStop" id="T4y-d6-qSk"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<point key="canvasLocation" x="-151" y="-239.5"/>
|
||||
<point key="canvasLocation" x="-151" y="-283.5"/>
|
||||
</customView>
|
||||
<customObject id="6" userLabel="HotKeyPane" customClass="HotKeyPane">
|
||||
<connections>
|
||||
|
|
Loading…
Reference in New Issue