Added preference for begin playback on add and clear on add.
This commit is contained in:
parent
345e57698f
commit
10669a2db3
8 changed files with 467 additions and 865 deletions
|
@ -22,6 +22,8 @@ typedef enum {
|
||||||
IBOutlet PlaybackController *playbackController;
|
IBOutlet PlaybackController *playbackController;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)initDefaults;
|
||||||
|
|
||||||
//load arrays of urls...
|
//load arrays of urls...
|
||||||
- (void)addURLs:(NSArray *)urls sort:(BOOL)sort;
|
- (void)addURLs:(NSArray *)urls sort:(BOOL)sort;
|
||||||
- (void)addURL:(NSURL *)url;
|
- (void)addURL:(NSURL *)url;
|
||||||
|
|
|
@ -22,6 +22,30 @@
|
||||||
|
|
||||||
@implementation PlaylistLoader
|
@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
|
- (BOOL)save:(NSString *)filename
|
||||||
{
|
{
|
||||||
NSString *ext = [filename pathExtension];
|
NSString *ext = [filename pathExtension];
|
||||||
|
@ -155,7 +179,7 @@
|
||||||
if (index < 0)
|
if (index < 0)
|
||||||
index = 0;
|
index = 0;
|
||||||
|
|
||||||
if (1) {
|
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"clearOnAdd"]) {
|
||||||
[playlistController clear:self];
|
[playlistController clear:self];
|
||||||
index = 0;
|
index = 0;
|
||||||
}
|
}
|
||||||
|
@ -284,7 +308,7 @@
|
||||||
|
|
||||||
|
|
||||||
//Auto start playback
|
//Auto start playback
|
||||||
if (1) {
|
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"playOnAdd"]) {
|
||||||
[playbackController playEntry: [entries objectAtIndex:0]];
|
[playbackController playEntry: [entries objectAtIndex:0]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,5 +9,6 @@
|
||||||
"Remote" = "Remote";
|
"Remote" = "Remote";
|
||||||
"Updates" = "Updates";
|
"Updates" = "Updates";
|
||||||
"Last.fm" = "Last.fm";
|
"Last.fm" = "Last.fm";
|
||||||
|
"Playlist" = "Playlist";
|
||||||
|
|
||||||
"Press Key..." = "Press Key...";
|
"Press Key..." = "Press Key...";
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -15,6 +15,7 @@
|
||||||
17C6433F0B8A783F00C53518 /* OutputPane.m in Sources */ = {isa = PBXBuildFile; fileRef = 17C6433E0B8A783F00C53518 /* OutputPane.m */; };
|
17C6433F0B8A783F00C53518 /* OutputPane.m in Sources */ = {isa = PBXBuildFile; fileRef = 17C6433E0B8A783F00C53518 /* OutputPane.m */; };
|
||||||
17C643690B8A788000C53518 /* output.png in Resources */ = {isa = PBXBuildFile; fileRef = 17C643680B8A788000C53518 /* output.png */; };
|
17C643690B8A788000C53518 /* output.png in Resources */ = {isa = PBXBuildFile; fileRef = 17C643680B8A788000C53518 /* output.png */; };
|
||||||
17C644330B8A791D00C53518 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 17C644310B8A791D00C53518 /* CoreAudio.framework */; };
|
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 */; };
|
17E41DB80C130AA500AC744D /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 17E41DB70C130AA500AC744D /* Localizable.strings */; };
|
||||||
17E78A7E0D68BE3C005C5A59 /* file_tree.png in Resources */ = {isa = PBXBuildFile; fileRef = 17E78A7D0D68BE3C005C5A59 /* file_tree.png */; };
|
17E78A7E0D68BE3C005C5A59 /* file_tree.png in Resources */ = {isa = PBXBuildFile; fileRef = 17E78A7D0D68BE3C005C5A59 /* file_tree.png */; };
|
||||||
17E78B6A0D68C1E3005C5A59 /* Preferences.xib in Resources */ = {isa = PBXBuildFile; fileRef = 17E78B680D68C1E3005C5A59 /* Preferences.xib */; };
|
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>"; };
|
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>"; };
|
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>"; };
|
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>"; };
|
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>"; };
|
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>"; };
|
17E78B690D68C1E3005C5A59 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/Preferences.xib; sourceTree = "<group>"; };
|
||||||
|
@ -196,6 +198,7 @@
|
||||||
8E07ABD90AAC95AF00A4B32F /* Icons */ = {
|
8E07ABD90AAC95AF00A4B32F /* Icons */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
17C7E5AF0DCCC30A003CBCF7 /* playlist.png */,
|
||||||
17E78A7D0D68BE3C005C5A59 /* file_tree.png */,
|
17E78A7D0D68BE3C005C5A59 /* file_tree.png */,
|
||||||
1766C7A70B912A71004A7AE4 /* lastfm.png */,
|
1766C7A70B912A71004A7AE4 /* lastfm.png */,
|
||||||
17C643680B8A788000C53518 /* output.png */,
|
17C643680B8A788000C53518 /* output.png */,
|
||||||
|
@ -268,6 +271,7 @@
|
||||||
17E41DB80C130AA500AC744D /* Localizable.strings in Resources */,
|
17E41DB80C130AA500AC744D /* Localizable.strings in Resources */,
|
||||||
17E78A7E0D68BE3C005C5A59 /* file_tree.png in Resources */,
|
17E78A7E0D68BE3C005C5A59 /* file_tree.png in Resources */,
|
||||||
17E78B6A0D68C1E3005C5A59 /* Preferences.xib in Resources */,
|
17E78B6A0D68C1E3005C5A59 /* Preferences.xib in Resources */,
|
||||||
|
17C7E5B00DCCC30A003CBCF7 /* playlist.png in Resources */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
|
|
BIN
Preferences/General/Icons/playlist.png
Normal file
BIN
Preferences/General/Icons/playlist.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.3 KiB |
|
@ -16,6 +16,7 @@
|
||||||
IBOutlet HotKeyPane *hotKeyPane;
|
IBOutlet HotKeyPane *hotKeyPane;
|
||||||
IBOutlet OutputPane *outputPane;
|
IBOutlet OutputPane *outputPane;
|
||||||
|
|
||||||
|
IBOutlet NSView *playlistView;
|
||||||
IBOutlet NSView *scrobblerView;
|
IBOutlet NSView *scrobblerView;
|
||||||
IBOutlet NSView *remoteView;
|
IBOutlet NSView *remoteView;
|
||||||
IBOutlet NSView *updatesView;
|
IBOutlet NSView *updatesView;
|
||||||
|
@ -27,5 +28,6 @@
|
||||||
- (PreferencePane *)remotePane;
|
- (PreferencePane *)remotePane;
|
||||||
- (PreferencePane *)updatesPane;
|
- (PreferencePane *)updatesPane;
|
||||||
- (PreferencePane *)scrobblerPane;
|
- (PreferencePane *)scrobblerPane;
|
||||||
|
- (PreferencePane *)playlistPane;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -19,12 +19,13 @@
|
||||||
loaded = [NSBundle loadNibNamed:@"Preferences" owner:prefPaneController];
|
loaded = [NSBundle loadNibNamed:@"Preferences" owner:prefPaneController];
|
||||||
|
|
||||||
return [NSArray arrayWithObjects:
|
return [NSArray arrayWithObjects:
|
||||||
[prefPaneController hotKeyPane],
|
[prefPaneController playlistPane],
|
||||||
[prefPaneController remotePane],
|
[prefPaneController hotKeyPane],
|
||||||
[prefPaneController updatesPane],
|
[prefPaneController remotePane],
|
||||||
[prefPaneController outputPane],
|
[prefPaneController updatesPane],
|
||||||
[prefPaneController scrobblerPane],
|
[prefPaneController outputPane],
|
||||||
nil];
|
[prefPaneController scrobblerPane],
|
||||||
|
nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (HotKeyPane *)hotKeyPane
|
- (HotKeyPane *)hotKeyPane
|
||||||
|
@ -52,4 +53,9 @@
|
||||||
return [PreferencePane preferencePaneWithView:scrobblerView name:NSLocalizedStringFromTableInBundle(@"Last.fm", nil, [NSBundle bundleForClass:[self class]], @"") icon:@"lastfm"];
|
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
|
@end
|
||||||
|
|
Loading…
Reference in a new issue