Changed playlist behavior preferences to be pop-up buttons with choices

CQTexperiment
vasfed 2008-05-18 09:38:53 +00:00
parent f9f0891f6c
commit 584710ffb1
5 changed files with 1388 additions and 429 deletions

View File

@ -361,8 +361,8 @@ increase/decrease as long as the user holds the left/right, plus/minus button */
[userDefaultsValuesDict setObject:@"http://cogx.org/appcast/stable.xml" forKey:@"SUFeedURL"];
[userDefaultsValuesDict setObject:[NSNumber numberWithBool:YES] forKey:@"clearOnAdd"];
[userDefaultsValuesDict setObject:[NSNumber numberWithBool:YES] forKey:@"playOnAdd"];
[userDefaultsValuesDict setObject:@"clearAndPlay" forKey:@"openingFilesBehavior"];
[userDefaultsValuesDict setObject:@"enqueue" forKey:@"openingFilesAlteredBehavior"];
//Register and sync defaults
[[NSUserDefaults standardUserDefaults] registerDefaults:userDefaultsValuesDict];

View File

@ -757,9 +757,13 @@
bool modifier1_pressed = ((mods & kCGEventFlagMaskCommand)!=0)&((mods & kCGEventFlagMaskControl)!=0);
modifier1_pressed |= ((mods & kCGEventFlagMaskShift)!=0);
bool should_clean = false;
NSLog(@"Behavior: %@", [[NSUserDefaults standardUserDefaults] valueForKey:@"openingFilesBehavior"]);
NSLog(@"Altered Behavior: %@", [[NSUserDefaults standardUserDefaults] valueForKey:@"openingFilesAlteredBehavior"]);
if (src >= OpenFinder_Related && src <= OpenFinder_Related_end)
should_clean = [[NSUserDefaults standardUserDefaults] boolForKey:@"clearOnAdd"] ^ modifier1_pressed;
//possible settings are "clearAndPlay", "enqueue", "enqueueAndPlay"
should_clean = (!modifier1_pressed && ![[[NSUserDefaults standardUserDefaults] valueForKey:@"openingFilesBehavior"] compare:@"clearAndPlay"])
|| ( modifier1_pressed && ![[[NSUserDefaults standardUserDefaults] valueForKey:@"openingFilesAlteredBehavior"] compare:@"clearAndPlay"]);
if (src >= OpenPlaylist_related && src <= OpenPlaylist_related_end)
should_clean = modifier1_pressed;
@ -780,7 +784,10 @@
bool should_autoplay = false;
if (src >= OpenFinder_Related && src <= OpenFinder_Related_end)
should_autoplay = [[NSUserDefaults standardUserDefaults] boolForKey:@"playOnAdd"] ^ modifier1_pressed;
should_autoplay = (!modifier1_pressed && (![[[NSUserDefaults standardUserDefaults] valueForKey:@"openingFilesBehavior"] compare:@"clearAndPlay"]
|| ![[[NSUserDefaults standardUserDefaults] valueForKey:@"openingFilesBehavior"] compare:@"enqueueAndPlay"]))
|| ( modifier1_pressed && (![[[NSUserDefaults standardUserDefaults] valueForKey:@"openingFilesAlteredBehavior"] compare:@"clearAndPlay"]
|| ![[[NSUserDefaults standardUserDefaults] valueForKey:@"openingFilesAlteredBehavior"] compare:@"enqueueAndPlay"]));
if (src >= OpenPlaylist_related && src <= OpenPlaylist_related_end)
should_autoplay = modifier1_pressed;

View File

@ -12,3 +12,7 @@
"Playlist" = "Playlist";
"Press Key..." = "Press Key...";
"Clear playlist and play" = "Clear playlist and play files";
"Enqueue" = "Enqueue files";
"Enqueue and play" = "Enqueue files and play";

File diff suppressed because it is too large Load Diff

View File

@ -29,6 +29,7 @@
8E6C12170AACAE4100819171 /* NDHotKeyEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 8E6C12150AACAE4100819171 /* NDHotKeyEvent.m */; };
8E6C123A0AACAEF200819171 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8E6C12390AACAEF200819171 /* Carbon.framework */; };
8E6C13A00AACBAB500819171 /* HotKeyControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 8E6C139F0AACBAB500819171 /* HotKeyControl.m */; };
99F1813F0DE01D7A00FD5FFB /* PlaylistBehaviorArrayController.m in Sources */ = {isa = PBXBuildFile; fileRef = 99F1813E0DE01D7A00FD5FFB /* PlaylistBehaviorArrayController.m */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@ -69,6 +70,8 @@
8E6C12390AACAEF200819171 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
8E6C139E0AACBAB500819171 /* HotKeyControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HotKeyControl.h; sourceTree = "<group>"; };
8E6C139F0AACBAB500819171 /* HotKeyControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HotKeyControl.m; sourceTree = "<group>"; };
99F1813D0DE01D7A00FD5FFB /* PlaylistBehaviorArrayController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlaylistBehaviorArrayController.h; sourceTree = "<group>"; };
99F1813E0DE01D7A00FD5FFB /* PlaylistBehaviorArrayController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PlaylistBehaviorArrayController.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -175,6 +178,8 @@
8E6C139F0AACBAB500819171 /* HotKeyControl.m */,
17C643370B8A77CC00C53518 /* OutputsArrayController.h */,
17C643360B8A77CC00C53518 /* OutputsArrayController.m */,
99F1813D0DE01D7A00FD5FFB /* PlaylistBehaviorArrayController.h */,
99F1813E0DE01D7A00FD5FFB /* PlaylistBehaviorArrayController.m */,
);
name = Custom;
sourceTree = "<group>";
@ -291,6 +296,7 @@
17C643380B8A77CC00C53518 /* OutputsArrayController.m in Sources */,
17C6433F0B8A783F00C53518 /* OutputPane.m in Sources */,
170744AD0BFF3938002475C9 /* AppcastArrayController.m in Sources */,
99F1813F0DE01D7A00FD5FFB /* PlaylistBehaviorArrayController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};