Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

s/\t/ /g

  • Loading branch information...
commit 692b10812ca6b0ae0c93a96875e0f6162ae49348 1 parent efe17c4
@pje authored
Showing with 3,884 additions and 3,884 deletions.
  1. +30 −30 SoundflowerBed/AppController.h
  2. +907 −907 SoundflowerBed/AppController.mm
  3. +89 −89 SoundflowerBed/AudioDevice.cpp
  4. +57 −57 SoundflowerBed/AudioDevice.h
  5. +58 −58 SoundflowerBed/AudioDeviceList.cpp
  6. +47 −47 SoundflowerBed/AudioDeviceList.h
  7. +135 −135 SoundflowerBed/AudioRingBuffer.cpp
  8. +49 −49 SoundflowerBed/AudioRingBuffer.h
  9. +350 −350 SoundflowerBed/AudioThruEngine.cpp
  10. +135 −135 SoundflowerBed/AudioThruEngine.h
  11. +37 −37 SoundflowerBed/HelpWindowController.h
  12. +34 −34 SoundflowerBed/HelpWindowController.m
  13. +3 −3 SoundflowerBed/Soundflowerbed.h
  14. +406 −406 SoundflowerBed/Soundflowerbed.m
  15. +32 −32 SoundflowerBed/main.m
  16. +10 −10 Soundfly/1.0.2/SFCommon.h
  17. +45 −45 Soundfly/1.0.2/SFCommon.m
  18. +4 −4 Soundfly/1.0.2/SFReceiver.h
  19. +100 −100 Soundfly/1.0.2/SFReceiver.m
  20. +5 −5 Soundfly/1.0.2/SFSender.h
  21. +184 −184 Soundfly/1.0.2/SFSender.m
  22. +2 −2 Soundfly/2.0/SFAUModule.h
  23. +2 −2 Soundfly/2.0/SFClosingWindow.m
  24. +15 −15 Soundfly/2.0/SFCommunicationManager.m
  25. +24 −24 Soundfly/2.0/SFDaemonController.m
  26. +3 −3 Soundfly/2.0/SFDaemonManager.h
  27. +113 −113 Soundfly/2.0/SFDaemonManager.m
  28. +1 −1  Soundfly/2.0/SFLinkTextField.h
  29. +37 −37 Soundfly/2.0/SFLinkTextField.m
  30. +2 −2 Soundfly/2.0/SFPrefPaneAppController.h
  31. +39 −39 Soundfly/2.0/SFPrefPaneAppController.m
  32. +3 −3 Soundfly/2.0/SFPreferencePane.h
  33. +50 −50 Soundfly/2.0/SFPreferencePane.m
  34. +1 −1  Soundfly/2.0/SFPreferencesManager.h
  35. +89 −89 Soundfly/2.0/SFPreferencesManager.m
  36. +4 −4 Soundfly/2.0/SFReceiver.h
  37. +81 −81 Soundfly/2.0/SFReceiver.m
  38. +5 −5 Soundfly/2.0/SFSender.h
  39. +149 −149 Soundfly/2.0/SFSender.m
  40. +1 −1  Soundfly/2.0/SFStatusItemController.h
  41. +42 −42 Soundfly/2.0/SFStatusItemController.m
  42. +12 −12 Soundfly/2.0/SFUtils.m
  43. +2 −2 Soundfly/2.0/SFVersionTextField.h
  44. +28 −28 Soundfly/2.0/SFVersionTextField.m
  45. +96 −96 Source/SoundflowerDevice.cpp
  46. +24 −24 Source/SoundflowerDevice.h
  47. +309 −309 Source/SoundflowerEngine.cpp
  48. +33 −33 Source/SoundflowerEngine.h
