18 #include <AudioToolbox/AudioUnitUtilities.h> 19 #include "AUInstrumentBase.h" 77 virtual ComponentResult
Version() {
return 1000;}
84 AudioUnitScope nScope,
85 AudioUnitElement inElement,
87 Boolean& outWritable );
90 virtual OSStatus
GetProperty(AudioUnitPropertyID inID,
91 AudioUnitScope inScope,
92 AudioUnitElement inElement,
96 virtual OSStatus
SetProperty(AudioUnitPropertyID inID,
97 AudioUnitScope inScope,
98 AudioUnitElement inElement,
104 AudioUnitParameterID inParameterID,
105 AudioUnitParameterInfo &outParameterInfo );
108 virtual ComponentResult
GetPresets(CFArrayRef* outData)
const;
125 virtual Float64 GetTailTime()
138 virtual ComponentResult
SetParameter(AudioUnitParameterID inID,
139 AudioUnitScope inScope,
140 AudioUnitElement inElement,
141 AudioUnitParameterValue inValue,
142 UInt32 inBufferOffsetInFrames);
145 virtual OSStatus
Render(AudioUnitRenderActionFlags & ioActionFlags,
146 const AudioTimeStamp & inTimeStamp,
147 UInt32 inNumberFrames);
151 virtual ComponentResult
Reset(AudioUnitScope inScope,
152 AudioUnitElement inElement);
156 AudioUnitParameterID inParameterID,
157 CFArrayRef* outStrings);
161 virtual ComponentResult
RestoreState(CFPropertyListRef inData);
170 UInt32 inStartFrame);
176 UInt32 inStartFrame);
183 UInt32 inStartFrame);
190 UInt32 inStartFrame);
198 UInt32 inStartFrame);
209 if (bundleID != NULL)
211 CFBundleRef helixBundle = CFBundleGetBundleWithIdentifier( bundleID );
212 if(helixBundle != NULL)
214 CFURLRef bundleURL = CFBundleCopyBundleURL ( helixBundle );
215 if(bundleURL != NULL)
217 CFURLRef componentFolderPathURL = CFURLCreateCopyDeletingLastPathComponent(NULL, bundleURL);
219 CFStringRef myComponentPath = CFURLCopyFileSystemPath(componentFolderPathURL, kCFURLPOSIXPathStyle);
220 CFRelease(componentFolderPathURL);
222 if(myComponentPath != NULL)
224 int nSize = CFStringGetLength(myComponentPath);
225 char* path =
new char[nSize+1];
226 memset(path, 0, (nSize+1)*
sizeof(
char));
228 bool success = CFStringGetCString(myComponentPath, path, nSize+1, kCFStringEncodingASCII);
229 CFRelease(myComponentPath);
231 if(success)
return path;
234 CFRelease(bundleURL);
319 switch(hostMessageInfo.hostMessage)
436 for (customViewControllerMap::const_iterator it = customViewMap.begin(), end = customViewMap.end(); it != end; ++it)
494 MessageInfo info(PLUGINGUI_REGISTER_SUBCONTROLLER);
512 MessageInfo info(PLUGINGUI_DE_REGISTER_SUBCONTROLLER);
530 customViewControllerMap::const_iterator it = customViewMap.find(customViewName);
531 if (it != customViewMap.end())
539 customViewMap.insert(std::make_pair(customViewName, pCVC));
561 MessageInfo info(PLUGINGUI_DE_REGISTER_CUSTOMVIEW);
585 for (customViewControllerMap::const_iterator it = customViewMap.begin(), end = customViewMap.end(); it != end; ++it)
587 it->second->clearCustomViewPtr();
591 it->second->clearCustomViewPtr();
630 for (customViewControllerMap::const_iterator it = customViewMap.begin(), end = customViewMap.end(); it != end; ++it)
632 if (it->second->getCustomViewPtr() == customViewConnector)
646 if (it->second->getCustomViewPtr() == customViewConnector)
698 fprintf(stderr,
"midiEventQueueA.size() > 0: %u",
midiEventQueueA.size() > 0);
708 fprintf(stderr,
"midiEventQueueB.size() > 0: %u",
midiEventQueueB.size() > 0);
760 if(readingQueue->size() <= 0 || !
pluginCore)
return false;
762 while(readingQueue->size() > 0)
766 if(event.midiSampleOffset != sampleOffset)
return false;
virtual OSStatus NewFactoryPresetSet(const AUPreset &inNewFactoryPreset)
user has selected a new preset
Definition: ausynthplugin.cpp:972
AUMIDIEventQueue * midiEventQueue
double-buffered-queue for MIDI messaging
Definition: ausynthplugin.h:261
virtual double getActualPluginParameter(int32_t controlID)
Definition: ausynthplugin.h:450
AudioBufferList * sidechainBufferList
sidechain buffers (if active)
Definition: ausynthplugin.h:273
Information that includes the message code as well as the message data.
Definition: pluginstructures.h:705
CustomViewController * getCustomViewController(ICustomView *customViewConnector)
Definition: AAXPluginParameters.h:822
PluginParameter * getPluginParameterByControlID(int32_t controlID)
get a parameter by control ID - uses map (slowest)
Definition: pluginbase.h:129
virtual bool SupportsTail()
Definition: ausynthplugin.h:117
virtual ~AUMIDIEventQueue()
Definition: ausynthplugin.h:682
void updatePluginCoreParameters()
set the plugin core parameters from the AU parameters (called during each buffer process cycle) ...
Definition: ausynthplugin.cpp:385
virtual ComponentResult Version()
Definition: ausynthplugin.h:77
The PluginGUI object that maintains the entire GUI operation and has #defines to use with AAX...
Definition: plugingui.h:434
The AUMIDIEventQueue interface queues incoming MIDI messages and blasts them out during the buffer pr...
Definition: aufxplugin.h:676
virtual unsigned int getEventCount()
Definition: ausynthplugin.h:747
virtual OSStatus GetProperty(AudioUnitPropertyID inID, AudioUnitScope inScope, AudioUnitElement inElement, void *outData)
queries from host to get property information
Definition: ausynthplugin.cpp:758
~AUSynthPlugin()
destructor for plugin object
Definition: ausynthplugin.cpp:133
virtual bool guiWillClose()
Definition: ausynthplugin.h:581
The CustomViewController is part of the safe ICustomView feature in ASPiK. The CustomViewController m...
Definition: AAXPluginParameters.h:539
AUMIDIEventQueue(PluginCore *_pluginCore)
Definition: ausynthplugin.h:675
virtual OSStatus HandleNoteOn(UInt8 inChannel, UInt8 inNoteNumber, UInt8 inVelocity, UInt32 inStartFrame)
specialized MIDI handler for only this message; CURRENTLY NOT USED, see HandleMidiEvent ...
Definition: ausynthplugin.cpp:1023
double getAUParameter(unsigned int controlID)
safely get a parameter value
Definition: ausynthplugin.cpp:346
virtual void updateView()
Definition: ausynthplugin.h:370
virtual bool processMIDIEvent(midiEvent &event)
process a MIDI event
Definition: plugincore.cpp:606
virtual bool fireMidiEvents(unsigned int sampleOffset)
Definition: ausynthplugin.h:756
void toggleQueue()
Definition: ausynthplugin.h:715
virtual void pushDataValue(double data)
Definition: ausynthplugin.h:377
Float64 latencyInSeconds
au latency (seconds!)
Definition: ausynthplugin.h:286
std::queue< midiEvent > midiEventQueueA
queue A
Definition: aufxplugin.h:790
virtual bool deRregisterSubcontroller(ICustomView *customViewConnector)
Definition: ausynthplugin.h:505
void setAUParameterChangeEvent(unsigned int controlID, double actualValue)
safely issue a parameter change event
Definition: aufxplugin.cpp:327
interface file for ASPiK GUI object
uint32_t controlID
ID value.
Definition: pluginstructures.h:352
double getTailTimeInMSec()
Description query: tail time.
Definition: pluginbase.h:286
AUFXPlugin * auInstance
the AU plugin (NOTE this is not base-class)
Definition: aufxplugin.h:626
void clearCustomViewPtr()
Definition: ausynthplugin.h:397
virtual bool processMessage(MessageInfo &messageInfo)
For Custom View and Custom Sub-Controller Operations.
Definition: plugincore.cpp:546
virtual bool registerCustomView(std::string customViewName, ICustomView *customViewConnector)
Definition: ausynthplugin.h:525
virtual bool checkNonBoundValueChange(int tag, float normalizedValue)
Definition: ausynthplugin.h:607
CustomViewController(ICustomView *_customViewIF)
Definition: ausynthplugin.h:366
float ** sidechainInputBuffers
de-interleaved incoming audio sidechain buffers
Definition: ausynthplugin.h:278
std::queue< midiEvent > midiEventQueueB
queue B
Definition: aufxplugin.h:791
virtual UInt32 SupportedNumChannels(const AUChannelInfo **outInfo)
return an array of AUChannelInfo structures with input and output channel combinations ...
Definition: ausynthplugin.cpp:237
char * getMyComponentDirectory(CFStringRef bundleID)
helper function to get a path to the location where THIS library is loaded
Definition: ausynthplugin.h:207
virtual ComponentResult GetParameterInfo(AudioUnitScope inScope, AudioUnitParameterID inParameterID, AudioUnitParameterInfo &outParameterInfo)
get information about each AU parameter that was initialized
Definition: ausynthplugin.cpp:602
PluginCore * pluginCore
GUI the plugin core: alive for FULL lifecycle of shell.
Definition: ausynthplugin.h:265
AUFXPlugin * auInstance
our plugin object for setAUParameterChangeEvent()
Definition: aufxplugin.h:351
virtual ComponentResult GetParameterValueStrings(AudioUnitScope inScope, AudioUnitParameterID inParameterID, CFArrayRef *outStrings)
get parameter string-lists (for string-list params only)
Definition: ausynthplugin.cpp:665
virtual OSStatus Render(AudioUnitRenderActionFlags &ioActionFlags, const AudioTimeStamp &inTimeStamp, UInt32 inNumberFrames)
first function to be called during buffer process cycle
Definition: ausynthplugin.cpp:445
void addEvent(midiEvent event)
Definition: ausynthplugin.h:728
virtual ComponentResult SetParameter(AudioUnitParameterID inID, AudioUnitScope inScope, AudioUnitElement inElement, AudioUnitParameterValue inValue, UInt32 inBufferOffsetInFrames)
this just calls base class
Definition: ausynthplugin.cpp:579
bool hasSidechain
sidechain flag
Definition: ausynthplugin.h:272
int currentPreset
current preset's index value
Definition: ausynthplugin.h:282
Information about a GUI update message; this is for sending GUI control information from the plugin c...
Definition: pluginstructures.h:443
virtual bool deRegisterCustomView(ICustomView *customViewConnector)
Definition: ausynthplugin.h:553
Custom interface so that GUI can pass information to plugin shell in a thread-safe manner...
Definition: pluginstructures.h:1539
void * presetsArrayData
contiguous memory block for persistent preset data
Definition: ausynthplugin.h:281
virtual OSStatus HandleMidiEvent(UInt8 status, UInt8 channel, UInt8 data1, UInt8 data2, UInt32 inStartFrame)
specialized MIDI handler to add events to the plugin's queue
Definition: ausynthplugin.cpp:1115
virtual ComponentResult RestoreState(CFPropertyListRef inData)
called when a user preset is updated; may also be called during init; note the call sequence depends ...
Definition: ausynthplugin.cpp:309
PluginCore * pluginCore
the core object
Definition: AAXPluginParameters.h:812
Custom View interface to allow plugin core to create safe communication channels with GUI custom view...
Definition: pluginstructures.h:1461
void clearQueueAEvents()
Definition: aufxplugin.h:701
PluginCore * pluginCore
the core object to send MIDI messages to
Definition: aufxplugin.h:789
virtual void parameterChanged(int32_t controlID, double actualValue, double)
Definition: ausynthplugin.h:443
virtual OSStatus HandleNoteOff(UInt8 inChannel, UInt8 inNoteNumber, UInt8 inVelocity, UInt32 inStartFrame)
specialized MIDI handler for only this message; CURRENTLY NOT USED, see HandleMidiEvent ...
Definition: ausynthplugin.cpp:1043
void setAUParameterChangeEvent(unsigned int controlID, double actualValue)
safely issue a parameter change event
Definition: ausynthplugin.cpp:327
virtual OSStatus HandleControlChange(UInt8 inChannel, UInt8 inController, UInt8 inValue, UInt32 inStartFrame)
specialized MIDI handler for only this message; CURRENTLY NOT USED, see HandleMidiEvent ...
Definition: ausynthplugin.cpp:1093
Definition: pluginstructures.h:485
Double buffered queue for MIDI messages.
Definition: pluginstructures.h:1627
virtual bool guiParameterChanged(int32_t controlID, double actualValue)
has nothing to do with actual variable or updated variable (binding)
Definition: plugincore.cpp:517
The GUIPluginConnector interface creates a safe message mechanism for the GUI to issue requests to th...
Definition: AAXPluginParameters.h:599
int sidechainChannelCount
num sidechain channels
Definition: ausynthplugin.h:274
std::map< std::string, CustomViewController * > customViewControllerMap
map of custom view controllers
Definition: ausynthplugin.h:624
void clearEvents()
Definition: aufxplugin.h:694
virtual double getNormalizedPluginParameter(int32_t controlID)
Definition: ausynthplugin.h:462
virtual ComponentResult GetPresets(CFArrayRef *outData) const
return a static array of preset information structures
Definition: ausynthplugin.cpp:919
void * inMessageData
incoming message data (interpretation depends on message)
Definition: pluginstructures.h:733
std::vector< GUIParameter > guiParameters
list of updates
Definition: pluginstructures.h:461
AUSynthPlugin(AudioUnit component)
constructor for plugin object
Definition: ausynthplugin.cpp:51
std::atomic< bool > writingQueueA
atomic flag for toggling buffers
Definition: aufxplugin.h:792
virtual bool registerSubcontroller(std::string subcontrollerName, ICustomView *customViewConnector)
Definition: ausynthplugin.h:477
virtual ComponentResult Reset(AudioUnitScope inScope, AudioUnitElement inElement)
reset function for AU and core
Definition: ausynthplugin.cpp:201
PluginHostConnector * pluginHostConnector
Plugin -> Host interface.
Definition: ausynthplugin.h:260
GUIPluginConnector * guiPluginConnector
GUI -> Plugin interface.
Definition: ausynthplugin.h:259
void setCustomViewPtr(ICustomView *_customViewIF)
Definition: ausynthplugin.h:391
The AUSynthPlugin is the ASPiK plugin shell for Audio Units synth plugins. It contains the plugin ker...
Definition: ausynthplugin.h:70
CustomViewController * getCustomSubController(ICustomView *customViewConnector)
Definition: AAXPluginParameters.h:835
GUIPluginConnector(AUSynthPlugin *_auInstance, PluginCore *_pluginCore)
Definition: ausynthplugin.h:427
virtual OSStatus SetProperty(AudioUnitPropertyID inID, AudioUnitScope inScope, AudioUnitElement inElement, const void *inData, UInt32 inDataSize)
open and close the GUI object
Definition: ausynthplugin.cpp:808
virtual ComponentResult Initialize()
the AU init function
Definition: ausynthplugin.cpp:275
virtual bool guiDidOpen()
Definition: ausynthplugin.h:573
The PluginCore object is the default PluginBase derived object for ASPiK projects. Note that you are fre to change the name of this object (as long as you change it in the compiler settings, etc...)
Definition: plugincore.h:43
virtual ~GUIPluginConnector()
Definition: ausynthplugin.h:430
virtual void sendMessage(void *data)
Definition: pluginstructures.h:1482
virtual OSStatus GetPropertyInfo(AudioUnitPropertyID inID, AudioUnitScope nScope, AudioUnitElement inElement, UInt32 &outDataSize, Boolean &outWritable)
queries from host about plugin properties
Definition: ausynthplugin.cpp:707
The PluginParameter object stores all of the data needed for any type of plugin parameter. It is a large object, but it is not complex as it really just stores LOTS of information about plugin parameters.
Definition: pluginparameter.h:51
virtual OSStatus HandlePitchWheel(UInt8 inChannel, UInt8 inPitch1, UInt8 inPitch2, UInt32 inStartFrame)
specialized MIDI handler for only this message; CURRENTLY NOT USED, see HandleMidiEvent ...
Definition: ausynthplugin.cpp:1063
Information that defines a single GUI parameter's possible values and ID.
Definition: pluginstructures.h:331
void clearQueueBEvents()
Definition: aufxplugin.h:711
base class interface file for ASPiK plugincore object
double actualValue
actual value
Definition: pluginstructures.h:353
Information from the host that is updated on each buffer process cycle; includes BPM, time signature, SMPTE and other data. The values in the stock structure are consistent across most APIs, however others may be added (commnted out here)
Definition: pluginstructures.h:973
guiMessage
Use this enum to send custom messages from the GUI to the AU plugin. This is the VSTGUI-approved mech...
Definition: aufxplugin.h:44
double getNormalizedControlValueWithActualValue(double actualValue)
get the new normalized control value as if it were set with an actual value
Definition: pluginparameter.h:346
virtual void updateView()=0
double getAUParameter(unsigned int controlID)
safely get a parameter value
Definition: aufxplugin.cpp:346
void updateHostInfo(HostInfo *hostInfo)
set the HostInfo for the core (varies by API)
Definition: ausynthplugin.cpp:518
std::string inMessageString
incoming message data as a std::string (interpretation depends on message)
Definition: pluginstructures.h:736
Custom interface to send the plugin shell a message from plugin core.
Definition: pluginstructures.h:1609
The PluginHostConnector implements the IPluginHostConnector interface for the plugin shell object...
Definition: AAXPluginParameters.h:479
virtual Float64 GetLatency()
Definition: ausynthplugin.h:134
float ** inputBuffers
de-interleaved incoming audio input buffers
Definition: ausynthplugin.h:276
virtual void sendHostMessage(const HostMessageInfo &hostMessageInfo)
process a message; by default it processes sendGUIUpdate to safely send a parameter change event but ...
Definition: ausynthplugin.h:317
const ICustomView * getCustomViewPtr()
Definition: ausynthplugin.h:394
customViewControllerMap customSubControllerMap
map of custom sub-controllers
Definition: AAXPluginParameters.h:833
void updateAUParametersWithPluginCore()
send parameter update info (metering, output)
Definition: ausynthplugin.cpp:417
virtual void pushDataValue(double data)
Definition: pluginstructures.h:1472
float ** outputBuffers
de-interleaved outgoing audio output buffers
Definition: ausynthplugin.h:277
virtual void sendMessage(void *data)
Definition: ausynthplugin.h:384
AUChannelInfo * auChannelInfo
the current channel information
Definition: ausynthplugin.h:275
virtual bool guiTimerPing()
Definition: ausynthplugin.h:599
Information about a MIDI event.
Definition: pluginstructures.h:561
void initAUParametersWithPluginCore()
setup the AU parameter list with the plugin core's parameter list
Definition: ausynthplugin.cpp:359