• 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: Automation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Automation


  • Subject: Re: Automation
  • From: Urs Heckmann <email@hidden>
  • Date: Sun, 20 Nov 2005 14:37:45 +0100

Hiya,

A typical floating point parameter change in the UI goes as follows if it wants to be automatable:

User issues a mouse down on a control object

Control object fires a kAudioUnitCarbonViewEvent_MouseDownInControl event for the parameter(s) related to the control

Control awaits mouse drag events

On mouse drag events, control fires AUParameterSet(NULL, NULL, &Parm, fValue, 0); just like you do

Upon mouse up, control object fires a kAudioUnitCarbonViewEvent_MouseUpInControl event for the parameter(s) related to the control

Here's a little helper I wrote for myself:

void MyAUCarbonViewDerivate::parameterGesture ( int inParamID, bool begin )
{
AudioUnitParameter param;

param.mAudioUnit = GetEditAudioUnit();
param.mParameterID = inParamID;
param.mScope = 0;
param.mElement = 0;

AudioUnitCarbonViewEventID gestureType;

if ( !begin ) gestureType = kAudioUnitCarbonViewEvent_MouseUpInControl;
else gestureType = kAudioUnitCarbonViewEvent_MouseDownInControl;

if (mEventListener) (*mEventListener)(mEventListenerUserData, mComponentInstance, &param, gestureType, NULL );
}


Alternatively (and probably recommended although there had been problems in the past) you can implement the newer AUEvents:

AudioUnitEvent myAUEvent;

if ( begin )
myAUEvent.mEventType = kAudioUnitEvent_BeginParameterChangeGesture;
else
myAUEvent.mEventType = kAudioUnitEvent_EndParameterChangeGesture;

myAUEvent.mArgument.mParameter.mAudioUnit = GetEditAudioUnit();
myAUEvent.mArgument.mParameter.mScope = 0;
myAUEvent.mArgument.mParameter.mElement = 0;
myAUEvent.mArgument.mParameter.mParameterID = inParamID;

OSStatus err = AUEventListenerNotify( myAUEventListenerRef, this, &myAUEvent );


This requires you to have a AUEventListener installed (in opposition to the listener mEventListener that's in your CarbonView anyway). However, this stuff has been source to wondefully untracable crashes on systems prior to 10.3.6 or so, I don't remember. Hence *I* recommend the old stuff.

Cheers,

;)  Urs



Am 20.11.2005 um 14:14 schrieb john smith:


I have some trouble getting automation working.

When I detect a parameter change in my plug-in, I do the following (from my view class):

AudioUnitParameter Parm = {
	mEditAudioUnit,
	AudioUnitParameterID(iIndex),
	kAudioUnitScope_Global,
	0
};

AUParameterSet(NULL, NULL, &Parm, fValue, 0);


where iIndex is the parameter index, and fValue is the new value of the parameter.


However, nothing happens (tested with logic). When I switch to control view automation works fine, so it's not because I don't know how to operate the host.


What could I be doing wrong? As I read it, this is excactly what the documentation says I should do.



Thanks,

Michael Olsen

_________________________________________________________________
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


_______________________________________________ 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: Automation
      • From: "john smith" <email@hidden>
References: 
 >Automation (From: "john smith" <email@hidden>)

  • Prev by Date: Automation
  • Next by Date: Re: Automation
  • Previous by thread: Automation
  • Next by thread: Re: Automation
  • Index(es):
    • Date
    • Thread