• 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: Wed, 23 Nov 2005 20:47:34 +0100


Stefan,

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.
Is there a reason why you don't directly set the correct bus count in the c'tor parameter of AUBase instead?
Because if you access the elements in your c'tor to increase their count, then they most likely have not been created yet via CreateElements(). As I described below, element creation happens in the post-c'tor, unless you manually add it in your c'tor.

CreateElements() is called first in the constructor, as it always is in the template.


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.
Yes it should - for a test, just read the bus count to verify it has the number you're expecting it to have. Then you'll know whether the problem is the bus count (as I expect) or something else is wrong.

Would that be Inputs.GetBusCount()???

Note, in some cases the bus count is 1 (see case "A" above). Maybe I was wrong in expecting GetInputs(1) to not crash (but rather return 0), even if the bus count is 1.

So, am I to understand that GetInput(1) is supposed to work, and is the proper way to do it?
This just gets you the input element, you should always get a valid object here once everything has been created.
As I wrote before, you need to query this object for it's connection via IsActive():

Ah, ok, great. So, I guess the solution is this:

1: Don't call GetInput(1) if I only have 1 input bus (I.e. keep track of my bus count myself).

2: If I have 2 input busses, I can call GetInput(1), which will always return an object

3: If I have 2 input busses, I can call GetInput(1).IsActive() to determine whether it's actually "in use" (or "activated" or "has input" or whatever the proper term is).


Is this correct?


Thanks,

Michael Olsen

Once your elements have been created properly, then GetInput() will return an element that you can query for its connection via IsActive().

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: Realtime synthesis and low latency with Java
  • Next by Date: Subject: convertInputSamples/clipOutputSamples
  • Previous by thread: Re: Side-chain detection
  • Next by thread: Re: Side-chain detection
  • Index(es):
    • Date
    • Thread