NSArray *scripts = [[NSFileManager defaultManager] directoryContentsAtPath:[NSHomeDirectory() stringByAppendingPathComponent:@"Library/Application Support/MenuTunes/Scripts"]];
NSEnumerator *scriptsEnum = [scripts objectEnumerator];
NSString *nextScript;
+ ITDebugLog(@"Running AppleScripts for song change.");
while ( (nextScript = [scriptsEnum nextObject]) ) {
NSDictionary *error;
NSAppleScript *currentScript = [[NSAppleScript alloc] initWithContentsOfURL:[NSURL fileURLWithPath:[[NSHomeDirectory() stringByAppendingPathComponent:@"Library/Application Support/MenuTunes/Scripts"] stringByAppendingPathComponent:nextScript]] error:&error];
+ ITDebugLog(@"Running script: %@", nextScript);
if (!currentScript || ![currentScript executeAndReturnError:nil]) {
ITDebugLog(@"Error running script %@.", nextScript);
}
[self setLatestSongIdentifier:[[self currentRemote] playerStateUniqueIdentifier]];
- NSString *artist = [[self currentRemote] currentSongArtist];
- NSString *title = [[self currentRemote] currentSongTitle];
- NSString *toolTip;
- if (artist) {
- toolTip = [NSString stringWithFormat:@"%@ - %@", artist, title];
- } else if (title) {
- toolTip = title;
+ //Create the tooltip for the status item
+ if ( [df boolForKey:@"showToolTip"] ) {
+ NSString *artist = [[self currentRemote] currentSongArtist];
+ NSString *title = [[self currentRemote] currentSongTitle];
+ NSString *toolTip;
+ ITDebugLog(@"Creating status item tooltip.");
+ if (artist) {
+ toolTip = [NSString stringWithFormat:@"%@ - %@", artist, title];
+ } else if (title) {
+ toolTip = title;
+ } else {
+ toolTip = @"No Song Playing";
+ }
+ [statusItem setToolTip:toolTip];
} else {
- toolTip = @"No Song Playing";
+ [statusItem setToolTip:nil];
}
- [statusItem setToolTip:toolTip];
NS_HANDLER
[self networkError:localException];
NS_ENDHANDLER
//
//
+- (MenuController *)menuController
+{
+ return menuController;
+}
+
- (void)closePreferences
{
ITDebugLog(@"Preferences closed.");
NSString *title = nil;
NSString *album = nil;
NSString *artist = nil;
+ NSString *composer = nil;
NSString *time = nil;
NSString *track = nil;
NSImage *art = nil;
NS_ENDHANDLER
}
+ if ( [df boolForKey:@"showComposer"] ) {
+ NS_DURING
+ composer = [[self currentRemote] currentSongComposer];
+ NS_HANDLER
+ [self networkError:localException];
+ NS_ENDHANDLER
+ }
+
if ( [df boolForKey:@"showTime"] ) {
NS_DURING
time = [NSString stringWithFormat:@"%@: %@ / %@",
title:title
album:album
artist:artist
+ composer:composer
time:time
track:track
rating:rating
[super dealloc];
}
-@end
\ No newline at end of file
+@end