diff --git a/Application/PlaybackController.h b/Application/PlaybackController.h index 81843ee74..90e7be3b0 100644 --- a/Application/PlaybackController.h +++ b/Application/PlaybackController.h @@ -2,6 +2,8 @@ #import +#import + #import "CogAudio/AudioPlayer.h" #import "PlaylistController.h" #import "TrackingSlider.h" @@ -9,7 +11,7 @@ @class PlaylistView; -@interface PlaybackController : NSObject +@interface PlaybackController : NSObject { IBOutlet PlaylistController *playlistController; IBOutlet PlaylistView *playlistView; diff --git a/Application/PlaybackController.m b/Application/PlaybackController.m index ab937c8e3..14e6cd54b 100644 --- a/Application/PlaybackController.m +++ b/Application/PlaybackController.m @@ -20,6 +20,7 @@ showTimeRemaining = NO; scrobbler = [[AudioScrobbler alloc] init]; + [GrowlApplicationBridge setGrowlDelegate:self]; } return self; @@ -30,17 +31,28 @@ NSDictionary *defaultsDictionary = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithBool:YES], @"enableAudioScrobbler", [NSNumber numberWithBool:NO], @"automaticallyLaunchLastFM", + [NSNumber numberWithBool:YES], @"enableGrowlNotifications", nil]; [[NSUserDefaults standardUserDefaults] registerDefaults:defaultsDictionary]; } +- (NSDictionary *) registrationDictionaryForGrowl +{ + NSArray *notifications = [NSArray arrayWithObjects:@"Stream Changed", nil]; + + return [NSDictionary dictionaryWithObjectsAndKeys: + @"Cog", GROWL_APP_NAME, + notifications, GROWL_NOTIFICATIONS_ALL, + notifications, GROWL_NOTIFICATIONS_DEFAULT, + nil]; +} + - (void)awakeFromNib { currentVolume = 100.0; [volumeSlider setDoubleValue:pow(10.0, log10(0.5)/4.0)*[volumeSlider maxValue]]; } - - (IBAction)playPauseResume:(id)sender { @@ -90,6 +102,7 @@ if([[NSUserDefaults standardUserDefaults] boolForKey:@"enableAudioScrobbler"]) { [scrobbler stop]; } + } //called by double-clicking on table @@ -126,6 +139,16 @@ if([[NSUserDefaults standardUserDefaults] boolForKey:@"enableAudioScrobbler"]) { [scrobbler start:pe]; } + + if([[NSUserDefaults standardUserDefaults] boolForKey:@"enableGrowlNotifications"]) { + [GrowlApplicationBridge notifyWithTitle:[pe title] + description:[pe artist] + notificationName:@"Stream Changed" + iconData:nil + priority:0 + isSticky:NO + clickContext:nil]; + } } - (IBAction)next:(id)sender @@ -298,6 +321,16 @@ if([[NSUserDefaults standardUserDefaults] boolForKey:@"enableAudioScrobbler"]) { [scrobbler start:pe]; } + + if([[NSUserDefaults standardUserDefaults] boolForKey:@"enableGrowlNotifications"]) { + [GrowlApplicationBridge notifyWithTitle:[pe title] + description:[pe artist] + notificationName:@"Stream Changed" + iconData:nil + priority:0 + isSticky:NO + clickContext:nil]; + } } - (void)updatePosition:(id)sender diff --git a/Audio/Plugin.h b/Audio/Plugin.h index 2965cac82..32d770f05 100644 --- a/Audio/Plugin.h +++ b/Audio/Plugin.h @@ -1,6 +1,7 @@ typedef enum { kCogPluginCodec = 1, + kCogPluginGeneral } PluginType; @protocol CogPlugin diff --git a/Cog.xcodeproj/project.pbxproj b/Cog.xcodeproj/project.pbxproj index f7671affc..474536f40 100644 --- a/Cog.xcodeproj/project.pbxproj +++ b/Cog.xcodeproj/project.pbxproj @@ -8,10 +8,10 @@ /* Begin PBXBuildFile section */ 1705F1510B8BCB0C00C8B40D /* Help in Resources */ = {isa = PBXBuildFile; fileRef = 1705F1420B8BCB0C00C8B40D /* Help */; }; + 170680630B950158006BA573 /* Growl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 170680620B950158006BA573 /* Growl.framework */; }; + 170680840B950164006BA573 /* Growl.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 170680620B950158006BA573 /* Growl.framework */; }; 171678C00AC8C39E00C28CF3 /* SmartFolderNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 171678BE0AC8C39E00C28CF3 /* SmartFolderNode.m */; }; - 1766C6920B911DF1004A7AE4 /* AudioScrobbler.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1766C68E0B911DF1004A7AE4 /* AudioScrobbler.h */; }; 1766C6930B911DF1004A7AE4 /* AudioScrobbler.m in Sources */ = {isa = PBXBuildFile; fileRef = 1766C68F0B911DF1004A7AE4 /* AudioScrobbler.m */; }; - 1766C6940B911DF1004A7AE4 /* AudioScrobblerClient.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1766C6900B911DF1004A7AE4 /* AudioScrobblerClient.h */; }; 1766C6950B911DF1004A7AE4 /* AudioScrobblerClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 1766C6910B911DF1004A7AE4 /* AudioScrobblerClient.m */; }; 1766C8920B912FB4004A7AE4 /* files_off.png in Resources */ = {isa = PBXBuildFile; fileRef = 1766C88A0B912FB4004A7AE4 /* files_off.png */; }; 1766C8930B912FB4004A7AE4 /* files_on.png in Resources */ = {isa = PBXBuildFile; fileRef = 1766C88B0B912FB4004A7AE4 /* files_on.png */; }; @@ -78,7 +78,6 @@ 17BB5CFA0B8A86350009ACB1 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 17BB5CF70B8A86350009ACB1 /* CoreAudio.framework */; }; 17BB5CFB0B8A86350009ACB1 /* CoreAudioKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 17BB5CF80B8A86350009ACB1 /* CoreAudioKit.framework */; }; 17BB5EA60B8A87850009ACB1 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 17BB5EA50B8A87850009ACB1 /* IOKit.framework */; }; - 17D21DF60B8BE86900D1EBDE /* CoreAudioUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 17D21DF40B8BE86900D1EBDE /* CoreAudioUtils.m */; }; 17F94CC20B8D08FB00A34E87 /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 17F94CC10B8D08FB00A34E87 /* Sparkle.framework */; }; 17F94CCD0B8D090800A34E87 /* Sparkle.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 17F94CC10B8D08FB00A34E87 /* Sparkle.framework */; }; 8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 29B97318FDCFA39411CA2CEA /* MainMenu.nib */; }; @@ -141,10 +140,9 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( + 170680840B950164006BA573 /* Growl.framework in CopyFiles */, 17B61B630B90A28100BC003F /* CogAudio.framework in CopyFiles */, 17F94CCD0B8D090800A34E87 /* Sparkle.framework in CopyFiles */, - 1766C6920B911DF1004A7AE4 /* AudioScrobbler.h in CopyFiles */, - 1766C6940B911DF1004A7AE4 /* AudioScrobblerClient.h in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -154,6 +152,7 @@ 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 1705F1420B8BCB0C00C8B40D /* Help */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Help; sourceTree = ""; }; + 170680620B950158006BA573 /* Growl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Growl.framework; path = ThirdParty/Frameworks/Growl.framework; sourceTree = ""; }; 171678BD0AC8C39E00C28CF3 /* SmartFolderNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SmartFolderNode.h; sourceTree = ""; }; 171678BE0AC8C39E00C28CF3 /* SmartFolderNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SmartFolderNode.m; sourceTree = ""; }; 1766C68E0B911DF1004A7AE4 /* AudioScrobbler.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AudioScrobbler.h; sourceTree = ""; }; @@ -235,8 +234,6 @@ 17BB5CF70B8A86350009ACB1 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = ""; }; 17BB5CF80B8A86350009ACB1 /* CoreAudioKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudioKit.framework; path = /System/Library/Frameworks/CoreAudioKit.framework; sourceTree = ""; }; 17BB5EA50B8A87850009ACB1 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = ""; }; - 17D21DF30B8BE86900D1EBDE /* CoreAudioUtils.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CoreAudioUtils.h; sourceTree = ""; }; - 17D21DF40B8BE86900D1EBDE /* CoreAudioUtils.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = CoreAudioUtils.m; sourceTree = ""; }; 17F94CC10B8D08FB00A34E87 /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Sparkle.framework; path = ThirdParty/Frameworks/Sparkle.framework; sourceTree = ""; }; 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 29B97319FDCFA39411CA2CEA /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/MainMenu.nib; sourceTree = ""; }; @@ -310,6 +307,7 @@ 17BB5EA60B8A87850009ACB1 /* IOKit.framework in Frameworks */, 17F94CC20B8D08FB00A34E87 /* Sparkle.framework in Frameworks */, 17B61B5E0B90A27F00BC003F /* CogAudio.framework in Frameworks */, + 170680630B950158006BA573 /* Growl.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -334,6 +332,7 @@ 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { isa = PBXGroup; children = ( + 170680620B950158006BA573 /* Growl.framework */, 17B61B5D0B90A27F00BC003F /* CogAudio.framework */, 17F94CC10B8D08FB00A34E87 /* Sparkle.framework */, 8E6889230AAA403C00AD3950 /* Carbon.framework */, @@ -381,10 +380,8 @@ 177EBF770B8BC2A70000BC8C /* ThirdParty */ = { isa = PBXGroup; children = ( - 17D21DF20B8BE86900D1EBDE /* CoreAudioUtils */, 177EBF780B8BC2A70000BC8C /* AMRemovableColumnsTableView */, 177EBF7D0B8BC2A70000BC8C /* AppleRemote */, - 177EBF800B8BC2A70000BC8C /* CoreAudioUtils */, 177EBF850B8BC2A70000BC8C /* ImageTextCell */, 177EBF880B8BC2A70000BC8C /* KFTypeSelectTableView */, 177EBF8B0B8BC2A70000BC8C /* NDHotKeys */, @@ -413,13 +410,6 @@ path = AppleRemote; sourceTree = ""; }; - 177EBF800B8BC2A70000BC8C /* CoreAudioUtils */ = { - isa = PBXGroup; - children = ( - ); - path = CoreAudioUtils; - sourceTree = ""; - }; 177EBF850B8BC2A70000BC8C /* ImageTextCell */ = { isa = PBXGroup; children = ( @@ -527,15 +517,6 @@ name = PlugIns; sourceTree = ""; }; - 17D21DF20B8BE86900D1EBDE /* CoreAudioUtils */ = { - isa = PBXGroup; - children = ( - 17D21DF30B8BE86900D1EBDE /* CoreAudioUtils.h */, - 17D21DF40B8BE86900D1EBDE /* CoreAudioUtils.m */, - ); - path = CoreAudioUtils; - sourceTree = ""; - }; 19C28FACFE9D520D11CA2CBB /* Products */ = { isa = PBXGroup; children = ( @@ -823,7 +804,6 @@ 177EC0290B8BC2CF0000BC8C /* TrackingSlider.m in Sources */, 1770429C0B8BC53600B86321 /* AppController.m in Sources */, 1770429E0B8BC53600B86321 /* PlaybackController.m in Sources */, - 17D21DF60B8BE86900D1EBDE /* CoreAudioUtils.m in Sources */, 1766C6930B911DF1004A7AE4 /* AudioScrobbler.m in Sources */, 1766C6950B911DF1004A7AE4 /* AudioScrobblerClient.m in Sources */, ); diff --git a/Preferences/General/English.lproj/Preferences.nib/classes.nib b/Preferences/General/English.lproj/Preferences.nib/classes.nib index 82ae8a94b..c3992d461 100644 --- a/Preferences/General/English.lproj/Preferences.nib/classes.nib +++ b/Preferences/General/English.lproj/Preferences.nib/classes.nib @@ -45,9 +45,9 @@ fileDrawerPane = FileDrawerPane; hotKeyPane = HotKeyPane; outputPane = OutputPane; - remotePane = RemotePane; - scrobblerPane = ScrobblerPane; - updatesPane = UpdatesPane; + remoteView = NSView; + scrobblerView = NSView; + updatesView = NSView; }; SUPERCLASS = NSObject; }, diff --git a/Preferences/General/English.lproj/Preferences.nib/info.nib b/Preferences/General/English.lproj/Preferences.nib/info.nib index 6e2ee1815..bd734612b 100644 --- a/Preferences/General/English.lproj/Preferences.nib/info.nib +++ b/Preferences/General/English.lproj/Preferences.nib/info.nib @@ -7,28 +7,31 @@ IBEditorPositions 10 - 144 608 506 102 0 0 1440 878 + 562 607 506 102 0 0 1680 1028 + 102 + 762 667 248 96 0 0 1680 1028 11 - 619 592 400 151 0 0 1440 878 + 640 634 400 151 0 0 1680 1028 43 - 103 395 400 116 0 0 1440 878 + 640 652 400 116 0 0 1680 1028 50 - 527 303 400 96 0 0 1440 878 + 640 662 400 96 0 0 1680 1028 58 - 154 210 411 101 0 0 1440 878 + 614 441 411 101 0 0 1680 1028 85 - 757 432 452 116 0 0 1440 878 + 614 652 452 116 0 0 1680 1028 IBFramework Version 446.1 IBOpenObjects + 58 + 102 + 85 43 50 11 10 - 58 - 85 IBSystem Version 8L2127 diff --git a/Preferences/General/English.lproj/Preferences.nib/keyedobjects.nib b/Preferences/General/English.lproj/Preferences.nib/keyedobjects.nib index 555e69fe8..9aa2b7207 100644 Binary files a/Preferences/General/English.lproj/Preferences.nib/keyedobjects.nib and b/Preferences/General/English.lproj/Preferences.nib/keyedobjects.nib differ diff --git a/Preferences/General/General.xcodeproj/project.pbxproj b/Preferences/General/General.xcodeproj/project.pbxproj index 14c271e5f..d3018c76c 100644 --- a/Preferences/General/General.xcodeproj/project.pbxproj +++ b/Preferences/General/General.xcodeproj/project.pbxproj @@ -7,9 +7,7 @@ objects = { /* Begin PBXBuildFile section */ - 172D72480B891FEF00D095BB /* RemotePane.m in Sources */ = {isa = PBXBuildFile; fileRef = 172D72470B891FEF00D095BB /* RemotePane.m */; }; 172D72AD0B8926CA00D095BB /* apple_remote.png in Resources */ = {isa = PBXBuildFile; fileRef = 172D72AC0B8926CA00D095BB /* apple_remote.png */; }; - 1766C73D0B9126E7004A7AE4 /* ScrobblerPane.m in Sources */ = {isa = PBXBuildFile; fileRef = 1766C73C0B9126E7004A7AE4 /* ScrobblerPane.m */; }; 1766C7A80B912A71004A7AE4 /* lastfm.png in Resources */ = {isa = PBXBuildFile; fileRef = 1766C7A70B912A71004A7AE4 /* lastfm.png */; }; 17C643380B8A77CC00C53518 /* OutputsArrayController.m in Sources */ = {isa = PBXBuildFile; fileRef = 17C643360B8A77CC00C53518 /* OutputsArrayController.m */; }; 17C6433F0B8A783F00C53518 /* OutputPane.m in Sources */ = {isa = PBXBuildFile; fileRef = 17C6433E0B8A783F00C53518 /* OutputPane.m */; }; @@ -24,7 +22,6 @@ 8E07ABDC0AAC95BC00A4B32F /* file_drawer.png in Resources */ = {isa = PBXBuildFile; fileRef = 8E07ABDA0AAC95BC00A4B32F /* file_drawer.png */; }; 8E07ABDD0AAC95BC00A4B32F /* hot_keys.png in Resources */ = {isa = PBXBuildFile; fileRef = 8E07ABDB0AAC95BC00A4B32F /* hot_keys.png */; }; 8E07AC050AAC968C00A4B32F /* Preferences.nib in Resources */ = {isa = PBXBuildFile; fileRef = 8E07AC030AAC968C00A4B32F /* Preferences.nib */; }; - 8E15A8360B8944C4006DC802 /* UpdatesPane.m in Sources */ = {isa = PBXBuildFile; fileRef = 8E15A8350B8944C4006DC802 /* UpdatesPane.m */; }; 8E15A86C0B894768006DC802 /* updates.png in Resources */ = {isa = PBXBuildFile; fileRef = 8E15A86B0B894768006DC802 /* updates.png */; }; 8E6C12160AACAE4100819171 /* NDHotKeyControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 8E6C12130AACAE4100819171 /* NDHotKeyControl.m */; }; 8E6C12170AACAE4100819171 /* NDHotKeyEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 8E6C12150AACAE4100819171 /* NDHotKeyEvent.m */; }; @@ -37,11 +34,7 @@ 089C167EFE841241C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; 089C167FFE841241C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; - 172D72460B891FEF00D095BB /* RemotePane.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RemotePane.h; sourceTree = ""; }; - 172D72470B891FEF00D095BB /* RemotePane.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = RemotePane.m; sourceTree = ""; }; 172D72AC0B8926CA00D095BB /* apple_remote.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = apple_remote.png; path = Icons/apple_remote.png; sourceTree = ""; }; - 1766C73B0B9126E7004A7AE4 /* ScrobblerPane.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ScrobblerPane.h; sourceTree = ""; }; - 1766C73C0B9126E7004A7AE4 /* ScrobblerPane.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = ScrobblerPane.m; sourceTree = ""; }; 1766C7A70B912A71004A7AE4 /* lastfm.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = lastfm.png; path = Icons/lastfm.png; sourceTree = ""; }; 17C643360B8A77CC00C53518 /* OutputsArrayController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = OutputsArrayController.m; sourceTree = ""; }; 17C643370B8A77CC00C53518 /* OutputsArrayController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = OutputsArrayController.h; sourceTree = ""; }; @@ -64,8 +57,6 @@ 8E07ABDA0AAC95BC00A4B32F /* file_drawer.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = file_drawer.png; path = Icons/file_drawer.png; sourceTree = ""; }; 8E07ABDB0AAC95BC00A4B32F /* hot_keys.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = hot_keys.png; path = Icons/hot_keys.png; sourceTree = ""; }; 8E07AC040AAC968C00A4B32F /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/Preferences.nib; sourceTree = ""; }; - 8E15A8340B8944C4006DC802 /* UpdatesPane.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = UpdatesPane.h; sourceTree = ""; }; - 8E15A8350B8944C4006DC802 /* UpdatesPane.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = UpdatesPane.m; sourceTree = ""; }; 8E15A86B0B894768006DC802 /* updates.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = updates.png; path = Icons/updates.png; sourceTree = ""; }; 8E6C12120AACAE4100819171 /* NDHotKeyControl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = NDHotKeyControl.h; sourceTree = ""; }; 8E6C12130AACAE4100819171 /* NDHotKeyControl.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = NDHotKeyControl.m; sourceTree = ""; }; @@ -162,14 +153,8 @@ 8E07AA7F0AAC8EA200A4B32F /* FileDrawerPane.m */, 8E07AA800AAC8EA200A4B32F /* HotKeyPane.h */, 8E07AA810AAC8EA200A4B32F /* HotKeyPane.m */, - 172D72460B891FEF00D095BB /* RemotePane.h */, - 172D72470B891FEF00D095BB /* RemotePane.m */, - 8E15A8340B8944C4006DC802 /* UpdatesPane.h */, - 8E15A8350B8944C4006DC802 /* UpdatesPane.m */, 17C6433D0B8A783F00C53518 /* OutputPane.h */, 17C6433E0B8A783F00C53518 /* OutputPane.m */, - 1766C73B0B9126E7004A7AE4 /* ScrobblerPane.h */, - 1766C73C0B9126E7004A7AE4 /* ScrobblerPane.m */, ); name = Panes; sourceTree = ""; @@ -284,11 +269,8 @@ 8E6C12160AACAE4100819171 /* NDHotKeyControl.m in Sources */, 8E6C12170AACAE4100819171 /* NDHotKeyEvent.m in Sources */, 8E6C13A00AACBAB500819171 /* HotKeyControl.m in Sources */, - 172D72480B891FEF00D095BB /* RemotePane.m in Sources */, - 8E15A8360B8944C4006DC802 /* UpdatesPane.m in Sources */, 17C643380B8A77CC00C53518 /* OutputsArrayController.m in Sources */, 17C6433F0B8A783F00C53518 /* OutputPane.m in Sources */, - 1766C73D0B9126E7004A7AE4 /* ScrobblerPane.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Preferences/General/PrefPaneController.h b/Preferences/General/PrefPaneController.h index 967ded1cb..4fd8e7488 100644 --- a/Preferences/General/PrefPaneController.h +++ b/Preferences/General/PrefPaneController.h @@ -11,25 +11,24 @@ #import "HotKeyPane.h" #import "FileDrawerPane.h" -#import "RemotePane.h" -#import "UpdatesPane.h" #import "OutputPane.h" -#import "ScrobblerPane.h" @interface PrefPaneController : NSObject { IBOutlet HotKeyPane *hotKeyPane; IBOutlet FileDrawerPane *fileDrawerPane; - IBOutlet RemotePane *remotePane; - IBOutlet UpdatesPane *updatesPane; IBOutlet OutputPane *outputPane; - IBOutlet ScrobblerPane *scrobblerPane; + + IBOutlet NSView *scrobblerView; + IBOutlet NSView *remoteView; + IBOutlet NSView *updatesView; } - (HotKeyPane *)hotKeyPane; - (FileDrawerPane *)fileDrawerPane; -- (RemotePane *)remotePane; -- (UpdatesPane *)updatesPane; - (OutputPane *)outputPane; -- (ScrobblerPane *)scrobblerPane; + +- (PreferencePane *)remotePane; +- (PreferencePane *)updatesPane; +- (PreferencePane *)scrobblerPane; @end diff --git a/Preferences/General/PrefPaneController.m b/Preferences/General/PrefPaneController.m index 481e5a6a7..82d7f0dff 100644 --- a/Preferences/General/PrefPaneController.m +++ b/Preferences/General/PrefPaneController.m @@ -31,24 +31,24 @@ return fileDrawerPane; } -- (RemotePane *)remotePane -{ - return remotePane; -} - -- (UpdatesPane *)updatesPane -{ - return updatesPane; -} - - (OutputPane *)outputPane { return outputPane; } -- (ScrobblerPane *)scrobblerPane +- (PreferencePane *)remotePane { - return scrobblerPane; + return [PreferencePane preferencePaneWithView:remoteView name:@"Remote" icon:@"apple_remote"]; +} + +- (PreferencePane *)updatesPane +{ + return [PreferencePane preferencePaneWithView:updatesView name:@"Updates" icon:@"updates"]; +} + +- (PreferencePane *)scrobblerPane +{ + return [PreferencePane preferencePaneWithView:scrobblerView name:@"Last.fm" icon:@"lastfm"]; } @end diff --git a/Preferences/General/PreferencePane.h b/Preferences/General/PreferencePane.h index 8f06dce4d..9b7992e14 100644 --- a/Preferences/General/PreferencePane.h +++ b/Preferences/General/PreferencePane.h @@ -16,6 +16,8 @@ NSImage *icon; } ++ (PreferencePane *)preferencePaneWithView:(NSView *)v name:(NSString *)n icon:(NSString *)i; + - (NSView *)paneView; - (NSString *)paneName; - (NSImage *)paneIcon; @@ -24,8 +26,8 @@ - (BOOL)allowsHorizontalResizing; - (BOOL)allowsVerticalResizing; +- (void)setView:(NSView *)v; - (void)setName:(NSString *)s; - (void)setIcon:(NSString *)i; -- (void)setToolTip:(NSString *)t; @end diff --git a/Preferences/General/PreferencePane.m b/Preferences/General/PreferencePane.m index 78a5cf6c4..e32a36459 100644 --- a/Preferences/General/PreferencePane.m +++ b/Preferences/General/PreferencePane.m @@ -11,6 +11,19 @@ @implementation PreferencePane ++ (PreferencePane *)preferencePaneWithView:(NSView *)v name:(NSString *)n icon:(NSString *)i +{ + PreferencePane *pane = [[[PreferencePane alloc] init] autorelease]; + if (pane) + { + [pane setView:v]; + [pane setName:n]; + [pane setIcon:i]; + } + + return pane; +} + - (NSView *)paneView { return view; @@ -41,11 +54,18 @@ return NO; } -- (void)setName:(NSString *)s +- (void)setView:(NSView *)v { - [s retain]; + [v retain]; + [view release]; + view = v; +} + +- (void)setName:(NSString *)n +{ + [n retain]; [name release]; - name = s; + name = n; } - (void)setIcon:(NSString *)i