+ BOOL rebuildRequired = NO;
+
+ if ( [sender tag] == 1010) {
+ [self setLaunchesAtLogin:SENDER_STATE];
+ } else if ( [sender tag] == 1020) {
+ [df setBool:SENDER_STATE forKey:@"LaunchPlayerWithMT"];
+ } else if ( [sender tag] == 1030) {
+ [df setInteger:[sender intValue] forKey:@"SongsInAdvance"];
+ rebuildRequired = YES;
+ } else if ( [sender tag] == 1040) {
+ // This will not be executed. Song info always shows the title of the song.
+ // [df setBool:SENDER_STATE forKey:@"showName"];
+ // rebuildRequired = YES;
+ } else if ( [sender tag] == 1050) {
+ [df setBool:SENDER_STATE forKey:@"showArtist"];
+ rebuildRequired = YES;
+ } else if ( [sender tag] == 1060) {
+ [df setBool:SENDER_STATE forKey:@"showAlbum"];
+ rebuildRequired = YES;
+ } else if ( [sender tag] == 1070) {
+ [df setBool:SENDER_STATE forKey:@"showTime"];
+ rebuildRequired = YES;
+ } else if ( [sender tag] == 1080) {
+ [df setBool:SENDER_STATE forKey:@"showTrackNumber"];
+ rebuildRequired = YES;
+ } else if ( [sender tag] == 1090) {
+ [df setBool:SENDER_STATE forKey:@"showTrackRating"];
+ rebuildRequired = YES;
+ }
+
+ if ( rebuildRequired ) {
+ [controller rebuildMenu];
+ // redraw song info status window, or upcoming songs here
+ }
+
+ [df synchronize];
+}
+
+- (IBAction)changeStatusWindowSetting:(id)sender
+{
+ if ( [sender tag] == 2010) {
+ [df setInteger:[sender selectedRow] forKey:@"statusWindowVerticalPosition"];
+ [df setInteger:[sender selectedColumn] forKey:@"statusWindowHorizontalPosition"];
+ // update the window's position here
+ } else if ( [sender tag] == 2020) {
+ // update screen selection
+ } else if ( [sender tag] == 2030) {
+ // Update appearance effect
+ } else if ( [sender tag] == 2040) {
+ // Update Vanish Effect
+ } else if ( [sender tag] == 2050) {
+ // Update appearance speed
+ } else if ( [sender tag] == 2060) {
+ // Update vanish speed
+ } else if ( [sender tag] == 2070) {
+ // Update vanish delay
+ } else if ( [sender tag] == 2080) {
+ // Update "Song Info window when song changes" setting.
+ [df setBool:SENDER_STATE forKey:@"showSongInfoOnChange"];
+ }
+}
+
+- (IBAction)changeHotKey:(id)sender
+{
+ switch ([sender tag])
+ {
+ case 4010:
+ [self setKeyCombo:[hotKeysDictionary objectForKey:@"PlayPause"]];
+ [self setCurrentHotKey:@"PlayPause"];
+ break;
+ case 4020:
+ [self setKeyCombo:[hotKeysDictionary objectForKey:@"NextTrack"]];
+ [self setCurrentHotKey:@"NextTrack"];
+ break;
+ case 4030:
+ [self setKeyCombo:[hotKeysDictionary objectForKey:@"PrevTrack"]];
+ [self setCurrentHotKey:@"PrevTrack"];
+ break;
+ case 4035:
+ [self setKeyCombo:[hotKeysDictionary objectForKey:@"ToggleVisualizer"]];
+ [self setCurrentHotKey:@"ToggleVisualizer"];
+ break;
+ case 4040:
+ [self setKeyCombo:[hotKeysDictionary objectForKey:@"ToggleLoop"]];
+ [self setCurrentHotKey:@"ToggleLoop"];
+ break;
+ case 4050:
+ [self setKeyCombo:[hotKeysDictionary objectForKey:@"ToggleShuffle"]];
+ [self setCurrentHotKey:@"ToggleShuffle"];
+ break;
+ case 4060:
+ [self setKeyCombo:[hotKeysDictionary objectForKey:@"TrackInfo"]];
+ [self setCurrentHotKey:@"TrackInfo"];
+ break;
+ case 4070:
+ [self setKeyCombo:[hotKeysDictionary objectForKey:@"UpcomingSongs"]];
+ [self setCurrentHotKey:@"UpcomingSongs"];
+ break;
+ case 4080:
+ [self setKeyCombo:[hotKeysDictionary objectForKey:@"IncrementVolume"]];
+ [self setCurrentHotKey:@"IncrementVolume"];
+ break;
+ case 4090:
+ [self setKeyCombo:[hotKeysDictionary objectForKey:@"DecrementVolume"]];
+ [self setCurrentHotKey:@"DecrementVolume"];
+ break;
+ case 4100:
+ [self setKeyCombo:[hotKeysDictionary objectForKey:@"IncrementRating"]];
+ [self setCurrentHotKey:@"IncrementRating"];
+ break;
+ case 4110:
+ [self setKeyCombo:[hotKeysDictionary objectForKey:@"DecrementRating"]];
+ [self setCurrentHotKey:@"DecrementRating"];
+ break;
+ }
+}
+
+- (void)registerDefaults
+{
+ BOOL found = NO;
+ NSMutableDictionary *loginWindow;
+ NSMutableArray *loginArray;
+ NSEnumerator *loginEnum;
+ id anItem;
+
+ [df setObject:[NSArray arrayWithObjects:
+ @"Play/Pause",
+ @"Next Track",
+ @"Previous Track",
+ @"Fast Forward",
+ @"Rewind",
+ @"Show Player",
+ @"<separator>",
+ @"Upcoming Songs",
+ @"Playlists",
+ @"Song Rating",
+ @"<separator>",
+ @"PreferencesÉ",
+ @"Quit",
+ @"<separator>",
+ @"Current Track Info",
+ nil] forKey:@"menu"];
+
+ [df setInteger:5 forKey:@"SongsInAdvance"];
+ // [df setBool:YES forKey:@"showName"]; // Song info will always show song title.
+ [df setBool:YES forKey:@"showArtist"];
+ [df setBool:NO forKey:@"showAlbum"];
+ [df setBool:NO forKey:@"showTime"];
+
+ [df synchronize];