Added preference for begin playback on add and clear on add.

CQTexperiment
vspader 2008-05-03 16:01:27 +00:00
parent 345e57698f
commit 10669a2db3
8 changed files with 467 additions and 865 deletions

View File

@ -22,6 +22,8 @@ typedef enum {
IBOutlet PlaybackController *playbackController;
}
- (void)initDefaults;
//load arrays of urls...
- (void)addURLs:(NSArray *)urls sort:(BOOL)sort;
- (void)addURL:(NSURL *)url;

View File

@ -22,6 +22,30 @@
@implementation PlaylistLoader
- (id)init
{
self = [super init];
if (self)
{
[self initDefaults];
}
return self;
}
- (void)initDefaults
{
NSLog(@"INITIIALIZING PLAYLIST LOADER DEFAULTS");
NSMutableDictionary *userDefaultsValuesDict = [NSMutableDictionary dictionary];
[userDefaultsValuesDict setObject:[NSNumber numberWithBool:NO] forKey:@"playOnAdd"];
[userDefaultsValuesDict setObject:[NSNumber numberWithBool:NO] forKey:@"clearOnAdd"];
[[NSUserDefaults standardUserDefaults] registerDefaults:userDefaultsValuesDict];
[[NSUserDefaults standardUserDefaults] synchronize];
}
- (BOOL)save:(NSString *)filename
{
NSString *ext = [filename pathExtension];
@ -155,7 +179,7 @@
if (index < 0)
index = 0;
if (1) {
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"clearOnAdd"]) {
[playlistController clear:self];
index = 0;
}
@ -284,7 +308,7 @@
//Auto start playback
if (1) {
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"playOnAdd"]) {
[playbackController playEntry: [entries objectAtIndex:0]];
}
}

View File

@ -9,5 +9,6 @@
"Remote" = "Remote";
"Updates" = "Updates";
"Last.fm" = "Last.fm";
"Playlist" = "Playlist";
"Press Key..." = "Press Key...";

File diff suppressed because it is too large Load Diff

View File

@ -15,6 +15,7 @@
17C6433F0B8A783F00C53518 /* OutputPane.m in Sources */ = {isa = PBXBuildFile; fileRef = 17C6433E0B8A783F00C53518 /* OutputPane.m */; };
17C643690B8A788000C53518 /* output.png in Resources */ = {isa = PBXBuildFile; fileRef = 17C643680B8A788000C53518 /* output.png */; };
17C644330B8A791D00C53518 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 17C644310B8A791D00C53518 /* CoreAudio.framework */; };
17C7E5B00DCCC30A003CBCF7 /* playlist.png in Resources */ = {isa = PBXBuildFile; fileRef = 17C7E5AF0DCCC30A003CBCF7 /* playlist.png */; };
17E41DB80C130AA500AC744D /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 17E41DB70C130AA500AC744D /* Localizable.strings */; };
17E78A7E0D68BE3C005C5A59 /* file_tree.png in Resources */ = {isa = PBXBuildFile; fileRef = 17E78A7D0D68BE3C005C5A59 /* file_tree.png */; };
17E78B6A0D68C1E3005C5A59 /* Preferences.xib in Resources */ = {isa = PBXBuildFile; fileRef = 17E78B680D68C1E3005C5A59 /* Preferences.xib */; };
@ -45,6 +46,7 @@
17C6433E0B8A783F00C53518 /* OutputPane.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = OutputPane.m; sourceTree = "<group>"; };
17C643680B8A788000C53518 /* output.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = output.png; path = Icons/output.png; sourceTree = "<group>"; };
17C644310B8A791D00C53518 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = "<absolute>"; };
17C7E5AF0DCCC30A003CBCF7 /* playlist.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = playlist.png; path = Icons/playlist.png; sourceTree = "<group>"; };
17E41DB50C130A9D00AC744D /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/Localizable.strings; sourceTree = "<group>"; };
17E78A7D0D68BE3C005C5A59 /* file_tree.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = file_tree.png; path = Icons/file_tree.png; sourceTree = "<group>"; };
17E78B690D68C1E3005C5A59 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/Preferences.xib; sourceTree = "<group>"; };
@ -196,6 +198,7 @@
8E07ABD90AAC95AF00A4B32F /* Icons */ = {
isa = PBXGroup;
children = (
17C7E5AF0DCCC30A003CBCF7 /* playlist.png */,
17E78A7D0D68BE3C005C5A59 /* file_tree.png */,
1766C7A70B912A71004A7AE4 /* lastfm.png */,
17C643680B8A788000C53518 /* output.png */,
@ -268,6 +271,7 @@
17E41DB80C130AA500AC744D /* Localizable.strings in Resources */,
17E78A7E0D68BE3C005C5A59 /* file_tree.png in Resources */,
17E78B6A0D68C1E3005C5A59 /* Preferences.xib in Resources */,
17C7E5B00DCCC30A003CBCF7 /* playlist.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

View File

@ -16,6 +16,7 @@
IBOutlet HotKeyPane *hotKeyPane;
IBOutlet OutputPane *outputPane;
IBOutlet NSView *playlistView;
IBOutlet NSView *scrobblerView;
IBOutlet NSView *remoteView;
IBOutlet NSView *updatesView;
@ -27,5 +28,6 @@
- (PreferencePane *)remotePane;
- (PreferencePane *)updatesPane;
- (PreferencePane *)scrobblerPane;
- (PreferencePane *)playlistPane;
@end

View File

@ -19,12 +19,13 @@
loaded = [NSBundle loadNibNamed:@"Preferences" owner:prefPaneController];
return [NSArray arrayWithObjects:
[prefPaneController hotKeyPane],
[prefPaneController remotePane],
[prefPaneController updatesPane],
[prefPaneController outputPane],
[prefPaneController scrobblerPane],
nil];
[prefPaneController playlistPane],
[prefPaneController hotKeyPane],
[prefPaneController remotePane],
[prefPaneController updatesPane],
[prefPaneController outputPane],
[prefPaneController scrobblerPane],
nil];
}
- (HotKeyPane *)hotKeyPane
@ -52,4 +53,9 @@
return [PreferencePane preferencePaneWithView:scrobblerView name:NSLocalizedStringFromTableInBundle(@"Last.fm", nil, [NSBundle bundleForClass:[self class]], @"") icon:@"lastfm"];
}
- (PreferencePane *)playlistPane
{
return [PreferencePane preferencePaneWithView:playlistView name:NSLocalizedStringFromTableInBundle(@"Playlist", nil, [NSBundle bundleForClass:[self class]], @"") icon:@"playlist"];
}
@end