Re: Destroying an Aggregate device (via code)
Re: Destroying an Aggregate device (via code)
- Subject: Re: Destroying an Aggregate device (via code)
- From: Jeff Moore <email@hidden>
- Date: Mon, 10 Jul 2006 18:01:08 -0700
Basically, you aren't passing the arguments to
AudioObjectGetPropertyData() correctly. As you have found,
kAudioPlugInDestroyAggregateDevice takes the AudioObjectID of the
aggregate to be destroyed. You are correctly trying to pass that info
to AudioObjectGetPropertyData(). Unfortunately, your mistake is that
you are passing it in the qualifier arguments rather than the data
arguments. Here's the change you need to make:
- (void) destroyAggregate:(AudioObjectID)aggregateID {
OSStatus err
AudioObjectPropertyAddress theAddress;
theAddress.mSelector = kAudioPlugInDestroyAggregateDevice;
theAddress.mScope = kAudioObjectPropertyScopeGlobal;
theAddress.mElement = kAudioObjectPropertyElementMaster;
AudioDeviceID theID = [self basePlugin];
UInt32 theSize = sizeof(AudioObjectID);
BAILSETERR( AudioObjectGetPropertyData(theID, &theAddress, 0, NULL,
&theSize, &aggregateID) );
bail:
if(err) {
[NSException raise:@"DestroyAggregate" format:@"Unable to destroy
aggregate device %i, error %d", aggregateID, err];
}
}
On Jul 10, 2006, at 5:46 PM, Neil Clayton wrote:
- (void) destroyAggregate:(AudioObjectID)aggregateID {
OSStatus err;
AudioObjectPropertyAddress theAddress;
theAddress.mSelector = kAudioPlugInDestroyAggregateDevice;
theAddress.mScope = kAudioObjectPropertyScopeGlobal;
theAddress.mElement = kAudioObjectPropertyElementMaster;
AudioDeviceID theID = [self basePlugin];
BAILSETERR( AudioObjectGetPropertyData(theID, &theAddress, sizeof
(AudioObjectID), &aggregateID, nil, nil) );
bail:
if(err) {
[NSException raise:@"DestroyAggregate" format:@"Unable to destroy
aggregate device %i, error %d", aggregateID, err];
}
}
I've verified that variable 'theID' points to the same thing when
creating and during this method. I figure I've just done something
stupid in the call to AudioObjectGetPropertyData. Can someone put
me right?
--
Jeff Moore
Core Audio
Apple
_______________________________________________
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