void AudioUnitController::setup(string name, OSType type, OSType subType, OSType manufacturer) { this->name = name; this->type = type; this->subType = subType; this->manufacturer = manufacturer; color = ofColor(ofRandom(255), ofRandom(255), ofRandom(255)); synth = ofxAudioUnitSampler(type, subType, manufacturer); loadParameterGroups(); AUEventListenerCreate(&AudioUnitController::audioUnitParameterChanged, this, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode, 0.005, // minimum callback interval (seconds) 0.005, // callback granularity (for rate-limiting) &auEventListener); }
AUCarbonViewBase::AUCarbonViewBase(AudioUnitCarbonView inInstance, Float32 inNotificationInterval /* in seconds */) : ComponentBase(inInstance), mEditAudioUnit(0), mParameterListener(NULL), #if !__LP64__ mEventListener(NULL), #endif mTimerRef (NULL), mTimerUPP (NULL), mCarbonWindow(NULL), mCarbonPane(NULL), mXOffset(0), mYOffset(0) { AUEventListenerCreate (ParameterListener, this, CFRunLoopGetCurrent(), kCFRunLoopCommonModes, inNotificationInterval, inNotificationInterval, &mParameterListener); }