|
@@ -773,6 +773,12 @@
|
773
|
773
|
|
774
|
774
|
// Check if it is an audio input device
|
775
|
775
|
if ((found == NO) && ([sender tag] == MENU_ITEM_TAG_AUDIO)) {
|
|
776
|
+ // Stop previous timer setting
|
|
777
|
+ if (animation != nil) {
|
|
778
|
+ [animation invalidate];
|
|
779
|
+ animation = nil;
|
|
780
|
+ }
|
|
781
|
+
|
776
|
782
|
found = YES;
|
777
|
783
|
BOOL foundDev = NO;
|
778
|
784
|
NSArray *audioDevices = [EZAudioDevice inputDevices];
|
|
@@ -794,9 +800,25 @@
|
794
|
800
|
break;
|
795
|
801
|
}
|
796
|
802
|
}
|
|
803
|
+
|
797
|
804
|
if (foundDev == NO) {
|
798
|
805
|
NSLog(@"Couldn't find device \"%@\"\n", [sender title]);
|
799
|
806
|
[sender setState:NSOffState];
|
|
807
|
+
|
|
808
|
+ // List available audio input devices and add menu items
|
|
809
|
+ NSArray *inputDevices = [EZAudioDevice inputDevices];
|
|
810
|
+ [menuAudio removeAllItems];
|
|
811
|
+ for (int i = 0; i < [inputDevices count]; i++) {
|
|
812
|
+ EZAudioDevice *dev = [inputDevices objectAtIndex:i];
|
|
813
|
+ NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:[dev name] action:@selector(selectedVisualization:) keyEquivalent:@""];
|
|
814
|
+ [item setTag:MENU_ITEM_TAG_AUDIO];
|
|
815
|
+ if ([[dev name] isEqualToString:[sender title]]) {
|
|
816
|
+ // Found the device the user really wanted
|
|
817
|
+ [self selectedVisualization:item];
|
|
818
|
+ }
|
|
819
|
+ [menuAudio addItem:item];
|
|
820
|
+ }
|
|
821
|
+
|
800
|
822
|
return; // Don't store new mode
|
801
|
823
|
}
|
802
|
824
|
}
|