Added a toggle visualizer hotkey. Not implemented in the prefs fully yet,
authorKent Sutherland <ksuther@ithinksw.com>
Thu, 24 Apr 2003 11:48:37 +0000 (11:48 +0000)
committerKent Sutherland <ksuther@ithinksw.com>
Thu, 24 Apr 2003 11:48:37 +0000 (11:48 +0000)
first I have to fix a hotkey setting crash there.

English.lproj/Preferences.nib/classes.nib
English.lproj/Preferences.nib/keyedobjects.nib
OldMainController.m
PreferencesController.h

index 7401e28..582b1bc 100755 (executable)
@@ -34,6 +34,7 @@
                 trackInfoButton = NSButton; 
                 trackTimeCheckbox = NSButton; 
                 upcomingSongsButton = NSButton; 
+                visualizerButton = NSButton; 
                 volumeDecrementButton = NSButton; 
                 volumeIncrementButton = NSButton; 
                 window = NSWindow; 
index 012254e..b9904a8 100755 (executable)
Binary files a/English.lproj/Preferences.nib/keyedobjects.nib and b/English.lproj/Preferences.nib/keyedobjects.nib differ
index ce163c1..8c6d514 100755 (executable)
         //
         //
         // If we want to show the new track floater, do it here!
-        //[self showCurrentTrackInfo];
+        //[self showCurrentTrackInfoStatusWindow];
         //
         //
         [self rebuildMenu];
     [[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"];
                 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) {
 //
 //
 
-- (void)showCurrentTrackInfo
+- (void)showCurrentTrackInfoStatusWindow
 {
     NSString *trackName = [currentRemote currentSongTitle];
     if (!statusWindow && [trackName length]) {
     }
 }
 
-- (void)showUpcomingSongs
+- (void)showUpcomingSongsStatusWindow
 {
     int curPlaylist = [currentRemote currentPlaylistIndex];
     if (!statusWindow) {
 {
 }
 
+- (void)toggleVisualizer
+{
+    NSLog(@"Visualizer On/Off");
+}
+
 - (void)fadeAndCloseStatusWindow
 {
     [statusWindow orderOut:self];
         //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';
             
         }
index f4f2af4..a593abb 100755 (executable)
@@ -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;