Changeset 1073
- Timestamp:
- 01/13/08 22:23:54 (12 months ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 modified
-
Application/PlayApplicationDelegate.h (modified) (1 diff)
-
Application/PlayApplicationDelegate.m (modified) (5 diffs)
-
AudioScrobbler/iScrobbler.h (added)
-
AudioScrobbler/iScrobbler.m (added)
-
English.lproj/GeneralPreferences.nib/classes.nib (modified) (1 diff)
-
English.lproj/GeneralPreferences.nib/info.nib (modified) (1 diff)
-
English.lproj/GeneralPreferences.nib/keyedobjects.nib (modified) (previous)
-
Play.xcodeproj/project.pbxproj (modified) (4 diffs)
-
Preferences/Defaults.plist (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/PlayApplicationDelegate.h
r958 r1073 22 22 #import <Growl/GrowlApplicationBridge.h> 23 23 24 @class AudioLibrary, AudioScrobbler, PTKeyCombo, RemoteControl;24 @class AudioLibrary, AudioScrobbler, iScrobbler, PTKeyCombo, RemoteControl; 25 25 26 26 @interface PlayApplicationDelegate : NSObject <GrowlApplicationBridgeDelegate> 27 27 { 28 AudioScrobbler *_scrobbler; 28 AudioScrobbler *_audioScrobbler; 29 iScrobbler *_iScrobbler; 29 30 RemoteControl *_remoteControl; 30 31 } 31 32 32 33 - (AudioLibrary *) library; 33 - (AudioScrobbler *) scrobbler; 34 - (AudioScrobbler *) audioScrobbler; 35 - (iScrobbler *) iScrobbler; 34 36 35 37 - (IBAction) showPreferences:(id)sender; -
trunk/Application/PlayApplicationDelegate.m
r1053 r1073 25 25 #import "AudioLibrary.h" 26 26 #import "AudioScrobbler.h" 27 #import "iScrobbler.h" 27 28 #import "AudioStream.h" 28 29 #import "AudioMetadataWriter.h" … … 72 73 } 73 74 74 - (AudioScrobbler *) scrobbler75 - (AudioScrobbler *) audioScrobbler 75 76 { 76 77 @synchronized(self) { 77 if(nil == _scrobbler) 78 _scrobbler = [[AudioScrobbler alloc] init]; 79 } 80 return _scrobbler; 78 if(nil == _audioScrobbler) 79 _audioScrobbler = [[AudioScrobbler alloc] init]; 80 } 81 return _audioScrobbler; 82 } 83 84 - (iScrobbler *) iScrobbler 85 { 86 @synchronized(self) { 87 if(nil == _iScrobbler) 88 _iScrobbler = [[iScrobbler alloc] init]; 89 } 90 return _iScrobbler; 81 91 } 82 92 … … 180 190 // Make sure AS receives the STOP command 181 191 if([[NSUserDefaults standardUserDefaults] boolForKey:@"enableAudioScrobbler"]) 182 [[self scrobbler] shutdown]; 192 [[self audioScrobbler] shutdown]; 193 194 // if([[NSUserDefaults standardUserDefaults] boolForKey:@"enableiScrobbler"]) 195 // [[self iScrobbler] shutdown]; 183 196 184 197 // Just unregister for all notifications … … 396 409 397 410 if([[NSUserDefaults standardUserDefaults] boolForKey:@"enableAudioScrobbler"]) 398 [[self scrobbler] start:stream]; 411 [[self audioScrobbler] start:stream]; 412 413 if([[NSUserDefaults standardUserDefaults] boolForKey:@"enableiScrobbler"]) 414 [[self iScrobbler] playbackDidStartForStream:stream]; 399 415 } 400 416 401 417 - (void) playbackDidStop:(NSNotification *)aNotification 402 418 { 419 AudioStream *stream = [[aNotification userInfo] objectForKey:AudioStreamObjectKey]; 420 403 421 if([[NSUserDefaults standardUserDefaults] boolForKey:@"enableAudioScrobbler"]) 404 [[self scrobbler] stop]; 422 [[self audioScrobbler] stop]; 423 424 if([[NSUserDefaults standardUserDefaults] boolForKey:@"enableiScrobbler"]) 425 [[self iScrobbler] playbackDidPauseForStream:stream]; 426 405 427 [self setWindowTitleForStream:nil]; 406 428 } … … 408 430 - (void) playbackDidPause:(NSNotification *)aNotification 409 431 { 432 AudioStream *stream = [[aNotification userInfo] objectForKey:AudioStreamObjectKey]; 433 410 434 if([[NSUserDefaults standardUserDefaults] boolForKey:@"enableAudioScrobbler"]) 411 [[self scrobbler] pause]; 435 [[self audioScrobbler] pause]; 436 437 if([[NSUserDefaults standardUserDefaults] boolForKey:@"enableiScrobbler"]) 438 [[self iScrobbler] playbackDidPauseForStream:stream]; 412 439 } 413 440 414 441 - (void) playbackDidResume:(NSNotification *)aNotification 415 442 { 443 AudioStream *stream = [[aNotification userInfo] objectForKey:AudioStreamObjectKey]; 444 416 445 if([[NSUserDefaults standardUserDefaults] boolForKey:@"enableAudioScrobbler"]) 417 [[self scrobbler] resume]; 446 [[self audioScrobbler] resume]; 447 448 if([[NSUserDefaults standardUserDefaults] boolForKey:@"enableiScrobbler"]) 449 [[self iScrobbler] playbackDidResumeForStream:stream]; 418 450 } 419 451 -
trunk/English.lproj/GeneralPreferences.nib/classes.nib
r652 r1073 1 { 2 IBClasses = ( 3 { 4 ACTIONS = {"" = id; }; 5 CLASS = FirstResponder; 6 LANGUAGE = ObjC; 7 SUPERCLASS = NSObject; 8 }, 9 { 10 ACTIONS = {restoreDefaults = id; }; 11 CLASS = GeneralPreferencesController; 12 LANGUAGE = ObjC; 13 SUPERCLASS = NSWindowController; 14 } 15 ); 16 IBVersion = 1; 17 } 1 <?xml version="1.0" encoding="UTF-8"?> 2 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 3 <plist version="1.0"> 4 <dict> 5 <key>IBClasses</key> 6 <array> 7 <dict> 8 <key>CLASS</key> 9 <string>RBSplitView</string> 10 <key>LANGUAGE</key> 11 <string>ObjC</string> 12 <key>OUTLETS</key> 13 <dict> 14 <key>delegate</key> 15 <string>id</string> 16 </dict> 17 <key>SUPERCLASS</key> 18 <string>RBSplitSubview</string> 19 </dict> 20 <dict> 21 <key>CLASS</key> 22 <string>RBSplitSubview</string> 23 <key>LANGUAGE</key> 24 <string>ObjC</string> 25 <key>SUPERCLASS</key> 26 <string>NSView</string> 27 </dict> 28 <dict> 29 <key>ACTIONS</key> 30 <dict> 31 <key>didAdjustSubviews</key> 32 <string>RBSplitView</string> 33 <key>willAdjustSubviews</key> 34 <string>RBSplitView</string> 35 </dict> 36 <key>CLASS</key> 37 <string>NSObject</string> 38 <key>LANGUAGE</key> 39 <string>ObjC</string> 40 </dict> 41 <dict> 42 <key>ACTIONS</key> 43 <dict> 44 <key>restoreDefaults</key> 45 <string>id</string> 46 </dict> 47 <key>CLASS</key> 48 <string>GeneralPreferencesController</string> 49 <key>LANGUAGE</key> 50 <string>ObjC</string> 51 <key>SUPERCLASS</key> 52 <string>NSWindowController</string> 53 </dict> 54 <dict> 55 <key>ACTIONS</key> 56 <dict> 57 <key></key> 58 <string>id</string> 59 </dict> 60 <key>CLASS</key> 61 <string>FirstResponder</string> 62 <key>LANGUAGE</key> 63 <string>ObjC</string> 64 <key>SUPERCLASS</key> 65 <string>NSObject</string> 66 </dict> 67 </array> 68 <key>IBVersion</key> 69 <string>1</string> 70 </dict> 71 </plist> -
trunk/English.lproj/GeneralPreferences.nib/info.nib
r963 r1073 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">2 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 3 3 <plist version="1.0"> 4 4 <dict> 5 <key>IBDocumentLocation</key>6 <string>90 73 356 240 0 0 1920 1178 </string>7 5 <key>IBFramework Version</key> 8 <string>446.1</string> 6 <string>629</string> 7 <key>IBLastKnownRelativeProjectPath</key> 8 <string>../../Play.xcodeproj</string> 9 <key>IBOldestOS</key> 10 <integer>5</integer> 11 <key>IBOpenObjects</key> 12 <array/> 9 13 <key>IBSystem Version</key> 10 <string>8P135</string> 14 <string>9B18</string> 15 <key>targetFramework</key> 16 <string>IBCocoaFramework</string> 11 17 </dict> 12 18 </plist> -
trunk/Play.xcodeproj/project.pbxproj
r1070 r1073 288 288 8CC1B83C0B7C58E9006BF010 /* DatabaseObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 8CC1B83A0B7C58E9006BF010 /* DatabaseObject.m */; }; 289 289 8CC1BA150B7C70D0006BF010 /* select_playlist_by_id.sql in Resources */ = {isa = PBXBuildFile; fileRef = 8CC1BA140B7C70D0006BF010 /* select_playlist_by_id.sql */; }; 290 8CC86DB60D39EBB400A4E608 /* iScrobbler.m in Sources */ = {isa = PBXBuildFile; fileRef = 8CC86DB50D39EBB400A4E608 /* iScrobbler.m */; }; 290 291 8CDF26D30BEBF8FF00D82E81 /* HighestRatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 8CDF26D10BEBF8FF00D82E81 /* HighestRatedNode.m */; }; 291 292 8CE620DB0C11E8530073ADC3 /* AudioDecoder.m in Sources */ = {isa = PBXBuildFile; fileRef = 8CE620C90C11E8530073ADC3 /* AudioDecoder.m */; }; … … 757 758 8CC1B83A0B7C58E9006BF010 /* DatabaseObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DatabaseObject.m; path = Database/DatabaseObject.m; sourceTree = "<group>"; }; 758 759 8CC1BA140B7C70D0006BF010 /* select_playlist_by_id.sql */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = select_playlist_by_id.sql; path = SQL/select_playlist_by_id.sql; sourceTree = "<group>"; }; 760 8CC86DB40D39EBB400A4E608 /* iScrobbler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = iScrobbler.h; path = AudioScrobbler/iScrobbler.h; sourceTree = "<group>"; }; 761 8CC86DB50D39EBB400A4E608 /* iScrobbler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = iScrobbler.m; path = AudioScrobbler/iScrobbler.m; sourceTree = "<group>"; }; 759 762 8CDE3D8F0C4013A4008E66EB /* generate_svn_revision.sh */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.sh; name = generate_svn_revision.sh; path = Scripts/generate_svn_revision.sh; sourceTree = "<group>"; }; 760 763 8CDF26D00BEBF8FF00D82E81 /* HighestRatedNode.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = HighestRatedNode.h; path = Browser/HighestRatedNode.h; sourceTree = "<group>"; }; … … 1244 1247 8C9C28940B724D5400CE799A /* AudioScrobblerClient.h */, 1245 1248 8C9C28950B724D5400CE799A /* AudioScrobblerClient.m */, 1249 8CC86DB40D39EBB400A4E608 /* iScrobbler.h */, 1250 8CC86DB50D39EBB400A4E608 /* iScrobbler.m */, 1246 1251 ); 1247 1252 name = AudioScrobbler; … … 1985 1990 8CFBD2BB0CD910E6009A57C9 /* MPEGPropertiesReader.m in Sources */, 1986 1991 8C0CF2630CE82D2A0086CAFB /* NSTreeController_Extensions.m in Sources */, 1992 8CC86DB60D39EBB400A4E608 /* iScrobbler.m in Sources */, 1987 1993 ); 1988 1994 runOnlyForDeploymentPostprocessing = 0; -
trunk/Preferences/Defaults.plist
r984 r1073 10 10 <real>1.0</real> 11 11 <key>enableAudioScrobbler</key> 12 <false/> 13 <key>enableiScrobbler</key> 12 14 <true/> 13 15 <key>enableGrowlNotifications</key>
