• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
CallHostTransportState fails when called by an AudioUnit CocoaView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: CallHostTransportState fails when called by an AudioUnit CocoaView
      • From: William Stewart <email@hidden>
  • Prev by Date: Re: dev. in leopard, won't run in tiger
  • Next by Date: Re: CallHostTransportState fails when called by an AudioUnit CocoaView
  • Previous by thread: Re: AUEventListenerCreate / AUEventListenerAddEventType
  • Next by thread: Re: CallHostTransportState fails when called by an AudioUnit CocoaView
  • Index(es):
    • Date
    • Thread