View
60 SoundflowerBed/AppController.h
@@ -7,36 +7,36 @@
@interface AppController : NSObject
{
- NSStatusItem *mSbItem;
- NSMenu *mMenu;
- NSMenuItem *m2chMenu;
- NSMenuItem *m16chMenu;
- NSMenu *m2chBuffer;
- NSMenu *m16chBuffer;
-
- BOOL menuItemVisible;
- int m16StartIndex;
-
- NSMenuItem *mCur2chDevice;
- NSMenuItem *mCur16chDevice;
- NSMenuItem *mCur2chBufferSize;
- NSMenuItem *mCur16chBufferSize;
-
- NSMenuItem *mSuspended2chDevice;
- NSMenuItem *mSuspended16chDevice;
-
- AudioDeviceID mSoundflower2Device;
- AudioDeviceID mSoundflower16Device;
-
- AudioDeviceList * mOutputDeviceList;
-
- UInt32 mNchnls2;
- UInt32 mNchnls16;
-
- UInt32 mMenuID2[64];
- UInt32 mMenuID16[64];
-
- IBOutlet HelpWindowController *mAboutController;
+ NSStatusItem *mSbItem;
+ NSMenu *mMenu;
+ NSMenuItem *m2chMenu;
+ NSMenuItem *m16chMenu;
+ NSMenu *m2chBuffer;
+ NSMenu *m16chBuffer;
+
+ BOOL menuItemVisible;
+ int m16StartIndex;
+
+ NSMenuItem *mCur2chDevice;
+ NSMenuItem *mCur16chDevice;
+ NSMenuItem *mCur2chBufferSize;
+ NSMenuItem *mCur16chBufferSize;
+
+ NSMenuItem *mSuspended2chDevice;
+ NSMenuItem *mSuspended16chDevice;
+
+ AudioDeviceID mSoundflower2Device;
+ AudioDeviceID mSoundflower16Device;
+
+ AudioDeviceList * mOutputDeviceList;
+
+ UInt32 mNchnls2;
+ UInt32 mNchnls16;
+
+ UInt32 mMenuID2[64];
+ UInt32 mMenuID16[64];
+
+ IBOutlet HelpWindowController *mAboutController;
}
- (IBAction)suspend;
View
1,814 SoundflowerBed/AppController.mm
@@ -1,4 +1,4 @@
-/*
+/*
*/
#import "AppController.h"
@@ -7,145 +7,145 @@
@implementation AppController
-AudioThruEngine *gThruEngine2 = NULL;
-AudioThruEngine *gThruEngine16 = NULL;
+AudioThruEngine *gThruEngine2 = NULL;
+AudioThruEngine *gThruEngine16 = NULL;
Boolean startOnAwake = false;
-void CheckErr(OSStatus err)
+void CheckErr(OSStatus err)
{
- if (err) {
- printf("error %-4.4s %i\n", (char *)&err, (int)err);
- throw 1;
- }
+ if (err) {
+ printf("error %-4.4s %i\n", (char *)&err, (int)err);
+ throw 1;
+ }
}
-OSStatus HardwareListenerProc ( AudioHardwarePropertyID inPropertyID,
- void* inClientData)
+OSStatus HardwareListenerProc ( AudioHardwarePropertyID inPropertyID,
+ void* inClientData)
{
- AppController *app = (AppController *)inClientData;
-printf("HardwareListenerProc\n");
+ AppController *app = (AppController *)inClientData;
+printf("HardwareListenerProc\n");
switch(inPropertyID)
- {
+ {
case kAudioHardwarePropertyDevices:
-// printf("kAudioHardwarePropertyDevices\n");
-
- // An audio device has been added or removed to the system, so lets just start over
- [NSThread detachNewThreadSelector:@selector(refreshDevices) toTarget:app withObject:nil];
+// printf("kAudioHardwarePropertyDevices\n");
+
+ // An audio device has been added or removed to the system, so lets just start over
+ [NSThread detachNewThreadSelector:@selector(refreshDevices) toTarget:app withObject:nil];
break;
-
+
case kAudioHardwarePropertyIsInitingOrExiting:
-// printf("kAudioHardwarePropertyIsInitingOrExiting\n");
+// printf("kAudioHardwarePropertyIsInitingOrExiting\n");
// A UInt32 whose value will be non-zero if the HAL is either in the midst of
//initializing or in the midst of exiting the process.
break;
-
+
case kAudioHardwarePropertySleepingIsAllowed:
-// printf("kAudioHardwarePropertySleepingIsAllowed\n");
+// printf("kAudioHardwarePropertySleepingIsAllowed\n");
// A UInt32 where 1 means that the process will allow the CPU to idle sleep
// even if there is audio IO in progress. A 0 means that the CPU will not be
// allowed to idle sleep. Note that this property won't affect when the CPU is
// forced to sleep.
break;
-
+
case kAudioHardwarePropertyUnloadingIsAllowed:
-// printf("kAudioHardwarePropertyUnloadingIsAllowed\n");
+// printf("kAudioHardwarePropertyUnloadingIsAllowed\n");
// A UInt32 where 1 means that this process wants the HAL to unload itself
// after a period of inactivity where there are no IOProcs and no listeners
// registered with any AudioObject.
- break;
+ break;
}
-
+
return (noErr);
}
-OSStatus DeviceListenerProc ( AudioDeviceID inDevice,
+OSStatus DeviceListenerProc ( AudioDeviceID inDevice,
UInt32 inChannel,
Boolean isInput,
AudioDevicePropertyID inPropertyID,
void* inClientData)
{
- AppController *app = (AppController *)inClientData;
-
+ AppController *app = (AppController *)inClientData;
+
switch(inPropertyID)
- {
+ {
case kAudioDevicePropertyNominalSampleRate:
- //printf("kAudioDevicePropertyNominalSampleRate\n");
- if (isInput) {
- //printf("soundflower device potential sample rate change\n");
- if (gThruEngine2->IsRunning() && gThruEngine2->GetInputDevice() == inDevice)
- [NSThread detachNewThreadSelector:@selector(srChanged2ch) toTarget:app withObject:nil];
- else if (gThruEngine16->IsRunning() && gThruEngine16->GetInputDevice() == inDevice)
- [NSThread detachNewThreadSelector:@selector(srChanged16ch) toTarget:app withObject:nil];
- }
- else {
- if (inChannel == 0) {
- //printf("non-soundflower device potential sample rate change\n");
- if (gThruEngine2->IsRunning() && gThruEngine2->GetOutputDevice() == inDevice)
- [NSThread detachNewThreadSelector:@selector(srChanged2chOutput) toTarget:app withObject:nil];
- else if (gThruEngine16->IsRunning() && gThruEngine16->GetOutputDevice() == inDevice)
- [NSThread detachNewThreadSelector:@selector(srChanged16chOutput) toTarget:app withObject:nil];
- }
- }
- break;
-
- case kAudioDevicePropertyDeviceIsAlive:
-// printf("kAudioDevicePropertyDeviceIsAlive\n");
- break;
-
- case kAudioDevicePropertyDeviceHasChanged:
-// printf("kAudioDevicePropertyDeviceHasChanged\n");
- break;
-
- case kAudioDevicePropertyDataSource:
- // printf("DeviceListenerProc : HEADPHONES! \n");
- if (gThruEngine2->IsRunning() && gThruEngine2->GetOutputDevice() == inDevice)
- [NSThread detachNewThreadSelector:@selector(srChanged2chOutput) toTarget:app withObject:nil];
- else if (gThruEngine16->IsRunning() && gThruEngine16->GetOutputDevice() == inDevice)
- [NSThread detachNewThreadSelector:@selector(srChanged16chOutput) toTarget:app withObject:nil];
- break;
-
- case kAudioDevicePropertyDeviceIsRunning:
-// printf("kAudioDevicePropertyDeviceIsRunning\n");
- break;
-
- case kAudioDeviceProcessorOverload:
-// printf("kAudioDeviceProcessorOverload\n");
- break;
-
- case kAudioDevicePropertyAvailableNominalSampleRates:
- //printf("kAudioDevicePropertyAvailableNominalSampleRates\n");
- break;
-
- case kAudioStreamPropertyPhysicalFormat:
- //printf("kAudioStreamPropertyPhysicalFormat\n");
- break;
- case kAudioDevicePropertyStreamFormat:
- //printf("kAudioDevicePropertyStreamFormat\n");
- break;
-
- case kAudioDevicePropertyStreams:
- //printf("kAudioDevicePropertyStreams\n");
- case kAudioDevicePropertyStreamConfiguration:
- //printf("kAudioDevicePropertyStreamConfiguration\n");
- if (!isInput) {
- if (inChannel == 0) {
- if (gThruEngine2->GetOutputDevice() == inDevice || gThruEngine16->GetOutputDevice() == inDevice) {
- //printf("non-soundflower device potential # of chnls change\n");
- [NSThread detachNewThreadSelector:@selector(checkNchnls) toTarget:app withObject:nil];
- }
- else // this could be an aggregate device in the middle of constructing, going from/to 0 chans & we need to add/remove to menu
- [NSThread detachNewThreadSelector:@selector(refreshDevices) toTarget:app withObject:nil];
- }
- }
- break;
-
- default:
- //printf("unsupported notification:%s\n", (char*)inPropertyID);
- break;
- }
-
- return noErr;
+ //printf("kAudioDevicePropertyNominalSampleRate\n");
+ if (isInput) {
+ //printf("soundflower device potential sample rate change\n");
+ if (gThruEngine2->IsRunning() && gThruEngine2->GetInputDevice() == inDevice)
+ [NSThread detachNewThreadSelector:@selector(srChanged2ch) toTarget:app withObject:nil];
+ else if (gThruEngine16->IsRunning() && gThruEngine16->GetInputDevice() == inDevice)
+ [NSThread detachNewThreadSelector:@selector(srChanged16ch) toTarget:app withObject:nil];
+ }
+ else {
+ if (inChannel == 0) {
+ //printf("non-soundflower device potential sample rate change\n");
+ if (gThruEngine2->IsRunning() && gThruEngine2->GetOutputDevice() == inDevice)
+ [NSThread detachNewThreadSelector:@selector(srChanged2chOutput) toTarget:app withObject:nil];
+ else if (gThruEngine16->IsRunning() && gThruEngine16->GetOutputDevice() == inDevice)
+ [NSThread detachNewThreadSelector:@selector(srChanged16chOutput) toTarget:app withObject:nil];
+ }
+ }
+ break;
+
+ case kAudioDevicePropertyDeviceIsAlive:
+// printf("kAudioDevicePropertyDeviceIsAlive\n");
+ break;
+
+ case kAudioDevicePropertyDeviceHasChanged:
+// printf("kAudioDevicePropertyDeviceHasChanged\n");
+ break;
+
+ case kAudioDevicePropertyDataSource:
+ // printf("DeviceListenerProc : HEADPHONES! \n");
+ if (gThruEngine2->IsRunning() && gThruEngine2->GetOutputDevice() == inDevice)
+ [NSThread detachNewThreadSelector:@selector(srChanged2chOutput) toTarget:app withObject:nil];
+ else if (gThruEngine16->IsRunning() && gThruEngine16->GetOutputDevice() == inDevice)
+ [NSThread detachNewThreadSelector:@selector(srChanged16chOutput) toTarget:app withObject:nil];
+ break;
+
+ case kAudioDevicePropertyDeviceIsRunning:
+// printf("kAudioDevicePropertyDeviceIsRunning\n");
+ break;
+
+ case kAudioDeviceProcessorOverload:
+// printf("kAudioDeviceProcessorOverload\n");
+ break;
+
+ case kAudioDevicePropertyAvailableNominalSampleRates:
+ //printf("kAudioDevicePropertyAvailableNominalSampleRates\n");
+ break;
+
+ case kAudioStreamPropertyPhysicalFormat:
+ //printf("kAudioStreamPropertyPhysicalFormat\n");
+ break;
+ case kAudioDevicePropertyStreamFormat:
+ //printf("kAudioDevicePropertyStreamFormat\n");
+ break;
+
+ case kAudioDevicePropertyStreams:
+ //printf("kAudioDevicePropertyStreams\n");
+ case kAudioDevicePropertyStreamConfiguration:
+ //printf("kAudioDevicePropertyStreamConfiguration\n");
+ if (!isInput) {
+ if (inChannel == 0) {
+ if (gThruEngine2->GetOutputDevice() == inDevice || gThruEngine16->GetOutputDevice() == inDevice) {
+ //printf("non-soundflower device potential # of chnls change\n");
+ [NSThread detachNewThreadSelector:@selector(checkNchnls) toTarget:app withObject:nil];
+ }
+ else // this could be an aggregate device in the middle of constructing, going from/to 0 chans & we need to add/remove to menu
+ [NSThread detachNewThreadSelector:@selector(refreshDevices) toTarget:app withObject:nil];
+ }
+ }
+ break;
+
+ default:
+ //printf("unsupported notification:%s\n", (char*)inPropertyID);
+ break;
+ }
+
+ return noErr;
}
#include <mach/mach_port.h>
@@ -159,24 +159,24 @@ OSStatus DeviceListenerProc ( AudioDeviceID inDevice,
void
MySleepCallBack(void * x, io_service_t y, natural_t messageType, void * messageArgument)
-{
- AppController *app = (AppController *)x;
+{
+ AppController *app = (AppController *)x;
switch ( messageType ) {
case kIOMessageSystemWillSleep:
- //printf("kIOMessageSystemWillSleep\n");
+ //printf("kIOMessageSystemWillSleep\n");
+
+ [NSThread detachNewThreadSelector:@selector(suspend) toTarget:app withObject:nil];
- [NSThread detachNewThreadSelector:@selector(suspend) toTarget:app withObject:nil];
-
IOAllowPowerChange(root_port, (long)messageArgument);
break;
-
- case kIOMessageSystemWillNotSleep:
- //printf("kIOMessageSystemWillNotSleep\n");
- break;
-
+
+ case kIOMessageSystemWillNotSleep:
+ //printf("kIOMessageSystemWillNotSleep\n");
+ break;
+
case kIOMessageCanSystemSleep:
- //printf("kIOMessageCanSystemSleep\n");
+ //printf("kIOMessageCanSystemSleep\n");
/* Idle sleep is about to kick in, but applications have a chance to prevent sleep
by calling IOCancelPowerChange. Most applications should not do this. */
@@ -190,713 +190,713 @@ OSStatus DeviceListenerProc ( AudioDeviceID inDevice,
break;
case kIOMessageSystemHasPoweredOn:
- //printf("kIOMessageSystemHasPoweredOn\n");
-
- [NSTimer scheduledTimerWithTimeInterval:0.0 target:app selector:@selector(resume) userInfo:nil repeats:NO];
-
- break;
-
- default:
- //printf("iomessage: %08lx\n", messageType);//"kIOMessageSystemWillPowerOn\n");
- break;
+ //printf("kIOMessageSystemHasPoweredOn\n");
+
+ [NSTimer scheduledTimerWithTimeInterval:0.0 target:app selector:@selector(resume) userInfo:nil repeats:NO];
+
+ break;
+
+ default:
+ //printf("iomessage: %08lx\n", messageType);//"kIOMessageSystemWillPowerOn\n");
+ break;
}
}
- (IBAction)suspend
{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
- mSuspended2chDevice = mCur2chDevice;
- mSuspended16chDevice = mCur16chDevice;
-
- [self outputDeviceSelected:[mMenu itemAtIndex:1]];
- [self outputDeviceSelected:[mMenu itemAtIndex:(m16StartIndex+1)]];
-
- [pool release];
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+ mSuspended2chDevice = mCur2chDevice;
+ mSuspended16chDevice = mCur16chDevice;
+
+ [self outputDeviceSelected:[mMenu itemAtIndex:1]];
+ [self outputDeviceSelected:[mMenu itemAtIndex:(m16StartIndex+1)]];
+
+ [pool release];
}
- (IBAction)resume
{
- //NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- if (mSuspended2chDevice) {
- [self outputDeviceSelected:mSuspended2chDevice];
- mCur2chDevice = mSuspended2chDevice;
- mSuspended2chDevice = NULL;
- }
- if (mSuspended16chDevice) {
- [self outputDeviceSelected:mSuspended16chDevice];
- mCur16chDevice = mSuspended16chDevice;
- mSuspended16chDevice = NULL;
- }
-
- //[pool release];
+ //NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ if (mSuspended2chDevice) {
+ [self outputDeviceSelected:mSuspended2chDevice];
+ mCur2chDevice = mSuspended2chDevice;
+ mSuspended2chDevice = NULL;
+ }
+ if (mSuspended16chDevice) {
+ [self outputDeviceSelected:mSuspended16chDevice];
+ mCur16chDevice = mSuspended16chDevice;
+ mSuspended16chDevice = NULL;
+ }
+
+ //[pool release];
}
- (IBAction)srChanged2ch
{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
- gThruEngine2->Mute();
- OSStatus err = gThruEngine2->MatchSampleRate(true);
-
- NSMenuItem *curdev = mCur2chDevice;
- [self outputDeviceSelected:[mMenu itemAtIndex:1]];
- if (err == kAudioHardwareNoError) {
- //usleep(1000);
- [self outputDeviceSelected:curdev];
- }
-
- gThruEngine2->Mute(false);
-
- [pool release];
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+ gThruEngine2->Mute();
+ OSStatus err = gThruEngine2->MatchSampleRate(true);
+
+ NSMenuItem *curdev = mCur2chDevice;
+ [self outputDeviceSelected:[mMenu itemAtIndex:1]];
+ if (err == kAudioHardwareNoError) {
+ //usleep(1000);
+ [self outputDeviceSelected:curdev];
+ }
+
+ gThruEngine2->Mute(false);
+
+ [pool release];
}
- (IBAction)srChanged16ch
{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
- gThruEngine16->Mute();
- OSStatus err = gThruEngine16->MatchSampleRate(true);
-
- NSMenuItem *curdev = mCur16chDevice;
- [self outputDeviceSelected:[mMenu itemAtIndex:(m16StartIndex+1)]];
- if (err == kAudioHardwareNoError) {
- //usleep(1000);
- [self outputDeviceSelected:curdev];
- }
- gThruEngine16->Mute(false);
-
- [pool release];
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+ gThruEngine16->Mute();
+ OSStatus err = gThruEngine16->MatchSampleRate(true);
+
+ NSMenuItem *curdev = mCur16chDevice;
+ [self outputDeviceSelected:[mMenu itemAtIndex:(m16StartIndex+1)]];
+ if (err == kAudioHardwareNoError) {
+ //usleep(1000);
+ [self outputDeviceSelected:curdev];
+ }
+ gThruEngine16->Mute(false);
+
+ [pool release];
}
- (IBAction)srChanged2chOutput
{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
- gThruEngine2->Mute();
- OSStatus err = gThruEngine2->MatchSampleRate(false);
-
- // restart devices
- NSMenuItem *curdev = mCur2chDevice;
- [self outputDeviceSelected:[mMenu itemAtIndex:1]];
- if (err == kAudioHardwareNoError) {
- //usleep(1000);
- [self outputDeviceSelected:curdev];
- }
- gThruEngine2->Mute(false);
-
- [pool release];
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+ gThruEngine2->Mute();
+ OSStatus err = gThruEngine2->MatchSampleRate(false);
+
+ // restart devices
+ NSMenuItem *curdev = mCur2chDevice;
+ [self outputDeviceSelected:[mMenu itemAtIndex:1]];
+ if (err == kAudioHardwareNoError) {
+ //usleep(1000);
+ [self outputDeviceSelected:curdev];
+ }
+ gThruEngine2->Mute(false);
+
+ [pool release];
}
- (IBAction)srChanged16chOutput
{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
- gThruEngine16->Mute();
- OSStatus err = gThruEngine16->MatchSampleRate(false);
-
- // restart devices
- NSMenuItem *curdev = mCur16chDevice;
- [self outputDeviceSelected:[mMenu itemAtIndex:(m16StartIndex+1)]];
- if (err == kAudioHardwareNoError) {
- //usleep(1000);
- [self outputDeviceSelected:curdev];
- }
- gThruEngine16->Mute(false);
-
- [pool release];
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+ gThruEngine16->Mute();
+ OSStatus err = gThruEngine16->MatchSampleRate(false);
+
+ // restart devices
+ NSMenuItem *curdev = mCur16chDevice;
+ [self outputDeviceSelected:[mMenu itemAtIndex:(m16StartIndex+1)]];
+ if (err == kAudioHardwareNoError) {
+ //usleep(1000);
+ [self outputDeviceSelected:curdev];
+ }
+ gThruEngine16->Mute(false);
+
+ [pool release];
}
- (IBAction)checkNchnls
{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
- if (mNchnls2 != gThruEngine2->GetOutputNchnls())
- {
- NSMenuItem *curdev = mCur2chDevice;
- [self outputDeviceSelected:[mMenu itemAtIndex:1]];
- //usleep(1000);
- [self outputDeviceSelected:curdev];
- }
-
- if (mNchnls16 != gThruEngine16->GetOutputNchnls())
- {
- NSMenuItem *curdev = mCur16chDevice;
- [self outputDeviceSelected:[mMenu itemAtIndex:(m16StartIndex+1)]];
- //usleep(1000);
- [self outputDeviceSelected:curdev];
- }
-
- [pool release];
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+ if (mNchnls2 != gThruEngine2->GetOutputNchnls())
+ {
+ NSMenuItem *curdev = mCur2chDevice;
+ [self outputDeviceSelected:[mMenu itemAtIndex:1]];
+ //usleep(1000);
+ [self outputDeviceSelected:curdev];
+ }
+
+ if (mNchnls16 != gThruEngine16->GetOutputNchnls())
+ {
+ NSMenuItem *curdev = mCur16chDevice;
+ [self outputDeviceSelected:[mMenu itemAtIndex:(m16StartIndex+1)]];
+ //usleep(1000);
+ [self outputDeviceSelected:curdev];
+ }
+
+ [pool release];
}
- (IBAction)refreshDevices
{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
- [self buildDeviceList];
-
- [mSbItem setMenu:nil];
- [mMenu dealloc];
-
- [self buildMenu];
-
- // make sure that one of our current device's was not removed!
- AudioDeviceID dev = gThruEngine2->GetOutputDevice();
- AudioDeviceList::DeviceList &thelist = mOutputDeviceList->GetList();
- AudioDeviceList::DeviceList::iterator i;
- for (i = thelist.begin(); i != thelist.end(); ++i)
- if ((*i).mID == dev)
- break;
- if (i == thelist.end()) // we didn't find it, turn selection to none
- [self outputDeviceSelected:[mMenu itemAtIndex:1]];
- else
- [self buildRoutingMenu:YES];
-
- dev = gThruEngine16->GetOutputDevice();
- for ( i= thelist.begin(); i != thelist.end(); ++i)
- if ((*i).mID == dev)
- break;
- if (i == thelist.end()) // we didn't find it, turn selection to none
- [self outputDeviceSelected:[mMenu itemAtIndex:(m16StartIndex+1)]];
- else
- [self buildRoutingMenu:NO];
-
- [pool release];
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+ [self buildDeviceList];
+
+ [mSbItem setMenu:nil];
+ [mMenu dealloc];
+
+ [self buildMenu];
+
+ // make sure that one of our current device's was not removed!
+ AudioDeviceID dev = gThruEngine2->GetOutputDevice();
+ AudioDeviceList::DeviceList &thelist = mOutputDeviceList->GetList();
+ AudioDeviceList::DeviceList::iterator i;
+ for (i = thelist.begin(); i != thelist.end(); ++i)
+ if ((*i).mID == dev)
+ break;
+ if (i == thelist.end()) // we didn't find it, turn selection to none
+ [self outputDeviceSelected:[mMenu itemAtIndex:1]];
+ else
+ [self buildRoutingMenu:YES];
+
+ dev = gThruEngine16->GetOutputDevice();
+ for ( i= thelist.begin(); i != thelist.end(); ++i)
+ if ((*i).mID == dev)
+ break;
+ if (i == thelist.end()) // we didn't find it, turn selection to none
+ [self outputDeviceSelected:[mMenu itemAtIndex:(m16StartIndex+1)]];
+ else
+ [self buildRoutingMenu:NO];
+
+ [pool release];
}
- (void)InstallListeners;
-{
- // add listeners for all devices, including soundflowers
- AudioDeviceList::DeviceList &thelist = mOutputDeviceList->GetList();
- int index = 0;
- for (AudioDeviceList::DeviceList::iterator i = thelist.begin(); i != thelist.end(); ++i, ++index) {
- if (0 == strncmp("Soundflower", (*i).mName, strlen("Soundflower"))) {
- //verify_noerr (AudioDeviceAddPropertyListener((*i).mID, 0, true, kAudioStreamPropertyPhysicalFormat, DeviceListenerProc, self));
- //verify_noerr (AudioDeviceAddPropertyListener((*i).mID, 0, true, kAudioDevicePropertyStreamFormat, DeviceListenerProc, self));
- verify_noerr (AudioDeviceAddPropertyListener((*i).mID, 0, true, kAudioDevicePropertyNominalSampleRate, DeviceListenerProc, self));
- //verify_noerr (AudioDeviceAddPropertyListener((*i).mID, 0, true, kAudioDevicePropertyLatency, DeviceListenerProc, self));
- //verify_noerr (AudioDeviceAddPropertyListener((*i).mID, 0, true, kAudioDevicePropertySafetyOffset, DeviceListenerProc, self));
- verify_noerr (AudioDeviceAddPropertyListener((*i).mID, 0, true, kAudioDevicePropertyStreamConfiguration, DeviceListenerProc, self));
- //verify_noerr (AudioDeviceAddPropertyListener((*i).mID, 0, true, kAudioDevicePropertyAvailableNominalSampleRates, DeviceListenerProc, self));
-
- verify_noerr (AudioDeviceAddPropertyListener((*i).mID, 0, true, kAudioDevicePropertyDeviceIsAlive, DeviceListenerProc, self));
- verify_noerr (AudioDeviceAddPropertyListener((*i).mID, 0, true, kAudioDevicePropertyDeviceHasChanged, DeviceListenerProc, self));
- verify_noerr (AudioDeviceAddPropertyListener((*i).mID, 0, true, kAudioDevicePropertyDeviceIsRunning, DeviceListenerProc, self));
- verify_noerr (AudioDeviceAddPropertyListener((*i).mID, 0, true, kAudioDeviceProcessorOverload, DeviceListenerProc, self));
- }
- else {
- //verify_noerr (AudioDeviceAddPropertyListener((*i).mID, 0, false, kAudioStreamPropertyPhysicalFormat, DeviceListenerProc, self));
- //verify_noerr (AudioDeviceAddPropertyListener((*i).mID, 0, false, kAudioDevicePropertyStreamFormat, DeviceListenerProc, self));
- verify_noerr (AudioDeviceAddPropertyListener((*i).mID, 0, false, kAudioDevicePropertyNominalSampleRate, DeviceListenerProc, self));
- //verify_noerr (AudioDeviceAddPropertyListener((*i).mID, 0, false, kAudioDevicePropertyLatency, DeviceListenerProc, self));
- //verify_noerr (AudioDeviceAddPropertyListener((*i).mID, 0, false, kAudioDevicePropertySafetyOffset, DeviceListenerProc, self));
- verify_noerr (AudioDeviceAddPropertyListener((*i).mID, 0, false, kAudioDevicePropertyStreamConfiguration, DeviceListenerProc, self));
- verify_noerr (AudioDeviceAddPropertyListener((*i).mID, 0, false, kAudioDevicePropertyStreams, DeviceListenerProc, self));
- //verify_noerr (AudioDeviceAddPropertyListener((*i).mID, 0, false, kAudioDevicePropertyAvailableNominalSampleRates, DeviceListenerProc, self));
-
- // this provides us, for example, with notification when the headphones are plugged/unplugged during playback
- verify_noerr (AudioDeviceAddPropertyListener((*i).mID, 0, false, kAudioDevicePropertyDataSource, DeviceListenerProc, self));
-
- }
- }
-
- // check for added/removed devices
+{
+ // add listeners for all devices, including soundflowers
+ AudioDeviceList::DeviceList &thelist = mOutputDeviceList->GetList();
+ int index = 0;
+ for (AudioDeviceList::DeviceList::iterator i = thelist.begin(); i != thelist.end(); ++i, ++index) {
+ if (0 == strncmp("Soundflower", (*i).mName, strlen("Soundflower"))) {
+ //verify_noerr (AudioDeviceAddPropertyListener((*i).mID, 0, true, kAudioStreamPropertyPhysicalFormat, DeviceListenerProc, self));
+ //verify_noerr (AudioDeviceAddPropertyListener((*i).mID, 0, true, kAudioDevicePropertyStreamFormat, DeviceListenerProc, self));
+ verify_noerr (AudioDeviceAddPropertyListener((*i).mID, 0, true, kAudioDevicePropertyNominalSampleRate, DeviceListenerProc, self));
+ //verify_noerr (AudioDeviceAddPropertyListener((*i).mID, 0, true, kAudioDevicePropertyLatency, DeviceListenerProc, self));
+ //verify_noerr (AudioDeviceAddPropertyListener((*i).mID, 0, true, kAudioDevicePropertySafetyOffset, DeviceListenerProc, self));
+ verify_noerr (AudioDeviceAddPropertyListener((*i).mID, 0, true, kAudioDevicePropertyStreamConfiguration, DeviceListenerProc, self));
+ //verify_noerr (AudioDeviceAddPropertyListener((*i).mID, 0, true, kAudioDevicePropertyAvailableNominalSampleRates, DeviceListenerProc, self));
+
+ verify_noerr (AudioDeviceAddPropertyListener((*i).mID, 0, true, kAudioDevicePropertyDeviceIsAlive, DeviceListenerProc, self));
+ verify_noerr (AudioDeviceAddPropertyListener((*i).mID, 0, true, kAudioDevicePropertyDeviceHasChanged, DeviceListenerProc, self));
+ verify_noerr (AudioDeviceAddPropertyListener((*i).mID, 0, true, kAudioDevicePropertyDeviceIsRunning, DeviceListenerProc, self));
+ verify_noerr (AudioDeviceAddPropertyListener((*i).mID, 0, true, kAudioDeviceProcessorOverload, DeviceListenerProc, self));
+ }
+ else {
+ //verify_noerr (AudioDeviceAddPropertyListener((*i).mID, 0, false, kAudioStreamPropertyPhysicalFormat, DeviceListenerProc, self));
+ //verify_noerr (AudioDeviceAddPropertyListener((*i).mID, 0, false, kAudioDevicePropertyStreamFormat, DeviceListenerProc, self));
+ verify_noerr (AudioDeviceAddPropertyListener((*i).mID, 0, false, kAudioDevicePropertyNominalSampleRate, DeviceListenerProc, self));
+ //verify_noerr (AudioDeviceAddPropertyListener((*i).mID, 0, false, kAudioDevicePropertyLatency, DeviceListenerProc, self));
+ //verify_noerr (AudioDeviceAddPropertyListener((*i).mID, 0, false, kAudioDevicePropertySafetyOffset, DeviceListenerProc, self));
+ verify_noerr (AudioDeviceAddPropertyListener((*i).mID, 0, false, kAudioDevicePropertyStreamConfiguration, DeviceListenerProc, self));
+ verify_noerr (AudioDeviceAddPropertyListener((*i).mID, 0, false, kAudioDevicePropertyStreams, DeviceListenerProc, self));
+ //verify_noerr (AudioDeviceAddPropertyListener((*i).mID, 0, false, kAudioDevicePropertyAvailableNominalSampleRates, DeviceListenerProc, self));
+
+ // this provides us, for example, with notification when the headphones are plugged/unplugged during playback
+ verify_noerr (AudioDeviceAddPropertyListener((*i).mID, 0, false, kAudioDevicePropertyDataSource, DeviceListenerProc, self));
+
+ }
+ }
+
+ // check for added/removed devices
verify_noerr (AudioHardwareAddPropertyListener(kAudioHardwarePropertyDevices, HardwareListenerProc, self));
-
- verify_noerr (AudioHardwareAddPropertyListener(kAudioHardwarePropertyIsInitingOrExiting, HardwareListenerProc, self));
- verify_noerr (AudioHardwareAddPropertyListener(kAudioHardwarePropertySleepingIsAllowed, HardwareListenerProc, self));
- verify_noerr (AudioHardwareAddPropertyListener(kAudioHardwarePropertyUnloadingIsAllowed, HardwareListenerProc, self));
-
-/* UInt32 val, size = sizeof(UInt32);
- AudioHardwareGetProperty(kAudioHardwarePropertySleepingIsAllowed, &size, &val);
- printf("Sleep is %s\n", (val ? "allowed" : "not allowed"));
- AudioHardwareGetProperty(kAudioHardwarePropertyUnloadingIsAllowed, &size, &val);
- printf("Unloading is %s\n", (val ? "allowed" : "not allowed"));
+
+ verify_noerr (AudioHardwareAddPropertyListener(kAudioHardwarePropertyIsInitingOrExiting, HardwareListenerProc, self));
+ verify_noerr (AudioHardwareAddPropertyListener(kAudioHardwarePropertySleepingIsAllowed, HardwareListenerProc, self));
+ verify_noerr (AudioHardwareAddPropertyListener(kAudioHardwarePropertyUnloadingIsAllowed, HardwareListenerProc, self));
+
+/* UInt32 val, size = sizeof(UInt32);
+ AudioHardwareGetProperty(kAudioHardwarePropertySleepingIsAllowed, &size, &val);
+ printf("Sleep is %s\n", (val ? "allowed" : "not allowed"));
+ AudioHardwareGetProperty(kAudioHardwarePropertyUnloadingIsAllowed, &size, &val);
+ printf("Unloading is %s\n", (val ? "allowed" : "not allowed"));
*/
-}
+}
- (void)RemoveListeners
{
- AudioDeviceList::DeviceList &thelist = mOutputDeviceList->GetList();
- int index = 0;
- for (AudioDeviceList::DeviceList::iterator i = thelist.begin(); i != thelist.end(); ++i, ++index) {
- if (0 == strncmp("Soundflower", (*i).mName, strlen("Soundflower"))) {
- verify_noerr (AudioDeviceRemovePropertyListener((*i).mID, 0, true, kAudioDevicePropertyNominalSampleRate, DeviceListenerProc));
- verify_noerr (AudioDeviceRemovePropertyListener((*i).mID, 0, true, kAudioDevicePropertyStreamConfiguration, DeviceListenerProc));
- }
- else {
- verify_noerr (AudioDeviceRemovePropertyListener((*i).mID, 0, false, kAudioDevicePropertyNominalSampleRate, DeviceListenerProc));
- verify_noerr (AudioDeviceRemovePropertyListener((*i).mID, 0, false, kAudioDevicePropertyStreamConfiguration, DeviceListenerProc));
- verify_noerr (AudioDeviceRemovePropertyListener((*i).mID, 0, false, kAudioDevicePropertyStreams, DeviceListenerProc));
- verify_noerr (AudioDeviceRemovePropertyListener((*i).mID, 0, false, kAudioDevicePropertyDataSource, DeviceListenerProc));
- }
- }
-
- verify_noerr (AudioHardwareRemovePropertyListener(kAudioHardwarePropertyDevices, HardwareListenerProc));
+ AudioDeviceList::DeviceList &thelist = mOutputDeviceList->GetList();
+ int index = 0;
+ for (AudioDeviceList::DeviceList::iterator i = thelist.begin(); i != thelist.end(); ++i, ++index) {
+ if (0 == strncmp("Soundflower", (*i).mName, strlen("Soundflower"))) {
+ verify_noerr (AudioDeviceRemovePropertyListener((*i).mID, 0, true, kAudioDevicePropertyNominalSampleRate, DeviceListenerProc));
+ verify_noerr (AudioDeviceRemovePropertyListener((*i).mID, 0, true, kAudioDevicePropertyStreamConfiguration, DeviceListenerProc));
+ }
+ else {
+ verify_noerr (AudioDeviceRemovePropertyListener((*i).mID, 0, false, kAudioDevicePropertyNominalSampleRate, DeviceListenerProc));
+ verify_noerr (AudioDeviceRemovePropertyListener((*i).mID, 0, false, kAudioDevicePropertyStreamConfiguration, DeviceListenerProc));
+ verify_noerr (AudioDeviceRemovePropertyListener((*i).mID, 0, false, kAudioDevicePropertyStreams, DeviceListenerProc));
+ verify_noerr (AudioDeviceRemovePropertyListener((*i).mID, 0, false, kAudioDevicePropertyDataSource, DeviceListenerProc));
+ }
+ }
+
+ verify_noerr (AudioHardwareRemovePropertyListener(kAudioHardwarePropertyDevices, HardwareListenerProc));
}
- (id)init
{
- mOutputDeviceList = NULL;
-
- mSoundflower2Device = 0;
- mSoundflower16Device = 0;
- mNchnls2 = 0;
- mNchnls16 = 0;
-
- mSuspended2chDevice = NULL;
- mSuspended16chDevice = NULL;
-
- return self;
+ mOutputDeviceList = NULL;
+
+ mSoundflower2Device = 0;
+ mSoundflower16Device = 0;
+ mNchnls2 = 0;
+ mNchnls16 = 0;
+
+ mSuspended2chDevice = NULL;
+ mSuspended16chDevice = NULL;
+
+ return self;
}
- (void)dealloc
{
- [ self RemoveListeners];
- delete mOutputDeviceList;
-
- [super dealloc];
+ [ self RemoveListeners];
+ delete mOutputDeviceList;
+
+ [super dealloc];
}
/*- (void)updateThruLatency
{
- [mTotalLatencyText setIntValue:gThruEngine->GetThruLatency()];
+ [mTotalLatencyText setIntValue:gThruEngine->GetThruLatency()];
}
*/
- (void)buildRoutingMenu:(BOOL)is2ch
{
- NSMenuItem *hostMenu = (is2ch ? m2chMenu : m16chMenu);
- UInt32 nchnls = (is2ch ? mNchnls2 = gThruEngine2->GetOutputNchnls() : mNchnls16 = gThruEngine16->GetOutputNchnls());
- AudioDeviceID outDev = (is2ch ? gThruEngine2->GetOutputDevice(): gThruEngine16->GetOutputDevice());
- SEL menuAction = (is2ch ? @selector(routingChanged2ch:): @selector(routingChanged16ch:));
-
- for (UInt32 menucount = 0; menucount < (is2ch ? 2 : 16); menucount++) {
- NSMenuItem *superMenu = [[hostMenu submenu] itemAtIndex:(menucount+3)];
-
- NSMenu *menu = [[NSMenu alloc] initWithTitle:@"Output Device Channel"];
- NSMenuItem *item;
-
- AudioDeviceList::DeviceList &thelist = mOutputDeviceList->GetList();
- char *name = 0;
- for (AudioDeviceList::DeviceList::iterator i = thelist.begin(); i != thelist.end(); ++i) {
- if ((*i).mID == outDev)
- name = (*i).mName;
- }
-
- item = [menu addItemWithTitle:@"None" action:menuAction keyEquivalent:@""];
- [item setState:NSOnState];
-
- char text[128];
- for (UInt32 c = 1; c <= nchnls; ++c) {
- sprintf(text, "%s [%d]", name, (int)c);
- item = [menu addItemWithTitle:[NSString stringWithCString:text] action:menuAction keyEquivalent:@""];
- [item setTarget:self];
-
- // set check marks according to route map
- if (c == 1 + (is2ch ? (UInt32)gThruEngine2->GetChannelMap(menucount) : (UInt32)gThruEngine16->GetChannelMap(menucount))) {
- [[menu itemAtIndex:0] setState:NSOffState];
- [item setState:NSOnState];
- }
- }
-
- [superMenu setSubmenu:menu];
- }
+ NSMenuItem *hostMenu = (is2ch ? m2chMenu : m16chMenu);
+ UInt32 nchnls = (is2ch ? mNchnls2 = gThruEngine2->GetOutputNchnls() : mNchnls16 = gThruEngine16->GetOutputNchnls());
+ AudioDeviceID outDev = (is2ch ? gThruEngine2->GetOutputDevice(): gThruEngine16->GetOutputDevice());
+ SEL menuAction = (is2ch ? @selector(routingChanged2ch:): @selector(routingChanged16ch:));
+
+ for (UInt32 menucount = 0; menucount < (is2ch ? 2 : 16); menucount++) {
+ NSMenuItem *superMenu = [[hostMenu submenu] itemAtIndex:(menucount+3)];
+
+ NSMenu *menu = [[NSMenu alloc] initWithTitle:@"Output Device Channel"];
+ NSMenuItem *item;
+
+ AudioDeviceList::DeviceList &thelist = mOutputDeviceList->GetList();
+ char *name = 0;
+ for (AudioDeviceList::DeviceList::iterator i = thelist.begin(); i != thelist.end(); ++i) {
+ if ((*i).mID == outDev)
+ name = (*i).mName;
+ }
+
+ item = [menu addItemWithTitle:@"None" action:menuAction keyEquivalent:@""];
+ [item setState:NSOnState];
+
+ char text[128];
+ for (UInt32 c = 1; c <= nchnls; ++c) {
+ sprintf(text, "%s [%d]", name, (int)c);
+ item = [menu addItemWithTitle:[NSString stringWithCString:text] action:menuAction keyEquivalent:@""];
+ [item setTarget:self];
+
+ // set check marks according to route map
+ if (c == 1 + (is2ch ? (UInt32)gThruEngine2->GetChannelMap(menucount) : (UInt32)gThruEngine16->GetChannelMap(menucount))) {
+ [[menu itemAtIndex:0] setState:NSOffState];
+ [item setState:NSOnState];
+ }
+ }
+
+ [superMenu setSubmenu:menu];
+ }
}
- (void)buildMenu
{
- NSMenuItem *item;
-
- mMenu = [[NSMenu alloc] initWithTitle:@"Main Menu"];
-
- if (mSoundflower2Device) {
- m2chMenu = [mMenu addItemWithTitle:@"Soundflower (2ch)" action:@selector(doNothing) keyEquivalent:@""];
- [m2chMenu setImage:[NSImage imageNamed:@"sf2"]];
- [m2chMenu setTarget:self];
- NSMenu *submenu = [[NSMenu alloc] initWithTitle:@"2ch submenu"];
- NSMenuItem *bufItem = [submenu addItemWithTitle:@"Buffer Size" action:@selector(doNothing) keyEquivalent:@""];
- m2chBuffer = [[NSMenu alloc] initWithTitle:@"2ch Buffer"];
- item = [m2chBuffer addItemWithTitle:@"64" action:@selector(bufferSizeChanged2ch:) keyEquivalent:@""];
- [item setTarget:self];
- item = [m2chBuffer addItemWithTitle:@"128" action:@selector(bufferSizeChanged2ch:) keyEquivalent:@""];
- [item setTarget:self];
- item = [m2chBuffer addItemWithTitle:@"256" action:@selector(bufferSizeChanged2ch:) keyEquivalent:@""];
- [item setTarget:self];
- item = [m2chBuffer addItemWithTitle:@"512" action:@selector(bufferSizeChanged2ch:) keyEquivalent:@""];
- [item setTarget:self];
- [item setState:NSOnState]; // default
- mCur2chBufferSize = item;
- item = [m2chBuffer addItemWithTitle:@"1024" action:@selector(bufferSizeChanged2ch:) keyEquivalent:@""];
- [item setTarget:self];
- item = [m2chBuffer addItemWithTitle:@"2048" action:@selector(bufferSizeChanged2ch:) keyEquivalent:@""];
- [item setTarget:self];
- [bufItem setSubmenu:m2chBuffer];
-
- [submenu addItem:[NSMenuItem separatorItem]];
-
- item = [submenu addItemWithTitle:@"Routing" action:NULL keyEquivalent:@""];
- item = [submenu addItemWithTitle:@"Channel 1" action:@selector(doNothing) keyEquivalent:@""];
- [item setTarget:self];
- item = [submenu addItemWithTitle:@"Channel 2" action:@selector(doNothing) keyEquivalent:@""];
- [item setTarget:self];
-
- // iSchemy's edit
- //
- [submenu addItem:[NSMenuItem separatorItem]];
-
- [[submenu addItemWithTitle:@"Clone to all channels" action:@selector(cloningChanged:) keyEquivalent:@""] setTarget:self];
- //
- // end
-
- [m2chMenu setSubmenu:submenu];
-
-
-
- item = [mMenu addItemWithTitle:@"None (OFF)" action:@selector(outputDeviceSelected:) keyEquivalent:@""];
- [item setTarget:self];
- [item setState:NSOnState];
- mCur2chDevice = item;
-
- AudioDeviceList::DeviceList &thelist = mOutputDeviceList->GetList();
- int index = 0;
- for (AudioDeviceList::DeviceList::iterator i = thelist.begin(); i != thelist.end(); ++i) {
- AudioDevice ad((*i).mID, false);
- if (ad.CountChannels())
- {
- item = [mMenu addItemWithTitle:[NSString stringWithCString: (*i).mName] action:@selector(outputDeviceSelected:) keyEquivalent:@""];
- [item setTarget:self];
- mMenuID2[index++] = (*i).mID;
- }
- }
- }
- else {
- item = [mMenu addItemWithTitle:@"Soundflower Is Not Installed!!" action:NULL keyEquivalent:@""];
- [item setTarget:self];
- }
-
- [mMenu addItem:[NSMenuItem separatorItem]];
-
-
- if (mSoundflower16Device) {
-
- m16chMenu = [mMenu addItemWithTitle:@"Soundflower (64ch)" action:@selector(doNothing) keyEquivalent:@""];
- [m16chMenu setImage:[NSImage imageNamed:@"sf16"]];
- [m16chMenu setTarget:self];
- m16StartIndex = [mMenu indexOfItem:m16chMenu];
- NSMenu *submenu = [[NSMenu alloc] initWithTitle:@"16ch submenu"];
- NSMenuItem *bufItem = [submenu addItemWithTitle:@"Buffer Size" action:@selector(doNothing) keyEquivalent:@""];
- m16chBuffer = [[NSMenu alloc] initWithTitle:@"16ch Buffer"];
- item = [m16chBuffer addItemWithTitle:@"64" action:@selector(bufferSizeChanged16ch:) keyEquivalent:@""];
- [item setTarget:self];
- item = [m16chBuffer addItemWithTitle:@"128" action:@selector(bufferSizeChanged16ch:) keyEquivalent:@""];
- [item setTarget:self];
- item = [m16chBuffer addItemWithTitle:@"256" action:@selector(bufferSizeChanged16ch:) keyEquivalent:@""];
- [item setTarget:self];
- item = [m16chBuffer addItemWithTitle:@"512" action:@selector(bufferSizeChanged16ch:) keyEquivalent:@""];
- [item setTarget:self];
- [item setState:NSOnState]; // default
- mCur16chBufferSize = item;
- item = [m16chBuffer addItemWithTitle:@"1024" action:@selector(bufferSizeChanged16ch:) keyEquivalent:@""];
- [item setTarget:self];
- item = [m16chBuffer addItemWithTitle:@"2048" action:@selector(bufferSizeChanged16ch:) keyEquivalent:@""];
- [item setTarget:self];
- [bufItem setSubmenu:m16chBuffer];
-
- [submenu addItem:[NSMenuItem separatorItem]];
-
- item = [submenu addItemWithTitle:@"Routing" action:NULL keyEquivalent:@""];
- item = [submenu addItemWithTitle:@"Channel 1" action:@selector(doNothing) keyEquivalent:@""];
- [item setTarget:self];
- item = [submenu addItemWithTitle:@"Channel 2" action:@selector(doNothing) keyEquivalent:@""];
- [item setTarget:self];
- item = [submenu addItemWithTitle:@"Channel 3" action:@selector(doNothing) keyEquivalent:@""];
- [item setTarget:self];
- item = [submenu addItemWithTitle:@"Channel 4" action:@selector(doNothing) keyEquivalent:@""];
- [item setTarget:self];
- item = [submenu addItemWithTitle:@"Channel 5" action:@selector(doNothing) keyEquivalent:@""];
- [item setTarget:self];
- item = [submenu addItemWithTitle:@"Channel 6" action:@selector(doNothing) keyEquivalent:@""];
- [item setTarget:self];
- item = [submenu addItemWithTitle:@"Channel 7" action:@selector(doNothing) keyEquivalent:@""];
- [item setTarget:self];
- item = [submenu addItemWithTitle:@"Channel 8" action:@selector(doNothing) keyEquivalent:@""];
- [item setTarget:self];
- item = [submenu addItemWithTitle:@"Channel 9" action:@selector(doNothing) keyEquivalent:@""];
- [item setTarget:self];
- item = [submenu addItemWithTitle:@"Channel 10" action:@selector(doNothing) keyEquivalent:@""];
- [item setTarget:self];
- item = [submenu addItemWithTitle:@"Channel 11" action:@selector(doNothing) keyEquivalent:@""];
- [item setTarget:self];
- item = [submenu addItemWithTitle:@"Channel 12" action:@selector(doNothing) keyEquivalent:@""];
- [item setTarget:self];
- item = [submenu addItemWithTitle:@"Channel 13" action:@selector(doNothing) keyEquivalent:@""];
- [item setTarget:self];
- item = [submenu addItemWithTitle:@"Channel 14" action:@selector(doNothing) keyEquivalent:@""];
- [item setTarget:self];
- item = [submenu addItemWithTitle:@"Channel 15" action:@selector(doNothing) keyEquivalent:@""];
- [item setTarget:self];
- item = [submenu addItemWithTitle:@"Channel 16" action:@selector(doNothing) keyEquivalent:@""];
- [item setTarget:self];
- [m16chMenu setSubmenu:submenu];
-
-
- item = [mMenu addItemWithTitle:@"None (OFF)" action:@selector(outputDeviceSelected:) keyEquivalent:@""];
- [item setTarget:self];
- [item setState:NSOnState];
- mCur16chDevice = item;
-
- AudioDeviceList::DeviceList &thelist = mOutputDeviceList->GetList();
- int index = 0;
- for (AudioDeviceList::DeviceList::iterator i = thelist.begin(); i != thelist.end(); ++i) {
- AudioDevice ad((*i).mID, false);
- if (ad.CountChannels())
- {
- item = [mMenu addItemWithTitle:[NSString stringWithCString: (*i).mName] action:@selector(outputDeviceSelected:) keyEquivalent:@""];
- [item setTarget:self];
- mMenuID16[index++] = (*i).mID;
- }
- }
-
- [mMenu addItem:[NSMenuItem separatorItem]];
- }
-
- item = [mMenu addItemWithTitle:@"Audio Setup..." action:@selector(doAudioSetup) keyEquivalent:@""];
- [item setTarget:self];
-
- item = [mMenu addItemWithTitle:@"About Soundflowerbed..." action:@selector(doAbout) keyEquivalent:@""];
- [item setTarget:self];
-
- // item = [mMenu addItemWithTitle:@"Hide Soundflowerbed" action:@selector(hideMenuItem) keyEquivalent:@""];
- // [item setTarget:self];
-
- item = [mMenu addItemWithTitle:@"Quit Soundflowerbed" action:@selector(doQuit) keyEquivalent:@""];
- [item setTarget:self];
-
- [mSbItem setMenu:mMenu];
+ NSMenuItem *item;
+
+ mMenu = [[NSMenu alloc] initWithTitle:@"Main Menu"];
+
+ if (mSoundflower2Device) {
+ m2chMenu = [mMenu addItemWithTitle:@"Soundflower (2ch)" action:@selector(doNothing) keyEquivalent:@""];
+ [m2chMenu setImage:[NSImage imageNamed:@"sf2"]];
+ [m2chMenu setTarget:self];
+ NSMenu *submenu = [[NSMenu alloc] initWithTitle:@"2ch submenu"];
+ NSMenuItem *bufItem = [submenu addItemWithTitle:@"Buffer Size" action:@selector(doNothing) keyEquivalent:@""];
+ m2chBuffer = [[NSMenu alloc] initWithTitle:@"2ch Buffer"];
+ item = [m2chBuffer addItemWithTitle:@"64" action:@selector(bufferSizeChanged2ch:) keyEquivalent:@""];
+ [item setTarget:self];
+ item = [m2chBuffer addItemWithTitle:@"128" action:@selector(bufferSizeChanged2ch:) keyEquivalent:@""];
+ [item setTarget:self];
+ item = [m2chBuffer addItemWithTitle:@"256" action:@selector(bufferSizeChanged2ch:) keyEquivalent:@""];
+ [item setTarget:self];
+ item = [m2chBuffer addItemWithTitle:@"512" action:@selector(bufferSizeChanged2ch:) keyEquivalent:@""];
+ [item setTarget:self];
+ [item setState:NSOnState]; // default
+ mCur2chBufferSize = item;
+ item = [m2chBuffer addItemWithTitle:@"1024" action:@selector(bufferSizeChanged2ch:) keyEquivalent:@""];
+ [item setTarget:self];
+ item = [m2chBuffer addItemWithTitle:@"2048" action:@selector(bufferSizeChanged2ch:) keyEquivalent:@""];
+ [item setTarget:self];
+ [bufItem setSubmenu:m2chBuffer];
+
+ [submenu addItem:[NSMenuItem separatorItem]];
+
+ item = [submenu addItemWithTitle:@"Routing" action:NULL keyEquivalent:@""];
+ item = [submenu addItemWithTitle:@"Channel 1" action:@selector(doNothing) keyEquivalent:@""];
+ [item setTarget:self];
+ item = [submenu addItemWithTitle:@"Channel 2" action:@selector(doNothing) keyEquivalent:@""];
+ [item setTarget:self];
+
+ // iSchemy's edit
+ //
+ [submenu addItem:[NSMenuItem separatorItem]];
+
+ [[submenu addItemWithTitle:@"Clone to all channels" action:@selector(cloningChanged:) keyEquivalent:@""] setTarget:self];
+ //
+ // end
+
+ [m2chMenu setSubmenu:submenu];
+
+
+
+ item = [mMenu addItemWithTitle:@"None (OFF)" action:@selector(outputDeviceSelected:) keyEquivalent:@""];
+ [item setTarget:self];
+ [item setState:NSOnState];
+ mCur2chDevice = item;
+
+ AudioDeviceList::DeviceList &thelist = mOutputDeviceList->GetList();
+ int index = 0;
+ for (AudioDeviceList::DeviceList::iterator i = thelist.begin(); i != thelist.end(); ++i) {
+ AudioDevice ad((*i).mID, false);
+ if (ad.CountChannels())
+ {
+ item = [mMenu addItemWithTitle:[NSString stringWithCString: (*i).mName] action:@selector(outputDeviceSelected:) keyEquivalent:@""];
+ [item setTarget:self];
+ mMenuID2[index++] = (*i).mID;
+ }
+ }
+ }
+ else {
+ item = [mMenu addItemWithTitle:@"Soundflower Is Not Installed!!" action:NULL keyEquivalent:@""];
+ [item setTarget:self];
+ }
+
+ [mMenu addItem:[NSMenuItem separatorItem]];
+
+
+ if (mSoundflower16Device) {
+
+ m16chMenu = [mMenu addItemWithTitle:@"Soundflower (64ch)" action:@selector(doNothing) keyEquivalent:@""];
+ [m16chMenu setImage:[NSImage imageNamed:@"sf16"]];
+ [m16chMenu setTarget:self];
+ m16StartIndex = [mMenu indexOfItem:m16chMenu];
+ NSMenu *submenu = [[NSMenu alloc] initWithTitle:@"16ch submenu"];
+ NSMenuItem *bufItem = [submenu addItemWithTitle:@"Buffer Size" action:@selector(doNothing) keyEquivalent:@""];
+ m16chBuffer = [[NSMenu alloc] initWithTitle:@"16ch Buffer"];
+ item = [m16chBuffer addItemWithTitle:@"64" action:@selector(bufferSizeChanged16ch:) keyEquivalent:@""];
+ [item setTarget:self];
+ item = [m16chBuffer addItemWithTitle:@"128" action:@selector(bufferSizeChanged16ch:) keyEquivalent:@""];
+ [item setTarget:self];
+ item = [m16chBuffer addItemWithTitle:@"256" action:@selector(bufferSizeChanged16ch:) keyEquivalent:@""];
+ [item setTarget:self];
+ item = [m16chBuffer addItemWithTitle:@"512" action:@selector(bufferSizeChanged16ch:) keyEquivalent:@""];
+ [item setTarget:self];
+ [item setState:NSOnState]; // default
+ mCur16chBufferSize = item;
+ item = [m16chBuffer addItemWithTitle:@"1024" action:@selector(bufferSizeChanged16ch:) keyEquivalent:@""];
+ [item setTarget:self];
+ item = [m16chBuffer addItemWithTitle:@"2048" action:@selector(bufferSizeChanged16ch:) keyEquivalent:@""];
+ [item setTarget:self];
+ [bufItem setSubmenu:m16chBuffer];
+
+ [submenu addItem:[NSMenuItem separatorItem]];
+
+ item = [submenu addItemWithTitle:@"Routing" action:NULL keyEquivalent:@""];
+ item = [submenu addItemWithTitle:@"Channel 1" action:@selector(doNothing) keyEquivalent:@""];
+ [item setTarget:self];
+ item = [submenu addItemWithTitle:@"Channel 2" action:@selector(doNothing) keyEquivalent:@""];
+ [item setTarget:self];
+ item = [submenu addItemWithTitle:@"Channel 3" action:@selector(doNothing) keyEquivalent:@""];
+ [item setTarget:self];
+ item = [submenu addItemWithTitle:@"Channel 4" action:@selector(doNothing) keyEquivalent:@""];
+ [item setTarget:self];
+ item = [submenu addItemWithTitle:@"Channel 5" action:@selector(doNothing) keyEquivalent:@""];
+ [item setTarget:self];
+ item = [submenu addItemWithTitle:@"Channel 6" action:@selector(doNothing) keyEquivalent:@""];
+ [item setTarget:self];
+ item = [submenu addItemWithTitle:@"Channel 7" action:@selector(doNothing) keyEquivalent:@""];
+ [item setTarget:self];
+ item = [submenu addItemWithTitle:@"Channel 8" action:@selector(doNothing) keyEquivalent:@""];
+ [item setTarget:self];
+ item = [submenu addItemWithTitle:@"Channel 9" action:@selector(doNothing) keyEquivalent:@""];
+ [item setTarget:self];
+ item = [submenu addItemWithTitle:@"Channel 10" action:@selector(doNothing) keyEquivalent:@""];
+ [item setTarget:self];
+ item = [submenu addItemWithTitle:@"Channel 11" action:@selector(doNothing) keyEquivalent:@""];
+ [item setTarget:self];
+ item = [submenu addItemWithTitle:@"Channel 12" action:@selector(doNothing) keyEquivalent:@""];
+ [item setTarget:self];
+ item = [submenu addItemWithTitle:@"Channel 13" action:@selector(doNothing) keyEquivalent:@""];
+ [item setTarget:self];
+ item = [submenu addItemWithTitle:@"Channel 14" action:@selector(doNothing) keyEquivalent:@""];
+ [item setTarget:self];
+ item = [submenu addItemWithTitle:@"Channel 15" action:@selector(doNothing) keyEquivalent:@""];
+ [item setTarget:self];
+ item = [submenu addItemWithTitle:@"Channel 16" action:@selector(doNothing) keyEquivalent:@""];
+ [item setTarget:self];
+ [m16chMenu setSubmenu:submenu];
+
+
+ item = [mMenu addItemWithTitle:@"None (OFF)" action:@selector(outputDeviceSelected:) keyEquivalent:@""];
+ [item setTarget:self];
+ [item setState:NSOnState];
+ mCur16chDevice = item;
+
+ AudioDeviceList::DeviceList &thelist = mOutputDeviceList->GetList();
+ int index = 0;
+ for (AudioDeviceList::DeviceList::iterator i = thelist.begin(); i != thelist.end(); ++i) {
+ AudioDevice ad((*i).mID, false);
+ if (ad.CountChannels())
+ {
+ item = [mMenu addItemWithTitle:[NSString stringWithCString: (*i).mName] action:@selector(outputDeviceSelected:) keyEquivalent:@""];
+ [item setTarget:self];
+ mMenuID16[index++] = (*i).mID;
+ }
+ }
+
+ [mMenu addItem:[NSMenuItem separatorItem]];
+ }
+
+ item = [mMenu addItemWithTitle:@"Audio Setup..." action:@selector(doAudioSetup) keyEquivalent:@""];
+ [item setTarget:self];
+
+ item = [mMenu addItemWithTitle:@"About Soundflowerbed..." action:@selector(doAbout) keyEquivalent:@""];
+ [item setTarget:self];
+
+ // item = [mMenu addItemWithTitle:@"Hide Soundflowerbed" action:@selector(hideMenuItem) keyEquivalent:@""];
+ // [item setTarget:self];
+
+ item = [mMenu addItemWithTitle:@"Quit Soundflowerbed" action:@selector(doQuit) keyEquivalent:@""];
+ [item setTarget:self];
+
+ [mSbItem setMenu:mMenu];
}
- (void)buildDeviceList
{
- if (mOutputDeviceList) {
- [ self RemoveListeners];
- delete mOutputDeviceList;
- }
-
- mOutputDeviceList = new AudioDeviceList(false);
- [ self InstallListeners];
-
- // find soundflower devices, store and remove them from our output list
- AudioDeviceList::DeviceList &thelist = mOutputDeviceList->GetList();
- int index = 0;
- for (AudioDeviceList::DeviceList::iterator i = thelist.begin(); i != thelist.end(); ++i, ++index) {
- if (0 == strcmp("Soundflower (2ch)", (*i).mName)) {
- mSoundflower2Device = (*i).mID;
- AudioDeviceList::DeviceList::iterator toerase = i;
- i--;
- thelist.erase(toerase);
- }
- else if (0 == strcmp("Soundflower (64ch)", (*i).mName)) {
- mSoundflower16Device = (*i).mID;
- AudioDeviceList::DeviceList::iterator toerase = i;
- i--;
- thelist.erase(toerase);
- }
- }
+ if (mOutputDeviceList) {
+ [ self RemoveListeners];
+ delete mOutputDeviceList;
+ }
+
+ mOutputDeviceList = new AudioDeviceList(false);
+ [ self InstallListeners];
+
+ // find soundflower devices, store and remove them from our output list
+ AudioDeviceList::DeviceList &thelist = mOutputDeviceList->GetList();
+ int index = 0;
+ for (AudioDeviceList::DeviceList::iterator i = thelist.begin(); i != thelist.end(); ++i, ++index) {
+ if (0 == strcmp("Soundflower (2ch)", (*i).mName)) {
+ mSoundflower2Device = (*i).mID;
+ AudioDeviceList::DeviceList::iterator toerase = i;
+ i--;
+ thelist.erase(toerase);
+ }
+ else if (0 == strcmp("Soundflower (64ch)", (*i).mName)) {
+ mSoundflower16Device = (*i).mID;
+ AudioDeviceList::DeviceList::iterator toerase = i;
+ i--;
+ thelist.erase(toerase);
+ }
+ }
}
- (void)awakeFromNib
{
- [[NSApplication sharedApplication] setDelegate:self];
-
- [self buildDeviceList];
-
- mSbItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength];
- [mSbItem retain];
-
- //[sbItem setTitle:@"¥¥"];
- [mSbItem setImage:[NSImage imageNamed:@"menuIcon"]];
- [mSbItem setHighlightMode:YES];
-
- [self buildMenu];
-
- if (mSoundflower2Device && mSoundflower16Device) {
- gThruEngine2 = new AudioThruEngine;
- gThruEngine2->SetInputDevice(mSoundflower2Device);
-
- gThruEngine16 = new AudioThruEngine;
- gThruEngine16->SetInputDevice(mSoundflower16Device);
-
- gThruEngine2->Start();
- gThruEngine16->Start();
-
- // build default 'off' channel routing menus
- [self buildRoutingMenu:YES];
- [self buildRoutingMenu:NO];
-
- // now read prefs
- [self readGlobalPrefs];
- }
-
- // ask to be notified on system sleep to avoid a crash
- IONotificationPortRef notify;
+ [[NSApplication sharedApplication] setDelegate:self];
+
+ [self buildDeviceList];
+
+ mSbItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength];
+ [mSbItem retain];
+
+ //[sbItem setTitle:@"¥¥"];
+ [mSbItem setImage:[NSImage imageNamed:@"menuIcon"]];
+ [mSbItem setHighlightMode:YES];
+
+ [self buildMenu];
+
+ if (mSoundflower2Device && mSoundflower16Device) {
+ gThruEngine2 = new AudioThruEngine;
+ gThruEngine2->SetInputDevice(mSoundflower2Device);
+
+ gThruEngine16 = new AudioThruEngine;
+ gThruEngine16->SetInputDevice(mSoundflower16Device);
+
+ gThruEngine2->Start();
+ gThruEngine16->Start();
+
+ // build default 'off' channel routing menus
+ [self buildRoutingMenu:YES];
+ [self buildRoutingMenu:NO];
+
+ // now read prefs
+ [self readGlobalPrefs];
+ }
+
+ // ask to be notified on system sleep to avoid a crash
+ IONotificationPortRef notify;
io_object_t anIterator;
root_port = IORegisterForSystemPower(self, &notify, MySleepCallBack, &anIterator);
if ( !root_port ) {
- printf("IORegisterForSystemPower failed\n");
+ printf("IORegisterForSystemPower failed\n");
}
- else
- CFRunLoopAddSource(CFRunLoopGetCurrent(),
+ else
+ CFRunLoopAddSource(CFRunLoopGetCurrent(),
IONotificationPortGetRunLoopSource(notify),
kCFRunLoopCommonModes);
}
- (void)applicationWillTerminate:(NSNotification *)aNotification
{
- if (gThruEngine2)
- gThruEngine2->Stop();
-
- if (gThruEngine16)
- gThruEngine16->Stop();
-
- if (mSoundflower2Device && mSoundflower16Device)
- [self writeGlobalPrefs];
+ if (gThruEngine2)
+ gThruEngine2->Stop();
+
+ if (gThruEngine16)
+ gThruEngine16->Stop();
+
+ if (mSoundflower2Device && mSoundflower16Device)
+ [self writeGlobalPrefs];
}
- (IBAction)bufferSizeChanged2ch:(id)sender
{
- UInt32 val = [m2chBuffer indexOfItem:sender];
- UInt32 size = 64 << val;
- gThruEngine2->SetBufferSize(size);
+ UInt32 val = [m2chBuffer indexOfItem:sender];
+ UInt32 size = 64 << val;
+ gThruEngine2->SetBufferSize(size);
- [mCur2chBufferSize setState:NSOffState];
- [sender setState:NSOnState];
- mCur2chBufferSize = sender;
+ [mCur2chBufferSize setState:NSOffState];
+ [sender setState:NSOnState];
+ mCur2chBufferSize = sender;
}
- (IBAction)bufferSizeChanged16ch:(id)sender
{
- UInt32 val = [m2chBuffer indexOfItem:sender];
- UInt32 size = 64 << val;
- gThruEngine16->SetBufferSize(size);
+ UInt32 val = [m2chBuffer indexOfItem:sender];
+ UInt32 size = 64 << val;
+ gThruEngine16->SetBufferSize(size);
- [mCur16chBufferSize setState:NSOffState];
- [sender setState:NSOnState];
- mCur16chBufferSize = sender;
+ [mCur16chBufferSize setState:NSOffState];
+ [sender setState:NSOnState];
+ mCur16chBufferSize = sender;
}
// iSchemy's edit
//
// action for item was clicked
-- (IBAction)cloningChanged:(id)sender
+- (IBAction)cloningChanged:(id)sender
{
- // change item's state
- [sender setState:([sender state]==NSOnState) ? NSOffState : NSOnState];
- gThruEngine2->SetCloneChannels([sender state]==NSOnState);
- [self writeDevicePrefs:YES];
+ // change item's state
+ [sender setState:([sender state]==NSOnState) ? NSOffState : NSOnState];
+ gThruEngine2->SetCloneChannels([sender state]==NSOnState);
+ [self writeDevicePrefs:YES];
}
// preferences read
- (IBAction)cloningChanged:(id)sender cloneChannels:(bool)clone
{
- gThruEngine2->SetCloneChannels(clone);
- [sender setState:(clone ? NSOnState : NSOffState)];
+ gThruEngine2->SetCloneChannels(clone);
+ [sender setState:(clone ? NSOnState : NSOffState)];
}
//
// end
- (IBAction)routingChanged2ch:(id)outDevChanItem
{
- NSMenu *outDevMenu = [outDevChanItem menu];
- NSMenu *superMenu = [outDevMenu supermenu];
- int sfChan = [superMenu indexOfItemWithSubmenu:outDevMenu] - 3;
- int outDevChan = [outDevMenu indexOfItem:outDevChanItem];
-
- // set the new channel map
- gThruEngine2->SetChannelMap(sfChan, outDevChan-1);
-
- // turn off all check marks
- for (int i = 0; i < [outDevMenu numberOfItems]; i++)
- [[outDevMenu itemAtIndex:i] setState:NSOffState];
-
- // set this one
- [outDevChanItem setState:NSOnState];
-
- // write to prefs
- [self writeDevicePrefs:YES];
+ NSMenu *outDevMenu = [outDevChanItem menu];
+ NSMenu *superMenu = [outDevMenu supermenu];
+ int sfChan = [superMenu indexOfItemWithSubmenu:outDevMenu] - 3;
+ int outDevChan = [outDevMenu indexOfItem:outDevChanItem];
+
+ // set the new channel map
+ gThruEngine2->SetChannelMap(sfChan, outDevChan-1);
+
+ // turn off all check marks
+ for (int i = 0; i < [outDevMenu numberOfItems]; i++)
+ [[outDevMenu itemAtIndex:i] setState:NSOffState];
+
+ // set this one
+ [outDevChanItem setState:NSOnState];
+
+ // write to prefs
+ [self writeDevicePrefs:YES];
}
- (IBAction)routingChanged16ch:(id)outDevChanItem
{
- NSMenu *outDevMenu = [outDevChanItem menu];
- NSMenu *superMenu = [outDevMenu supermenu];
- int sfChan = [superMenu indexOfItemWithSubmenu:outDevMenu] - 3;
- int outDevChan = [outDevMenu indexOfItem:outDevChanItem];
-
- gThruEngine16->SetChannelMap(sfChan, outDevChan-1);
-
- // turn off all check marks
- for (int i = 0; i < [outDevMenu numberOfItems]; i++)
- [[outDevMenu itemAtIndex:i] setState:NSOffState];
-
- // set this one
- [outDevChanItem setState:NSOnState];
-
- // write to prefs
- [self writeDevicePrefs:NO];
+ NSMenu *outDevMenu = [outDevChanItem menu];
+ NSMenu *superMenu = [outDevMenu supermenu];
+ int sfChan = [superMenu indexOfItemWithSubmenu:outDevMenu] - 3;
+ int outDevChan = [outDevMenu indexOfItem:outDevChanItem];
+
+ gThruEngine16->SetChannelMap(sfChan, outDevChan-1);
+
+ // turn off all check marks
+ for (int i = 0; i < [outDevMenu numberOfItems]; i++)
+ [[outDevMenu itemAtIndex:i] setState:NSOffState];
+
+ // set this one
+ [outDevChanItem setState:NSOnState];
+
+ // write to prefs
+ [self writeDevicePrefs:NO];
}
- (IBAction)outputDeviceSelected:(id)sender
{
- int val = [mMenu indexOfItem:sender];
- if (val < m16StartIndex) {
- val -= 2;
-
- // if 'None' was selected, our val will be == -1, which will return a NULL
- // device from the list, which is what we want anyway, and seems to work
- // here -- probably should check to see if there are any potential problems
- // and handle this more properly
- gThruEngine2->SetOutputDevice( (val < 0 ? kAudioDeviceUnknown : mMenuID2[val]) );
- //[self updateThruLatency];
-
- [mCur2chDevice setState:NSOffState];
- [sender setState:NSOnState];
- mCur2chDevice = sender;
-
- // get the channel routing from the prefs
- [self readDevicePrefs:YES];
-
- // now set the menu
- [self buildRoutingMenu:YES];
- }
- else {
- val -= (m16StartIndex+2);
-
- // if 'None' was selected, our val will be == -1, which will return a NULL
- // device from the list, which is what we want anyway, and seems to work
- // here -- probably should check to see if there are any potential problems
- // and handle this more properly
- gThruEngine16->SetOutputDevice( (val < 0 ? kAudioDeviceUnknown : mMenuID16[val]) );
- //[self updateThruLatency];
-
- [mCur16chDevice setState:NSOffState];
- [sender setState:NSOnState];
- mCur16chDevice = sender;
-
- // get the channel routing from the prefs
- [self readDevicePrefs:NO];
-
- // now set the menu
- [self buildRoutingMenu:NO];
- }
+ int val = [mMenu indexOfItem:sender];
+ if (val < m16StartIndex) {
+ val -= 2;
+
+ // if 'None' was selected, our val will be == -1, which will return a NULL
+ // device from the list, which is what we want anyway, and seems to work
+ // here -- probably should check to see if there are any potential problems
+ // and handle this more properly
+ gThruEngine2->SetOutputDevice( (val < 0 ? kAudioDeviceUnknown : mMenuID2[val]) );
+ //[self updateThruLatency];
+
+ [mCur2chDevice setState:NSOffState];
+ [sender setState:NSOnState];
+ mCur2chDevice = sender;
+
+ // get the channel routing from the prefs
+ [self readDevicePrefs:YES];
+
+ // now set the menu
+ [self buildRoutingMenu:YES];
+ }
+ else {
+ val -= (m16StartIndex+2);
+
+ // if 'None' was selected, our val will be == -1, which will return a NULL
+ // device from the list, which is what we want anyway, and seems to work
+ // here -- probably should check to see if there are any potential problems
+ // and handle this more properly
+ gThruEngine16->SetOutputDevice( (val < 0 ? kAudioDeviceUnknown : mMenuID16[val]) );
+ //[self updateThruLatency];
+
+ [mCur16chDevice setState:NSOffState];
+ [sender setState:NSOnState];
+ mCur16chDevice = sender;
+
+ // get the channel routing from the prefs
+ [self readDevicePrefs:NO];
+
+ // now set the menu
+ [self buildRoutingMenu:NO];
+ }
}
@@ -908,260 +908,260 @@ - (void)doNothing
- (void)readGlobalPrefs
{
- CFStringRef strng = (CFStringRef) CFPreferencesCopyAppValue(CFSTR("2ch Output Device"), kCFPreferencesCurrentApplication);
- if (strng) {
- char name[64];
- CFStringGetCString(strng, name, 64, kCFStringEncodingMacRoman);
- NSMenuItem *item = [mMenu itemWithTitle:[NSString stringWithCString:name]];
- if (item)
- [self outputDeviceSelected:item];
- }
-
- strng = (CFStringRef) CFPreferencesCopyAppValue(CFSTR("16ch Output Device"), kCFPreferencesCurrentApplication);
- if (strng) {
- char name[64];
- CFStringGetCString(strng, name, 64, kCFStringEncodingMacRoman);
-
- // itemWithTitle only returns the first instance, and we need to find the second one, so
- // make calculations based on index #
- int index = [mMenu indexOfItemWithTitle:[NSString stringWithCString:name]];
- if (index >= 0)
- [self outputDeviceSelected:[mMenu itemAtIndex:(m16StartIndex+index)]];
- }
-
- CFNumberRef num = (CFNumberRef) CFPreferencesCopyAppValue(CFSTR("2ch Buffer Size"), kCFPreferencesCurrentApplication);
- if (num) {
- UInt32 val;
- CFNumberGetValue(num, kCFNumberLongType, &val);
- CFRelease(num);
-
- switch (val) {
- case 64:
- [self bufferSizeChanged2ch:[m2chBuffer itemAtIndex:0]];
- break;
- case 128:
- [self bufferSizeChanged2ch:[m2chBuffer itemAtIndex:1]];
- break;
- case 256:
- [self bufferSizeChanged2ch:[m2chBuffer itemAtIndex:2]];
- break;
- case 1024:
- [self bufferSizeChanged2ch:[m2chBuffer itemAtIndex:4]];
- break;
- case 2048:
- [self bufferSizeChanged2ch:[m2chBuffer itemAtIndex:5]];
- break;
-
- case 512:
- default:
- [self bufferSizeChanged2ch:[m2chBuffer itemAtIndex:3]];
- break;
- }
- }
-
- num = (CFNumberRef) CFPreferencesCopyAppValue(CFSTR("16ch Buffer Size"), kCFPreferencesCurrentApplication);
- if (num) {
- UInt32 val;
- CFNumberGetValue(num, kCFNumberLongType, &val);
- CFRelease(num);
-
- switch (val) {
- case 64:
- [self bufferSizeChanged16ch:[m16chBuffer itemAtIndex:0]];
- break;
- case 128:
- [self bufferSizeChanged16ch:[m16chBuffer itemAtIndex:1]];
- break;
- case 256:
- [self bufferSizeChanged16ch:[m16chBuffer itemAtIndex:2]];
- break;
- case 1024:
- [self bufferSizeChanged16ch:[m16chBuffer itemAtIndex:4]];
- break;
- case 2048:
- [self bufferSizeChanged16ch:[m16chBuffer itemAtIndex:5]];
- break;
-
- case 512:
- default:
- [self bufferSizeChanged16ch:[m16chBuffer itemAtIndex:3]];
- break;
- }
- }
+ CFStringRef strng = (CFStringRef) CFPreferencesCopyAppValue(CFSTR("2ch Output Device"), kCFPreferencesCurrentApplication);
+ if (strng) {
+ char name[64];
+ CFStringGetCString(strng, name, 64, kCFStringEncodingMacRoman);
+ NSMenuItem *item = [mMenu itemWithTitle:[NSString stringWithCString:name]];
+ if (item)
+ [self outputDeviceSelected:item];
+ }
+
+ strng = (CFStringRef) CFPreferencesCopyAppValue(CFSTR("16ch Output Device"), kCFPreferencesCurrentApplication);
+ if (strng) {
+ char name[64];
+ CFStringGetCString(strng, name, 64, kCFStringEncodingMacRoman);
+
+ // itemWithTitle only returns the first instance, and we need to find the second one, so
+ // make calculations based on index #
+ int index = [mMenu indexOfItemWithTitle:[NSString stringWithCString:name]];
+ if (index >= 0)
+ [self outputDeviceSelected:[mMenu itemAtIndex:(m16StartIndex+index)]];
+ }
+
+ CFNumberRef num = (CFNumberRef) CFPreferencesCopyAppValue(CFSTR("2ch Buffer Size"), kCFPreferencesCurrentApplication);
+ if (num) {
+ UInt32 val;
+ CFNumberGetValue(num, kCFNumberLongType, &val);
+ CFRelease(num);
+
+ switch (val) {
+ case 64:
+ [self bufferSizeChanged2ch:[m2chBuffer itemAtIndex:0]];
+ break;
+ case 128:
+ [self bufferSizeChanged2ch:[m2chBuffer itemAtIndex:1]];
+ break;
+ case 256:
+ [self bufferSizeChanged2ch:[m2chBuffer itemAtIndex:2]];
+ break;
+ case 1024:
+ [self bufferSizeChanged2ch:[m2chBuffer itemAtIndex:4]];
+ break;
+ case 2048:
+ [self bufferSizeChanged2ch:[m2chBuffer itemAtIndex:5]];
+ break;
+
+ case 512:
+ default:
+ [self bufferSizeChanged2ch:[m2chBuffer itemAtIndex:3]];
+ break;
+ }
+ }
+
+ num = (CFNumberRef) CFPreferencesCopyAppValue(CFSTR("16ch Buffer Size"), kCFPreferencesCurrentApplication);
+ if (num) {
+ UInt32 val;
+ CFNumberGetValue(num, kCFNumberLongType, &val);
+ CFRelease(num);
+
+ switch (val) {
+ case 64:
+ [self bufferSizeChanged16ch:[m16chBuffer itemAtIndex:0]];
+ break;
+ case 128:
+ [self bufferSizeChanged16ch:[m16chBuffer itemAtIndex:1]];
+ break;
+ case 256:
+ [self bufferSizeChanged16ch:[m16chBuffer itemAtIndex:2]];
+ break;
+ case 1024:
+ [self bufferSizeChanged16ch:[m16chBuffer itemAtIndex:4]];
+ break;
+ case 2048:
+ [self bufferSizeChanged16ch:[m16chBuffer itemAtIndex:5]];
+ break;
+
+ case 512:
+ default:
+ [self bufferSizeChanged16ch:[m16chBuffer itemAtIndex:3]];
+ break;
+ }
+ }
}
-
+
- (void)writeGlobalPrefs
{
- CFStringRef cfstr = CFStringCreateWithCString(kCFAllocatorSystemDefault, [[mCur2chDevice title] cString], kCFStringEncodingMacRoman);
- CFPreferencesSetAppValue(CFSTR("2ch Output Device"), cfstr, kCFPreferencesCurrentApplication);
- CFRelease(cfstr);
-
- cfstr = CFStringCreateWithCString(kCFAllocatorSystemDefault, [[mCur16chDevice title] cString], kCFStringEncodingMacRoman);
- CFPreferencesSetAppValue(CFSTR("16ch Output Device"), cfstr, kCFPreferencesCurrentApplication);
- CFRelease(cfstr);
-
- UInt32 val = 64 << [m2chBuffer indexOfItem:mCur2chBufferSize];
- CFNumberRef number = CFNumberCreate(kCFAllocatorSystemDefault, kCFNumberIntType, &val);
- CFPreferencesSetAppValue(CFSTR("2ch Buffer Size"), number, kCFPreferencesCurrentApplication);
- CFRelease(number);
-
- val = 64 << [m16chBuffer indexOfItem:mCur16chBufferSize];
- number = CFNumberCreate(kCFAllocatorSystemDefault, kCFNumberIntType, &val);
- CFPreferencesSetAppValue(CFSTR("16ch Buffer Size"), number, kCFPreferencesCurrentApplication);
- CFRelease(number);
-
- CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication);
+ CFStringRef cfstr = CFStringCreateWithCString(kCFAllocatorSystemDefault, [[mCur2chDevice title] cString], kCFStringEncodingMacRoman);
+ CFPreferencesSetAppValue(CFSTR("2ch Output Device"), cfstr, kCFPreferencesCurrentApplication);
+ CFRelease(cfstr);
+
+ cfstr = CFStringCreateWithCString(kCFAllocatorSystemDefault, [[mCur16chDevice title] cString], kCFStringEncodingMacRoman);
+ CFPreferencesSetAppValue(CFSTR("16ch Output Device"), cfstr, kCFPreferencesCurrentApplication);
+ CFRelease(cfstr);
+
+ UInt32 val = 64 << [m2chBuffer indexOfItem:mCur2chBufferSize];
+ CFNumberRef number = CFNumberCreate(kCFAllocatorSystemDefault, kCFNumberIntType, &val);
+ CFPreferencesSetAppValue(CFSTR("2ch Buffer Size"), number, kCFPreferencesCurrentApplication);
+ CFRelease(number);
+
+ val = 64 << [m16chBuffer indexOfItem:mCur16chBufferSize];
+ number = CFNumberCreate(kCFAllocatorSystemDefault, kCFNumberIntType, &val);
+ CFPreferencesSetAppValue(CFSTR("16ch Buffer Size"), number, kCFPreferencesCurrentApplication);
+ CFRelease(number);
+
+ CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication);
}
- (CFStringRef)formDevicePrefName:(BOOL)is2ch
{
- if (is2ch) {
- NSString *routingTag = @" [2ch Routing]";
- NSString *deviceName = [mCur2chDevice title];
- return CFStringCreateWithCString(kCFAllocatorSystemDefault, [[deviceName stringByAppendingString:routingTag] cString], kCFStringEncodingMacRoman);
- } else {
- NSString *routingTag = @" [16ch Routing]";
- NSString *deviceName = [mCur16chDevice title];
- return CFStringCreateWithCString(kCFAllocatorSystemDefault, [[deviceName stringByAppendingString:routingTag] cString], kCFStringEncodingMacRoman);
- }
+ if (is2ch) {
+ NSString *routingTag = @" [2ch Routing]";
+ NSString *deviceName = [mCur2chDevice title];
+ return CFStringCreateWithCString(kCFAllocatorSystemDefault, [[deviceName stringByAppendingString:routingTag] cString], kCFStringEncodingMacRoman);
+ } else {
+ NSString *routingTag = @" [16ch Routing]";
+ NSString *deviceName = [mCur16chDevice title];
+ return CFStringCreateWithCString(kCFAllocatorSystemDefault, [[deviceName stringByAppendingString:routingTag] cString], kCFStringEncodingMacRoman);
+ }
}
- (void)readDevicePrefs:(BOOL)is2ch
{
- AudioThruEngine *thruEng = (is2ch ? gThruEngine2 : gThruEngine16);
- int numChans = (is2ch ? 2 : 64);
- CFStringRef arrayName = [self formDevicePrefName:is2ch];
- CFArrayRef mapArray = (CFArrayRef) CFPreferencesCopyAppValue(arrayName, kCFPreferencesCurrentApplication);
-
- if (mapArray) {
- for (int i = 0; i < numChans; i++) {
- CFNumberRef num = (CFNumberRef)CFArrayGetValueAtIndex(mapArray, i);
- if (num) {
- UInt32 val;
- CFNumberGetValue(num, kCFNumberLongType, &val);
- thruEng->SetChannelMap(i, val-1);
- //CFRelease(num);
- }
- }
- //CFRelease(mapArray);
- }
- else { // set to default
- for (int i = 0; i < numChans; i++)
- thruEng->SetChannelMap(i, i);
- }
-
- //CFRelease(arrayName);
-
- // iSchemy's edit
- //
- // cloning is enabled only for 2ch mode
- // sorta makes sense, huh?
- if (is2ch) {
- CFBooleanRef clone = (CFBooleanRef)CFPreferencesCopyAppValue(CFSTR("Clone channels"), kCFPreferencesCurrentApplication);
- // if cloning is enabled in preferences, it will affect also the menu item's state
- NSMenuItem* item = [[m2chMenu submenu] itemWithTitle:@"Clone to all channels"];
- if (clone && item) {
- [self cloningChanged:item cloneChannels:CFBooleanGetValue(clone)];
- CFRelease(clone);
- }
- // but if it is disabled, no state changing is needed
- else {
- thruEng->SetCloneChannels(false);
- }
- }
- //
- // end
+ AudioThruEngine *thruEng = (is2ch ? gThruEngine2 : gThruEngine16);
+ int numChans = (is2ch ? 2 : 64);
+ CFStringRef arrayName = [self formDevicePrefName:is2ch];
+ CFArrayRef mapArray = (CFArrayRef) CFPreferencesCopyAppValue(arrayName, kCFPreferencesCurrentApplication);
+
+ if (mapArray) {
+ for (int i = 0; i < numChans; i++) {
+ CFNumberRef num = (CFNumberRef)CFArrayGetValueAtIndex(mapArray, i);
+ if (num) {
+ UInt32 val;
+ CFNumberGetValue(num, kCFNumberLongType, &val);
+ thruEng->SetChannelMap(i, val-1);
+ //CFRelease(num);
+ }
+ }
+ //CFRelease(mapArray);
+ }
+ else { // set to default
+ for (int i = 0; i < numChans; i++)
+ thruEng->SetChannelMap(i, i);
+ }
+
+ //CFRelease(arrayName);
+
+ // iSchemy's edit
+ //
+ // cloning is enabled only for 2ch mode
+ // sorta makes sense, huh?
+ if (is2ch) {
+ CFBooleanRef clone = (CFBooleanRef)CFPreferencesCopyAppValue(CFSTR("Clone channels"), kCFPreferencesCurrentApplication);
+ // if cloning is enabled in preferences, it will affect also the menu item's state
+ NSMenuItem* item = [[m2chMenu submenu] itemWithTitle:@"Clone to all channels"];
+ if (clone && item) {
+ [self cloningChanged:item cloneChannels:CFBooleanGetValue(clone)];
+ CFRelease(clone);
+ }
+ // but if it is disabled, no state changing is needed
+ else {
+ thruEng->SetCloneChannels(false);
+ }
+ }
+ //
+ // end
}
- (void)writeDevicePrefs:(BOOL)is2ch
{
- AudioThruEngine *thruEng = (is2ch ? gThruEngine2 : gThruEngine16);
- int numChans = (is2ch ? 2 : 64);
- CFNumberRef map[64];
-
- CFStringRef arrayName = [self formDevicePrefName:is2ch];
-
- for (int i = 0; i < numChans; i++)
- {
- UInt32 val = thruEng->GetChannelMap(i) + 1;
- map[i] = CFNumberCreate(kCFAllocatorSystemDefault, kCFNumberIntType, &val);
- }
-
- CFArrayRef mapArray = CFArrayCreate(kCFAllocatorSystemDefault, (const void**)&map, numChans, NULL);
- CFPreferencesSetAppValue(arrayName, mapArray, kCFPreferencesCurrentApplication);
- //CFRelease(mapArray);
-
- //for (int i = 0; i < numChans; i++)
- // CFRelease(map[i]);
-
- //CFRelease(arrayName);
-
- // iSchemy's edit
- //
- // I think that this needs no commentary
- if(is2ch){
- char cloneValue = thruEng->CloneChannels();
- CFNumberRef clone = (CFNumberRef)CFNumberCreate(kCFAllocatorSystemDefault, kCFNumberCharType, &cloneValue);
- CFPreferencesSetAppValue(CFSTR("Clone channels"),
- clone,
- kCFPreferencesCurrentApplication);
- CFRelease(clone);
- }
- //
- // end
-
- CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication);
+ AudioThruEngine *thruEng = (is2ch ? gThruEngine2 : gThruEngine16);
+ int numChans = (is2ch ? 2 : 64);
+ CFNumberRef map[64];
+
+ CFStringRef arrayName = [self formDevicePrefName:is2ch];
+
+ for (int i = 0; i < numChans; i++)
+ {
+ UInt32 val = thruEng->GetChannelMap(i) + 1;
+ map[i] = CFNumberCreate(kCFAllocatorSystemDefault, kCFNumberIntType, &val);
+ }
+
+ CFArrayRef mapArray = CFArrayCreate(kCFAllocatorSystemDefault, (const void**)&map, numChans, NULL);
+ CFPreferencesSetAppValue(arrayName, mapArray, kCFPreferencesCurrentApplication);
+ //CFRelease(mapArray);
+
+ //for (int i = 0; i < numChans; i++)
+ // CFRelease(map[i]);
+
+ //CFRelease(arrayName);
+
+ // iSchemy's edit
+ //
+ // I think that this needs no commentary
+ if(is2ch){
+ char cloneValue = thruEng->CloneChannels();
+ CFNumberRef clone = (CFNumberRef)CFNumberCreate(kCFAllocatorSystemDefault, kCFNumberCharType, &cloneValue);
+ CFPreferencesSetAppValue(CFSTR("Clone channels"),
+ clone,
+ kCFPreferencesCurrentApplication);
+ CFRelease(clone);
+ }
+ //
+ // end
+
+ CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication);
}
-(void)doAudioSetup
{
- [[NSWorkspace sharedWorkspace] launchApplication:@"Audio MIDI Setup"];
+ [[NSWorkspace sharedWorkspace] launchApplication:@"Audio MIDI Setup"];
}
-(void)doAbout
{
- // orderFrontStandardAboutPanel doesnt work for background apps
- [mAboutController doAbout];
+ // orderFrontStandardAboutPanel doesnt work for background apps
+ [mAboutController doAbout];
}
- (void)doQuit
{
- [NSApp terminate:nil];
+ [NSApp terminate:nil];
}
/*- (void)updateActualLatency:(NSTimer *)timer
{
- double thruTime = gThruEngine2->GetThruTime();
- NSString *msg = [NSString stringWithFormat: @"%.0f", thruTime];
-
- char *errmsg = gThruEngine2->GetErrorMessage();
- msg = [NSString stringWithCString: errmsg];
+ double thruTime = gThruEngine2->GetThruTime();
+ NSString *msg = [NSString stringWithFormat: @"%.0f", thruTime];
+
+ char *errmsg = gThruEngine2->GetErrorMessage();
+ msg = [NSString stringWithCString: errmsg];
}
- (IBAction)toggleThru:(id)sender
{
- bool enabled = [sender intValue];
- gThruEngine2->EnableThru(enabled);
+ bool enabled = [sender intValue];
+ gThruEngine2->EnableThru(enabled);
}
- (IBAction)inputLoadChanged:(id)sender
{
- gThruEngine2->SetInputLoad( [sender floatValue] / 100. );
- gThruEngine16->SetInputLoad( [sender floatValue] / 100. );
+ gThruEngine2->SetInputLoad( [sender floatValue] / 100. );
+ gThruEngine16->SetInputLoad( [sender floatValue] / 100. );
}
- (IBAction)outputLoadChanged:(id)sender
{
- gThruEngine2->SetOutputLoad( [sender floatValue] / 100. );
- gThruEngine16->SetOutputLoad( [sender floatValue] / 100. );
+ gThruEngine2->SetOutputLoad( [sender floatValue] / 100. );
+ gThruEngine16->SetOutputLoad( [sender floatValue] / 100. );
}
- (IBAction)extraLatencyChanged:(id)sender
{
- int val = [sender intValue];
- gThruEngine2->SetExtraLatency(val);
- [self updateThruLatency];
+ int val = [sender intValue];
+ gThruEngine2->SetExtraLatency(val);
+ [self updateThruLatency];
}
*/
View
178 SoundflowerBed/AudioDevice.cpp
@@ -1,114 +1,114 @@
-/* Copyright: © Copyright 2004 Apple Computer, Inc. All rights reserved.
-
- Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc.
- ("Apple") in consideration of your agreement to the following terms, and your
- use, installation, modification or redistribution of this Apple software
- constitutes acceptance of these terms. If you do not agree with these terms,
- please do not use, install, modify or redistribute this Apple software.
-
- In consideration of your agreement to abide by the following terms, and subject
- to these terms, Apple grants you a personal, non-exclusive license, under AppleÕs
- copyrights in this original Apple software (the "Apple Software"), to use,
- reproduce, modify and redistribute the Apple Software, with or without
- modifications, in source and/or binary forms; provided that if you redistribute
- the Apple Software in its entirety and without modifications, you must retain