From 3125740f0f4e5217f93087bc5f4da060cbe83f58 Mon Sep 17 00:00:00 2001 From: vspader Date: Mon, 19 Feb 2007 00:42:12 +0000 Subject: [PATCH] Added preference pane for remote. Gives the option to make remote global or not. --- AppController.m | 30 +++++++++++++++--- .../English.lproj/Preferences.nib/classes.nib | 13 +++++++- .../English.lproj/Preferences.nib/info.nib | 11 ++++--- .../Preferences.nib/keyedobjects.nib | Bin 7272 -> 8343 bytes .../General/General.xcodeproj/project.pbxproj | 10 ++++++ Preferences/General/PrefPaneController.h | 5 ++- Preferences/General/PrefPaneController.m | 7 +++- Preferences/General/RemotePane.h | 19 +++++++++++ Preferences/General/RemotePane.m | 27 ++++++++++++++++ 9 files changed, 110 insertions(+), 12 deletions(-) create mode 100644 Preferences/General/RemotePane.h create mode 100644 Preferences/General/RemotePane.m diff --git a/AppController.m b/AppController.m index 3c5d99d49..3de231139 100644 --- a/AppController.m +++ b/AppController.m @@ -25,11 +25,17 @@ // Listen to the remote in exclusive mode, only when Cog is the active application - (void)applicationDidBecomeActive:(NSNotification *)notification { - [remote startListening: self]; + BOOL onlyOnActive = [[[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"remoteOnlyOnActive"] boolValue]; + if (onlyOnActive) { + [remote startListening: self]; + } } - (void)applicationDidResignActive:(NSNotification *)motification { - [remote stopListening: self]; + BOOL onlyOnActive = [[[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"remoteOnlyOnActive"] boolValue]; + if (onlyOnActive) { + [remote stopListening: self]; + } } /* Helper method for the remote control interface in order to trigger forward/backward and volume @@ -179,9 +185,6 @@ increase/decrease as long as the user holds the left/right, plus/minus button */ - (void)awakeFromNib { -// [self initDefaults]; - - // DBLog(@"AWAKe"); [playButton setToolTip:NSLocalizedString(@"PlayButtonTooltip", @"")]; [prevButton setToolTip:NSLocalizedString(@"PrevButtonTooltip", @"")]; [nextButton setToolTip:NSLocalizedString(@"NextButtonTooltip", @"")]; @@ -200,6 +203,10 @@ increase/decrease as long as the user holds the left/right, plus/minus button */ [self registerHotKeys]; + //Init Remote + + + NSString *filename = @"~/Library/Application Support/Cog/Default.playlist"; [playlistController loadPlaylist:[filename stringByExpandingTildeInPath]]; } @@ -336,6 +343,7 @@ increase/decrease as long as the user holds the left/right, plus/minus button */ - (void)initDefaults { NSMutableDictionary *userDefaultsValuesDict = [NSMutableDictionary dictionary]; + [userDefaultsValuesDict setObject:[NSNumber numberWithInt:35] forKey:@"hotKeyPlayKeyCode"]; [userDefaultsValuesDict setObject:[NSNumber numberWithInt:(NSControlKeyMask|NSCommandKeyMask)] forKey:@"hotKeyPlayModifiers"]; [userDefaultsValuesDict setObject:[NSNumber numberWithInt:'P'] forKey:@"hotKeyPlayCharacter"]; @@ -350,6 +358,8 @@ increase/decrease as long as the user holds the left/right, plus/minus button */ [userDefaultsValuesDict setObject:[@"~/Music" stringByExpandingTildeInPath] forKey:@"fileDrawerRootPath"]; + [userDefaultsValuesDict setObject:[NSNumber numberWithBool:YES] forKey:@"remoteOnlyOnActive"]; + //Register and sync defaults [[NSUserDefaults standardUserDefaults] registerDefaults:userDefaultsValuesDict]; [[NSUserDefaults standardUserDefaults] synchronize]; @@ -378,6 +388,16 @@ increase/decrease as long as the user holds the left/right, plus/minus button */ else if ([keyPath isEqualToString:@"values.fileDrawerRootPath"]) { [fileTreeController setRootPath:[[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"fileDrawerRootPath"]]; } + else if ([keyPath isEqualToString:@"values.remoteOnlyOnActive"]) { + BOOL onlyOnActive = [[[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"remoteOnlyOnActive"] boolValue]; + if (!onlyOnActive || [NSApp isActive]) { + [remote startListening: self]; + } + if (onlyOnActive && ![NSApp isActive]) { //Setting a preference without being active? *shrugs* + [remote stopListening: self]; + } + } + } - (void)registerHotKeys diff --git a/Preferences/General/English.lproj/Preferences.nib/classes.nib b/Preferences/General/English.lproj/Preferences.nib/classes.nib index 9f01cf40d..72cf708ff 100644 --- a/Preferences/General/English.lproj/Preferences.nib/classes.nib +++ b/Preferences/General/English.lproj/Preferences.nib/classes.nib @@ -29,7 +29,11 @@ { CLASS = PrefPaneController; LANGUAGE = ObjC; - OUTLETS = {fileDrawerPane = FileDrawerPane; hotKeyPane = HotKeyPane; }; + OUTLETS = { + fileDrawerPane = FileDrawerPane; + hotKeyPane = HotKeyPane; + remotePane = RemotePane; + }; SUPERCLASS = NSObject; }, { @@ -37,6 +41,13 @@ LANGUAGE = ObjC; OUTLETS = {view = NSView; }; SUPERCLASS = NSObject; + }, + { + ACTIONS = {takeBool = id; }; + CLASS = RemotePane; + LANGUAGE = ObjC; + OUTLETS = {onlyOnActive = NSButton; }; + SUPERCLASS = PreferencePane; } ); IBVersion = 1; diff --git a/Preferences/General/English.lproj/Preferences.nib/info.nib b/Preferences/General/English.lproj/Preferences.nib/info.nib index 35c4bff4d..22f69960d 100644 --- a/Preferences/General/English.lproj/Preferences.nib/info.nib +++ b/Preferences/General/English.lproj/Preferences.nib/info.nib @@ -3,22 +3,25 @@ IBDocumentLocation - 137 120 356 240 0 0 1680 1028 + 202 336 356 240 0 0 1680 1028 IBEditorPositions 10 - 499 669 506 102 0 0 1680 1028 + 587 659 506 102 0 0 1680 1028 11 703 634 273 151 0 0 1680 1028 + 43 + 671 662 337 96 0 0 1680 1028 IBFramework Version 446.1 IBOpenObjects - 11 10 + 43 + 11 IBSystem Version - 8K1106 + 8L2127 diff --git a/Preferences/General/English.lproj/Preferences.nib/keyedobjects.nib b/Preferences/General/English.lproj/Preferences.nib/keyedobjects.nib index c126c7efa602b3e3ed351668c2480abd2eb62a69..e26c324484b5b3263523011a7201f3ddb37271e4 100644 GIT binary patch literal 8343 zcma)B34Bx4(w}oq_Vs4DH#dM%u&h?-#$JUMC?Ze_fkI26hBmZ;(3CW7fl@f)@&w#) zL!Pp=ATB5(g1GPdhJb7$s36KFioW+$1ircVrUgVlZGK5^lDRW;X8!Y^Ij57WBH`+I zYU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yYb(%U|ouSTB=cx14`RW37p}JUI zs@|`zP*H>%I8FREMAt?G7lr}~Qenz~DUQ+-?A zt?p6xs{7Ra>WAt<^^kg4J)(ZD9#xO2U#iE|6Y5FzlzLh{tA4MZQ_rhECE(^LflF{E fxDtefrU}<1G*3uMXb<{_Qsc^L2V#vr3Eln+teB+c diff --git a/Preferences/General/General.xcodeproj/project.pbxproj b/Preferences/General/General.xcodeproj/project.pbxproj index 0d9fa75c5..28685d58d 100644 --- a/Preferences/General/General.xcodeproj/project.pbxproj +++ b/Preferences/General/General.xcodeproj/project.pbxproj @@ -7,6 +7,8 @@ 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 */; }; 8D5B49B0048680CD000E48DA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C167DFE841241C02AAC07 /* InfoPlist.strings */; }; 8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */; }; 8E07AA870AAC8EA200A4B32F /* FileDrawerPane.m in Sources */ = {isa = PBXBuildFile; fileRef = 8E07AA7F0AAC8EA200A4B32F /* FileDrawerPane.m */; }; @@ -27,6 +29,9 @@ 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 = ""; }; 32DBCF630370AF2F00C91783 /* General_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = General_Prefix.pch; sourceTree = ""; }; 8D5B49B6048680CD000E48DA /* General.preferencePane */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = General.preferencePane; sourceTree = BUILT_PRODUCTS_DIR; }; 8D5B49B7048680CD000E48DA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = Info.plist; sourceTree = ""; }; @@ -137,6 +142,8 @@ 8E07AA7F0AAC8EA200A4B32F /* FileDrawerPane.m */, 8E07AA800AAC8EA200A4B32F /* HotKeyPane.h */, 8E07AA810AAC8EA200A4B32F /* HotKeyPane.m */, + 172D72460B891FEF00D095BB /* RemotePane.h */, + 172D72470B891FEF00D095BB /* RemotePane.m */, ); name = Panes; sourceTree = ""; @@ -173,6 +180,7 @@ 8E07ABD90AAC95AF00A4B32F /* Icons */ = { isa = PBXGroup; children = ( + 172D72AC0B8926CA00D095BB /* apple_remote.png */, 8E07ABDA0AAC95BC00A4B32F /* file_drawer.png */, 8E07ABDB0AAC95BC00A4B32F /* hot_keys.png */, ); @@ -224,6 +232,7 @@ 8E07ABDC0AAC95BC00A4B32F /* file_drawer.png in Resources */, 8E07ABDD0AAC95BC00A4B32F /* hot_keys.png in Resources */, 8E07AC050AAC968C00A4B32F /* Preferences.nib in Resources */, + 172D72AD0B8926CA00D095BB /* apple_remote.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -241,6 +250,7 @@ 8E6C12160AACAE4100819171 /* NDHotKeyControl.m in Sources */, 8E6C12170AACAE4100819171 /* NDHotKeyEvent.m in Sources */, 8E6C13A00AACBAB500819171 /* HotKeyControl.m in Sources */, + 172D72480B891FEF00D095BB /* RemotePane.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Preferences/General/PrefPaneController.h b/Preferences/General/PrefPaneController.h index 3af4f9a26..955385239 100644 --- a/Preferences/General/PrefPaneController.h +++ b/Preferences/General/PrefPaneController.h @@ -11,13 +11,16 @@ #import "HotKeyPane.h" #import "FileDrawerPane.h" +#import "RemotePane.h" @interface PrefPaneController : NSObject { IBOutlet HotKeyPane *hotKeyPane; IBOutlet FileDrawerPane *fileDrawerPane; + IBOutlet RemotePane *remotePane; } -- (FileDrawerPane *)fileDrawerPane; - (HotKeyPane *)hotKeyPane; +- (FileDrawerPane *)fileDrawerPane; +- (RemotePane *)remotePane; @end diff --git a/Preferences/General/PrefPaneController.m b/Preferences/General/PrefPaneController.m index 71f7740a6..85ebbc161 100644 --- a/Preferences/General/PrefPaneController.m +++ b/Preferences/General/PrefPaneController.m @@ -18,7 +18,7 @@ PrefPaneController *prefPaneController = [[PrefPaneController alloc] init]; loaded = [NSBundle loadNibNamed:@"Preferences" owner:prefPaneController]; - return [NSArray arrayWithObjects: [prefPaneController hotKeyPane], [prefPaneController fileDrawerPane], nil]; + return [NSArray arrayWithObjects: [prefPaneController hotKeyPane], [prefPaneController fileDrawerPane], [prefPaneController remotePane], nil]; } - (HotKeyPane *)hotKeyPane @@ -31,4 +31,9 @@ return fileDrawerPane; } +- (RemotePane *)remotePane +{ + return remotePane; +} + @end diff --git a/Preferences/General/RemotePane.h b/Preferences/General/RemotePane.h new file mode 100644 index 000000000..edf0b1f95 --- /dev/null +++ b/Preferences/General/RemotePane.h @@ -0,0 +1,19 @@ +// +// FileDrawerPane.h +// Preferences +// +// Created by Vincent Spader on 9/4/06. +// Copyright 2006 Vincent Spader. All rights reserved. +// + +#import +#import "PreferencePane.h" + + +@interface RemotePane : PreferencePane { + IBOutlet NSButton *onlyOnActive; +} + +- (IBAction)takeBool:(id)sender; + +@end diff --git a/Preferences/General/RemotePane.m b/Preferences/General/RemotePane.m new file mode 100644 index 000000000..095a6eabd --- /dev/null +++ b/Preferences/General/RemotePane.m @@ -0,0 +1,27 @@ +// +// FileDrawerPane.m +// Preferences +// +// Created by Vincent Spader on 9/4/06. +// Copyright 2006 Vincent Spader. All rights reserved. +// + +#import "RemotePane.h" + + +@implementation RemotePane + +- (void)awakeFromNib +{ + [self setName:@"Remote"]; + [self setIcon:@"apple_remote"]; + + [onlyOnActive setState:[[[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"remoteOnlyOnActive"] boolValue]]; +} + +- (IBAction)takeBool:(id)sender +{ + [[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithBool:[onlyOnActive state]] forKey:@"remoteOnlyOnActive"]; +} + +@end