Reworked preferences a little to make it easier for simple panes.

Added Growl notifications for when a song is played, or when the song changes.
CQTexperiment
vspader 2007-02-28 00:35:27 +00:00
parent f6e79d6132
commit 47fa30dc58
12 changed files with 104 additions and 82 deletions

View File

@ -2,6 +2,8 @@
#import <Cocoa/Cocoa.h>
#import <Growl/GrowlApplicationBridge.h>
#import "CogAudio/AudioPlayer.h"
#import "PlaylistController.h"
#import "TrackingSlider.h"
@ -9,7 +11,7 @@
@class PlaylistView;
@interface PlaybackController : NSObject
@interface PlaybackController : NSObject <GrowlApplicationBridgeDelegate>
{
IBOutlet PlaylistController *playlistController;
IBOutlet PlaylistView *playlistView;

View File

@ -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

View File

@ -1,6 +1,7 @@
typedef enum
{
kCogPluginCodec = 1,
kCogPluginGeneral
} PluginType;
@protocol CogPlugin

View File

@ -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 = "<group>"; };
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
1705F1420B8BCB0C00C8B40D /* Help */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Help; sourceTree = "<group>"; };
170680620B950158006BA573 /* Growl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Growl.framework; path = ThirdParty/Frameworks/Growl.framework; sourceTree = "<group>"; };
171678BD0AC8C39E00C28CF3 /* SmartFolderNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SmartFolderNode.h; sourceTree = "<group>"; };
171678BE0AC8C39E00C28CF3 /* SmartFolderNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SmartFolderNode.m; sourceTree = "<group>"; };
1766C68E0B911DF1004A7AE4 /* AudioScrobbler.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AudioScrobbler.h; sourceTree = "<group>"; };
@ -235,8 +234,6 @@
17BB5CF70B8A86350009ACB1 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = "<absolute>"; };
17BB5CF80B8A86350009ACB1 /* CoreAudioKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudioKit.framework; path = /System/Library/Frameworks/CoreAudioKit.framework; sourceTree = "<absolute>"; };
17BB5EA50B8A87850009ACB1 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = "<absolute>"; };
17D21DF30B8BE86900D1EBDE /* CoreAudioUtils.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CoreAudioUtils.h; sourceTree = "<group>"; };
17D21DF40B8BE86900D1EBDE /* CoreAudioUtils.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = CoreAudioUtils.m; sourceTree = "<group>"; };
17F94CC10B8D08FB00A34E87 /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Sparkle.framework; path = ThirdParty/Frameworks/Sparkle.framework; sourceTree = "<group>"; };
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
29B97319FDCFA39411CA2CEA /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/MainMenu.nib; sourceTree = "<group>"; };
@ -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 = "<group>";
};
177EBF800B8BC2A70000BC8C /* CoreAudioUtils */ = {
isa = PBXGroup;
children = (
);
path = CoreAudioUtils;
sourceTree = "<group>";
};
177EBF850B8BC2A70000BC8C /* ImageTextCell */ = {
isa = PBXGroup;
children = (
@ -527,15 +517,6 @@
name = PlugIns;
sourceTree = "<group>";
};
17D21DF20B8BE86900D1EBDE /* CoreAudioUtils */ = {
isa = PBXGroup;
children = (
17D21DF30B8BE86900D1EBDE /* CoreAudioUtils.h */,
17D21DF40B8BE86900D1EBDE /* CoreAudioUtils.m */,
);
path = CoreAudioUtils;
sourceTree = "<group>";
};
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 */,
);

View File

@ -45,9 +45,9 @@
fileDrawerPane = FileDrawerPane;
hotKeyPane = HotKeyPane;
outputPane = OutputPane;
remotePane = RemotePane;
scrobblerPane = ScrobblerPane;
updatesPane = UpdatesPane;
remoteView = NSView;
scrobblerView = NSView;
updatesView = NSView;
};
SUPERCLASS = NSObject;
},

