From: Kent Sutherland Date: Thu, 24 Apr 2003 11:48:37 +0000 (+0000) Subject: Added a toggle visualizer hotkey. Not implemented in the prefs fully yet, X-Git-Tag: v1.0~123 X-Git-Url: http://git.ithinksw.org/MenuTunes.git/commitdiff_plain/d0b1fa0c62ff0b511b3a4dc2bf77bf311f2eed94 Added a toggle visualizer hotkey. Not implemented in the prefs fully yet, first I have to fix a hotkey setting crash there. --- diff --git a/English.lproj/Preferences.nib/classes.nib b/English.lproj/Preferences.nib/classes.nib index 7401e28..582b1bc 100755 --- a/English.lproj/Preferences.nib/classes.nib +++ b/English.lproj/Preferences.nib/classes.nib @@ -34,6 +34,7 @@ trackInfoButton = NSButton; trackTimeCheckbox = NSButton; upcomingSongsButton = NSButton; + visualizerButton = NSButton; volumeDecrementButton = NSButton; volumeIncrementButton = NSButton; window = NSWindow; diff --git a/English.lproj/Preferences.nib/keyedobjects.nib b/English.lproj/Preferences.nib/keyedobjects.nib index 012254e..b9904a8 100755 Binary files a/English.lproj/Preferences.nib/keyedobjects.nib and b/English.lproj/Preferences.nib/keyedobjects.nib differ diff --git a/OldMainController.m b/OldMainController.m index ce163c1..8c6d514 100755 --- a/OldMainController.m +++ b/OldMainController.m @@ -513,7 +513,7 @@ // // // If we want to show the new track floater, do it here! - //[self showCurrentTrackInfo]; + //[self showCurrentTrackInfoStatusWindow]; // // [self rebuildMenu]; @@ -653,6 +653,7 @@ [[HotKeyCenter sharedCenter] removeHotKey:@"PlayPause"]; [[HotKeyCenter sharedCenter] removeHotKey:@"NextTrack"]; [[HotKeyCenter sharedCenter] removeHotKey:@"PrevTrack"]; + [[HotKeyCenter sharedCenter] removeHotKey:@"ToggleVisualizer"]; [[HotKeyCenter sharedCenter] removeHotKey:@"TrackInfo"]; [[HotKeyCenter sharedCenter] removeHotKey:@"UpcomingSongs"]; [[HotKeyCenter sharedCenter] removeHotKey:@"ToggleLoop"]; @@ -685,16 +686,22 @@ target:self action:@selector(prevSong:)]; } + if ([defaults objectForKey:@"ToggleVisualizer"] != nil) { + [[HotKeyCenter sharedCenter] addHotKey:@"ToggleVisualizer" + combo:[defaults keyComboForKey:@"ToggleVisualizer"] + target:self action:@selector(toggleVisualizer)]; + } + if ([defaults objectForKey:@"TrackInfo"] != nil) { [[HotKeyCenter sharedCenter] addHotKey:@"TrackInfo" combo:[defaults keyComboForKey:@"TrackInfo"] - target:self action:@selector(showCurrentTrackInfo)]; + target:self action:@selector(showCurrentTrackInfoStatusWindow)]; } if ([defaults objectForKey:@"UpcomingSongs"] != nil) { [[HotKeyCenter sharedCenter] addHotKey:@"UpcomingSongs" combo:[defaults keyComboForKey:@"UpcomingSongs"] - target:self action:@selector(showUpcomingSongs)]; + target:self action:@selector(showUpcomingSongsStatusWindow)]; } if ([defaults objectForKey:@"ToggleLoop"] != nil) { @@ -740,7 +747,7 @@ // // -- (void)showCurrentTrackInfo +- (void)showCurrentTrackInfoStatusWindow { NSString *trackName = [currentRemote currentSongTitle]; if (!statusWindow && [trackName length]) { @@ -796,7 +803,7 @@ } } -- (void)showUpcomingSongs +- (void)showUpcomingSongsStatusWindow { int curPlaylist = [currentRemote currentPlaylistIndex]; if (!statusWindow) { @@ -854,6 +861,11 @@ { } +- (void)toggleVisualizer +{ + NSLog(@"Visualizer On/Off"); +} + - (void)fadeAndCloseStatusWindow { [statusWindow orderOut:self]; @@ -894,10 +906,10 @@ //Space -- ARGH! case 49: { - MenuRef menuRef = _NSGetCarbonMenu([item menu]); + /*MenuRef menuRef = _NSGetCarbonMenu([item menu]); SetMenuItemCommandKey(menuRef, 1, NO, 49); SetMenuItemModifiers(menuRef, 1, kMenuNoCommandModifier); - SetMenuItemKeyGlyph(menuRef, 1, kMenuBlankGlyph); + SetMenuItemKeyGlyph(menuRef, 1, kMenuBlankGlyph);*/ charcode = 'b'; } diff --git a/PreferencesController.h b/PreferencesController.h index f4f2af4..a593abb 100755 --- a/PreferencesController.h +++ b/PreferencesController.h @@ -37,6 +37,7 @@ IBOutlet NSButton *trackInfoButton; IBOutlet NSButton *trackTimeCheckbox; IBOutlet NSButton *upcomingSongsButton; + IBOutlet NSButton *visualizerButton; IBOutlet NSButton *volumeDecrementButton; IBOutlet NSButton *volumeIncrementButton; IBOutlet NSWindow *window; @@ -51,6 +52,7 @@ KeyCombo *playPauseCombo; KeyCombo *nextTrackCombo; KeyCombo *prevTrackCombo; + KeyCombo *visualizerCombo; KeyCombo *trackInfoCombo; KeyCombo *upcomingSongsCombo; KeyCombo *volumeIncrementCombo;