CallHostTransportState fails when called by an AudioUnit CocoaView
CallHostTransportState fails when called by an AudioUnit CocoaView
- Subject: CallHostTransportState fails when called by an AudioUnit CocoaView
- From: "Erickson, Mark C" <email@hidden>
- Date: Fri, 26 Sep 2008 13:48:00 -0500
- Acceptlanguage: en-US
- Thread-topic: CallHostTransportState fails when called by an AudioUnit CocoaView
Title: CallHostTransportState fails when called by an AudioUnit CocoaView
In an audiounit the CocoaView needs to know whether audio is currently playing.
I have implemented this as a custom property.
The code shown below works in DP6 but fails in GarageBand, Logic Express, and Logic Pro.
When failing, CallHostTransportState returns –10878 which is predefined as kAudioUnitErr_InvalidParameter.
Does anyone know why this would fail?
Alternately, is there a better way to tell when the transport is in ‘play’ or ‘stop’?
Thanks
Mark
OSStatus testAU::GetProperty( AudioUnitPropertyID inID,
AudioUnitScope inScope,
AudioUnitElement inElement,
void * outData )
{
if ( inScope == kAudioUnitScope_Global )
{
switch ( inID )
{
case kAudioUnitProperty_GetHostStatus:
{
if ( !IsInitialized() ) return kAudioUnitErr_Uninitialized;
Boolean isPlaying = false;
OSStatus err = CallHostTransportState( &isPlaying, NULL, NULL, NULL, NULL, NULL );
SInt32 returnVal = 0;
if ( isPlaying == true ) returnVal = 1;
if ( err != noErr ) returnVal = err;
*((SInt32 *)outData) = returnVal;
return noErr;
}
}
}
return AUEffectBase::GetProperty (inID, inScope, inElement, outData);
}
_______________________________________________
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