Re: MatrixMixer input bus connection info
Re: MatrixMixer input bus connection info
- Subject: Re: MatrixMixer input bus connection info
- From: Christopher Ashworth <email@hidden>
- Date: Thu, 8 Mar 2007 15:12:25 -0500
On Mar 8, 2007, at 3:03 PM, email@hidden wrote:
I am dynamically connecting and disconnecting AudioUnits to a
MatrixMixer
and I am looking for a way to find the first "free" input bus that is
currently not connected.
FWIW, I do this but I do it with basic foundation classes, e.g:
NSMutableDictionary *_usedBusToSound; ///< Map from bus number to
Sound object pointer.
NSMutableDictionary *_soundToUsedBus; ///< Map from Sound object
pointer to bus number.
NSMutableArray *_freeBusses; ///< List of free bus numbers.
And just update the maps and lists when I make changes to the
MatrixMixer.
e.g.:
- (OSStatus) attachSound: (id) sound
{
OSStatus err = noErr;
NSValue *soundAddress = [NSValue valueWithPointer:sound];
NSNumber *bus;
@synchronized(self) {
@synchronized(_usedBusToSound) {
bus = [_soundToUsedBus objectForKey:soundAddress];
if (bus != nil)
return noErr;
#if SOUND_DEVICE_DEBUG
NSLog( @"Attaching %@ to %@", sound, [self deviceName] );
#endif
if ([_freeBusses count] == 0) {
NSLog( @"WARNING: No busses left for device '%@'!", [self
deviceName] );
return -1;
}
bus = [_freeBusses objectAtIndex:0];
[_usedBusToSound setObject:soundAddress forKey:bus];
[_soundToUsedBus setObject:bus forKey:soundAddress];
[_freeBusses removeObjectAtIndex:0];
}
[self setInputEnabled:YES forBus:[bus intValue]];
err = AUGraphStart(_graph);
}
return err;
}
I don't recall if you can query the MatrixMixer directly for the info
you want.
Christopher
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden