• 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
Re: Side-chain detection
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Side-chain detection


  • Subject: Re: Side-chain detection
  • From: "john smith" <email@hidden>
  • Date: Tue, 22 Nov 2005 22:12:04 +0100

I'm trying to detect whether the host is using a potential second input bus in my plug-ins. I tried GetInput(1), assuming it would return 0 if no such second bus was present, but it crashes the plug-in (or, if in the compiler, hangs).
By the description of your crash I'd guess that the second input bus has not yet been created when you're trying to access it, which could have 2 reasons:

a) you're using a writable input bus count and it's still set to 1
solution: I'd assume that your AU can't handle more than 2 input busses, so you shouldn't have a writable input bus count in first place - use a fixed input bus count of 2 instead.

No, the bus count is not writeable. Or at least I don't think it is. Depending on which product it is, it is either

A: Standard template code
or
B: Standard template code with an additional Inputs.SetBusCount(2) in the constructor.


b) you're trying to access the elements before they have actually been created by CreateElements().
solution: place the check at some later point, after the elements have been created (done in the PostConstructor () of AUBase), or call CreateElements() earlier if you need to do this in your c'tor, like done in the SDK examples.

I'm doing it in Initialize(), which should be ok from what I can read here.


So, am I to understand that GetInput(1) is supposed to work, and is the proper way to do it?



Thanks,

Michael Olsen


It should probably be noted that I'd prefer to do this check in Initialize() (if possible).
Once your elements have been created properly, then GetInput() will return an element that you can query for its connection via IsActive().
This can be done in your implementation of Initialize().


Best,
Stefan


_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


_______________________________________________
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: Side-chain detection
      • From: Stefan Gretscher <email@hidden>
References: 
 >Re: Side-chain detection (From: Stefan Gretscher <email@hidden>)

  • Prev by Date: Re: Side-chain detection
  • Next by Date: CAF file extension?
  • Previous by thread: Re: Side-chain detection
  • Next by thread: Re: Side-chain detection
  • Index(es):
    • Date
    • Thread