View File

@ -7,28 +7,31 @@
<key>IBEditorPositions</key>
<dict>
<key>10</key>
<string>144 608 506 102 0 0 1440 878 </string>
<string>562 607 506 102 0 0 1680 1028 </string>
<key>102</key>
<string>762 667 248 96 0 0 1680 1028 </string>
<key>11</key>
<string>619 592 400 151 0 0 1440 878 </string>
<string>640 634 400 151 0 0 1680 1028 </string>
<key>43</key>
<string>103 395 400 116 0 0 1440 878 </string>
<string>640 652 400 116 0 0 1680 1028 </string>
<key>50</key>
<string>527 303 400 96 0 0 1440 878 </string>
<string>640 662 400 96 0 0 1680 1028 </string>
<key>58</key>
<string>154 210 411 101 0 0 1440 878 </string>
<string>614 441 411 101 0 0 1680 1028 </string>
<key>85</key>
<string>757 432 452 116 0 0 1440 878 </string>
<string>614 652 452 116 0 0 1680 1028 </string>
</dict>
<key>IBFramework Version</key>
<string>446.1</string>
<key>IBOpenObjects</key>
<array>
<integer>58</integer>
<integer>102</integer>
<integer>85</integer>
<integer>43</integer>
<integer>50</integer>
<integer>11</integer>
<integer>10</integer>
<integer>58</integer>
<integer>85</integer>
</array>
<key>IBSystem Version</key>
<string>8L2127</string>

View File

@ -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 = "<group>"; };
089C167FFE841241C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
172D72460B891FEF00D095BB /* RemotePane.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RemotePane.h; sourceTree = "<group>"; };
172D72470B891FEF00D095BB /* RemotePane.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = RemotePane.m; sourceTree = "<group>"; };
172D72AC0B8926CA00D095BB /* apple_remote.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = apple_remote.png; path = Icons/apple_remote.png; sourceTree = "<group>"; };
1766C73B0B9126E7004A7AE4 /* ScrobblerPane.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ScrobblerPane.h; sourceTree = "<group>"; };
1766C73C0B9126E7004A7AE4 /* ScrobblerPane.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = ScrobblerPane.m; sourceTree = "<group>"; };
1766C7A70B912A71004A7AE4 /* lastfm.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = lastfm.png; path = Icons/lastfm.png; sourceTree = "<group>"; };
17C643360B8A77CC00C53518 /* OutputsArrayController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = OutputsArrayController.m; sourceTree = "<group>"; };
17C643370B8A77CC00C53518 /* OutputsArrayController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = OutputsArrayController.h; sourceTree = "<group>"; };
@ -64,8 +57,6 @@
8E07ABDA0AAC95BC00A4B32F /* file_drawer.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = file_drawer.png; path = Icons/file_drawer.png; sourceTree = "<group>"; };
8E07ABDB0AAC95BC00A4B32F /* hot_keys.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = hot_keys.png; path = Icons/hot_keys.png; sourceTree = "<group>"; };
8E07AC040AAC968C00A4B32F /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/Preferences.nib; sourceTree = "<group>"; };
8E15A8340B8944C4006DC802 /* UpdatesPane.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = UpdatesPane.h; sourceTree = "<group>"; };
8E15A8350B8944C4006DC802 /* UpdatesPane.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = UpdatesPane.m; sourceTree = "<group>"; };
8E15A86B0B894768006DC802 /* updates.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = updates.png; path = Icons/updates.png; sourceTree = "<group>"; };
8E6C12120AACAE4100819171 /* NDHotKeyControl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = NDHotKeyControl.h; sourceTree = "<group>"; };
8E6C12130AACAE4100819171 /* NDHotKeyControl.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = NDHotKeyControl.m; sourceTree = "<group>"; };
@ -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 = "<group>";
@ -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;
};

View File

@ -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 <SS_PreferencePaneProtocol> {
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

View File

@ -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

View File

@ -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

View File

@ -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