• 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
making AUEffectBase::GetSampleRate safer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

making AUEffectBase::GetSampleRate safer


  • Subject: making AUEffectBase::GetSampleRate safer
  • From: Marc Poirier <email@hidden>
  • Date: Wed, 30 Jul 2003 11:58:26 -0500 (CDT)

Hi. AUEffectBase::GetSampleRate crashes if the elements have not been
created, which in practice means: it crashes if you call it from your
plugin's constructor. How about making the method look something like
this to make it safer:

Float64 AUEffectBase::GetSampleRate()
{
if (mElementsCreated)
return GetOutput(0)->GetStreamFormat().mSampleRate;
else
return kAUDefaultSampleRate;
}

But you'll have to make mElementsCreated protected rather than private or
add an accessor or something like that. Or alternatively, I guess you
could just add a call to CreateElements() to the AUEffectBase constructor.

Just an idea...

Thanks,
Marc
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: VST->AU SDK registering extra components
  • Next by Date: MIDI Clock with MIDIPacketList parsing
  • Previous by thread: VST->AU SDK registering extra components
  • Next by thread: MIDI Clock with MIDIPacketList parsing
  • Index(es):
    • Date
    • Thread