ASPiK SDK
ausynthplugin.h
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------
2 // ASPiK AU Shell File: ausynthplugin.h
3 //
17 // -----------------------------------------------------------------------------
18 #include <AudioToolbox/AudioUnitUtilities.h>
19 #include "AUInstrumentBase.h" // for Synths
20 #include "plugingui.h"
21 #include "plugincore.h"
22 #include <math.h>
23 #include <queue>
24 #include <string>
25 
40 // custom properties id's must be 64000 or greater
41 // see <AudioUnit/AudioUnitProperties.h> for a list of Apple-defined standard properties
42 //
43 // --- These are for VSTGUI4 messaging - WP
44 enum guiMessage
45 {
46  kOpenGUI = 64000,
47  kCloseGUI
48 };
49 
50 class GUIPluginConnector;
52 class AUMIDIEventQueue;
53 
70 class AUSynthPlugin : public AUInstrumentBase
71 {
72 public:
73  AUSynthPlugin(AudioUnit component);
75 
77  virtual ComponentResult Version() {return 1000;}
78 
80  virtual ComponentResult Initialize();
81 
83  virtual OSStatus GetPropertyInfo(AudioUnitPropertyID inID,
84  AudioUnitScope nScope,
85  AudioUnitElement inElement,
86  UInt32& outDataSize,
87  Boolean& outWritable );
88 
90  virtual OSStatus GetProperty(AudioUnitPropertyID inID,
91  AudioUnitScope inScope,
92  AudioUnitElement inElement,
93  void* outData );
94 
96  virtual OSStatus SetProperty(AudioUnitPropertyID inID,
97  AudioUnitScope inScope,
98  AudioUnitElement inElement,
99  const void* inData,
100  UInt32 inDataSize);
101 
103  virtual ComponentResult GetParameterInfo(AudioUnitScope inScope,
104  AudioUnitParameterID inParameterID,
105  AudioUnitParameterInfo &outParameterInfo );
106 
108  virtual ComponentResult GetPresets(CFArrayRef* outData) const;
109 
111  virtual OSStatus NewFactoryPresetSet (const AUPreset& inNewFactoryPreset);
112 
117  virtual bool SupportsTail()
118  {
119  if(pluginCore)
120  return pluginCore->getTailTimeInMSec() > 0 ? true : false;
121 
122  return false;
123  }
124 
125  virtual Float64 GetTailTime()
126  {
127  if(pluginCore)
128  return pluginCore->getTailTimeInMSec() / 1000.0;
129 
130  return 0.0;
131  }
132 
134  virtual Float64 GetLatency() {return latencyInSeconds;}
135 
136 
138  virtual ComponentResult SetParameter(AudioUnitParameterID inID,
139  AudioUnitScope inScope,
140  AudioUnitElement inElement,
141  AudioUnitParameterValue inValue,
142  UInt32 inBufferOffsetInFrames);
143 
145  virtual OSStatus Render(AudioUnitRenderActionFlags & ioActionFlags,
146  const AudioTimeStamp & inTimeStamp,
147  UInt32 inNumberFrames);
148 
149 
151  virtual ComponentResult Reset(AudioUnitScope inScope,
152  AudioUnitElement inElement);
153 
155  virtual ComponentResult GetParameterValueStrings(AudioUnitScope inScope,
156  AudioUnitParameterID inParameterID,
157  CFArrayRef* outStrings);
158 
159  // --- need this for when user selects a NON factory-preset (ie they created the preset in the Client)
161  virtual ComponentResult RestoreState(CFPropertyListRef inData);
163  virtual UInt32 SupportedNumChannels(const AUChannelInfo** outInfo);
164 
165  // --- MIDI Functions
167  virtual OSStatus HandleNoteOn(UInt8 inChannel,
168  UInt8 inNoteNumber,
169  UInt8 inVelocity,
170  UInt32 inStartFrame);
171 
173  virtual OSStatus HandleNoteOff(UInt8 inChannel,
174  UInt8 inNoteNumber,
175  UInt8 inVelocity,
176  UInt32 inStartFrame);
177 
178  // --- MIDI Pitchbend (slightly different from all other CCs)
180  virtual OSStatus HandlePitchWheel(UInt8 inChannel,
181  UInt8 inPitch1,
182  UInt8 inPitch2,
183  UInt32 inStartFrame);
184 
185  // --- all other MIDI CC messages
187  virtual OSStatus HandleControlChange(UInt8 inChannel,
188  UInt8 inController,
189  UInt8 inValue,
190  UInt32 inStartFrame);
191 
192  // --- for ALL other MIDI messages you can get them here
194  virtual OSStatus HandleMidiEvent(UInt8 status,
195  UInt8 channel,
196  UInt8 data1,
197  UInt8 data2,
198  UInt32 inStartFrame);
199 
207  char* getMyComponentDirectory(CFStringRef bundleID)
208  {
209  if (bundleID != NULL)
210  {
211  CFBundleRef helixBundle = CFBundleGetBundleWithIdentifier( bundleID );
212  if(helixBundle != NULL)
213  {
214  CFURLRef bundleURL = CFBundleCopyBundleURL ( helixBundle );
215  if(bundleURL != NULL)
216  {
217  CFURLRef componentFolderPathURL = CFURLCreateCopyDeletingLastPathComponent(NULL, bundleURL);
218 
219  CFStringRef myComponentPath = CFURLCopyFileSystemPath(componentFolderPathURL, kCFURLPOSIXPathStyle);
220  CFRelease(componentFolderPathURL);
221 
222  if(myComponentPath != NULL)
223  {
224  int nSize = CFStringGetLength(myComponentPath);
225  char* path = new char[nSize+1];
226  memset(path, 0, (nSize+1)*sizeof(char));
227 
228  bool success = CFStringGetCString(myComponentPath, path, nSize+1, kCFStringEncodingASCII);
229  CFRelease(myComponentPath);
230 
231  if(success) return path;
232  else return NULL;
233  }
234  CFRelease(bundleURL);
235  }
236  }
237  CFRelease(bundleID);
238  }
239  return NULL;
240  }
241 
248  void setAUParameterChangeEvent(unsigned int controlID, double actualValue);
249 
257  double getAUParameter(unsigned int controlID);
258 
262 
263 protected:
264  // --- Plugin Core
265  PluginCore* pluginCore = nullptr;
269  void updateHostInfo(HostInfo* hostInfo);
270 
271  // --- sidechaining
272  bool hasSidechain = false;
273  AudioBufferList* sidechainBufferList = nullptr;
275  AUChannelInfo* auChannelInfo = nullptr;
276  float** inputBuffers = nullptr;
277  float** outputBuffers = nullptr;
278  float** sidechainInputBuffers = nullptr;
279 
280  // --- raw bytes for "static" preset data
281  void* presetsArrayData = nullptr;
282  int currentPreset = 0;
283 
284  // --- NOTE: AU takes latency in seconds, not samples; this is recalculated
285  // during init() and reset() operations
286  Float64 latencyInSeconds = 0 ;
287 
288 
290  // It should NEVER be used to try to communicate
291  // directly with the GUI - not thread safe
292  VSTGUI::PluginGUI* pluginGUI = nullptr;
293 };
294 
307 {
308 public:
309  PluginHostConnector(AUSynthPlugin* _auInstance){auInstance = _auInstance;}
310  virtual ~PluginHostConnector(){}
311 
317  virtual void sendHostMessage(const HostMessageInfo& hostMessageInfo)
318  {
319  switch(hostMessageInfo.hostMessage)
320  {
321  case sendGUIUpdate:
322  {
323  GUIUpdateData guiUpdateData = hostMessageInfo.guiUpdateData;
324 
325  for(int i = 0; i < guiUpdateData.guiParameters.size(); i++)
326  {
327  GUIParameter guiParam = guiUpdateData.guiParameters[i];
328 
329  // --- threadsafe atomic write to global param & GUI update dispatch
331  }
332 
333  // --- clean up
334  for(int i = 0; i < guiUpdateData.guiParameters.size(); i++)
335  guiUpdateData.guiParameters.pop_back();
336 
337  break;
338  }
339  default:
340  break;
341  }
342  }
343 
344 protected:
346 };
347 
348 // --- GUI -> Plugin interface
360 //
361 // --- container for a custom view pointer
362 class CustomViewController : public ICustomView
363 {
364 public:
366  CustomViewController(ICustomView* _customViewIF) { customViewIF = _customViewIF; }
367  virtual ~CustomViewController() {}
368 
370  virtual void updateView()
371  {
372  if (customViewIF)
373  customViewIF->updateView();
374  }
375 
377  virtual void pushDataValue(double data)
378  {
379  if (customViewIF)
380  customViewIF->pushDataValue(data);
381  }
382 
384  virtual void sendMessage(void* data)
385  {
386  if (customViewIF)
387  customViewIF->sendMessage(data);
388  }
389 
391  void setCustomViewPtr(ICustomView* _customViewIF) { customViewIF = _customViewIF; }
392 
394  const ICustomView* getCustomViewPtr() { return customViewIF; }
395 
397  void clearCustomViewPtr() { customViewIF = nullptr; }
398 
399 
400 private:
401  ICustomView* customViewIF = nullptr;
402 };
403 
404 // --- GUI -> Plugin interface
424 {
425 public:
427  GUIPluginConnector(AUSynthPlugin* _auInstance, PluginCore* _pluginCore){auInstance = _auInstance; pluginCore = _pluginCore;}
428 
431  {
432  for (customViewControllerMap::const_iterator it = customSubControllerMap.begin(), end = customSubControllerMap.end(); it != end; ++it)
433  {
434  delete it->second;
435  }
436  for (customViewControllerMap::const_iterator it = customViewMap.begin(), end = customViewMap.end(); it != end; ++it)
437  {
438  delete it->second;
439  }
440  }
441 
443  virtual void parameterChanged(int32_t controlID, double actualValue, double /*normalizedValue*/)
444  {
445  if(pluginCore)
446  pluginCore->guiParameterChanged(controlID, actualValue);
447  }
448 
450  virtual double getActualPluginParameter(int32_t controlID)
451  {
453  if(piParam)
454  {
455  return auInstance->getAUParameter(controlID);
456  }
457  else
458  return 0.0;
459  }
460 
462  virtual double getNormalizedPluginParameter(int32_t controlID)
463  {
464  if(pluginCore && auInstance)
465  {
467  if(piParam)
468  {
469  double actualValue = getActualPluginParameter(controlID);
470  return piParam->getNormalizedControlValueWithActualValue(actualValue);
471  }
472  }
473  return 0.0;
474  }
475 
477  virtual bool registerSubcontroller(std::string subcontrollerName, ICustomView* customViewConnector)
478  {
479  // --- do we have this in our map already?
480  CustomViewController* pCVC = nullptr;
481 
482  customViewControllerMap::const_iterator it = customSubControllerMap.find(subcontrollerName);
483  if (it != customSubControllerMap.end())
484  {
485  pCVC = it->second;
486  pCVC->setCustomViewPtr(customViewConnector);
487  }
488  else
489  {
490  pCVC = new CustomViewController(customViewConnector);
491  customSubControllerMap.insert(std::make_pair(subcontrollerName, pCVC));
492  }
493 
494  MessageInfo info(PLUGINGUI_REGISTER_SUBCONTROLLER);
495  info.inMessageString = subcontrollerName;
496  info.inMessageData = pCVC;
497 
498  if (pluginCore && pluginCore->processMessage(info))
499  return true;
500 
501  return false;
502  }
503 
505  virtual bool deRregisterSubcontroller(ICustomView* customViewConnector)
506  {
507  CustomViewController* pCVC = getCustomSubController(customViewConnector);
508  if (pCVC)
509  {
510  pCVC->clearCustomViewPtr();
511 
512  MessageInfo info(PLUGINGUI_DE_REGISTER_SUBCONTROLLER);
513  info.inMessageString = "";
514  info.inMessageData = pCVC;
515 
516  if (pluginCore && pluginCore->processMessage(info))
517  return true;
518  }
519 
520  return false;
521  }
522 
523 
525  virtual bool registerCustomView(std::string customViewName, ICustomView* customViewConnector)
526  {
527  // --- do we have this in our map already?
528  CustomViewController* pCVC = nullptr;
529 
530  customViewControllerMap::const_iterator it = customViewMap.find(customViewName);
531  if (it != customViewMap.end())
532  {
533  pCVC = it->second;
534  pCVC->setCustomViewPtr(customViewConnector);
535  }
536  else
537  {
538  pCVC = new CustomViewController(customViewConnector);
539  customViewMap.insert(std::make_pair(customViewName, pCVC));
540  }
541 
542  MessageInfo info(PLUGINGUI_REGISTER_CUSTOMVIEW);
543  info.inMessageString = customViewName;
544  info.inMessageData = pCVC;
545 
546  if(pluginCore && pluginCore->processMessage(info))
547  return true;
548 
549  return false;
550  }
551 
553  virtual bool deRegisterCustomView(ICustomView* customViewConnector)
554  {
555  CustomViewController* pCVC = getCustomViewController(customViewConnector);
556  if (pCVC)
557  {
558  // --- clear it
559  pCVC->clearCustomViewPtr();
560 
561  MessageInfo info(PLUGINGUI_DE_REGISTER_CUSTOMVIEW);
562  info.inMessageString = "";
563  info.inMessageData = pCVC;
564 
565  if (pluginCore && pluginCore->processMessage(info))
566  return true;
567  }
568 
569  return false;
570  }
571 
573  virtual bool guiDidOpen()
574  {
575  if(!pluginCore) return false;
576  MessageInfo info(PLUGINGUI_DIDOPEN);
577  return pluginCore->processMessage(info);
578  }
579 
581  virtual bool guiWillClose()
582  {
583  if(!pluginCore) return false;
584 
585  for (customViewControllerMap::const_iterator it = customViewMap.begin(), end = customViewMap.end(); it != end; ++it)
586  {
587  it->second->clearCustomViewPtr();
588  }
589  for (customViewControllerMap::const_iterator it = customSubControllerMap.begin(), end = customSubControllerMap.end(); it != end; ++it)
590  {
591  it->second->clearCustomViewPtr();
592  }
593 
594  MessageInfo info(PLUGINGUI_WILLCLOSE);
595  return pluginCore->processMessage(info);
596  }
597 
599  virtual bool guiTimerPing()
600  {
601  if(!pluginCore) return false;
602  MessageInfo info(PLUGINGUI_TIMERPING);
603  return pluginCore->processMessage(info);
604  }
605 
607  virtual bool checkNonBoundValueChange(int tag, float normalizedValue)
608  {
609  if(!pluginCore) return false;
610 
611  // --- do any additional stuff here
612  // --- dispatch non-bound value changes directly to receiver
613 
614  return false;
615  }
616 
617 
618 protected:
619  PluginCore* pluginCore = nullptr;
621 
622  // --- this is for supporting the persistent interface pointer for the core object
623  // and is required by ASPiK Specifications
624  typedef std::map<std::string, CustomViewController*> customViewControllerMap;
625  customViewControllerMap customViewMap;
626 
629  {
630  for (customViewControllerMap::const_iterator it = customViewMap.begin(), end = customViewMap.end(); it != end; ++it)
631  {
632  if (it->second->getCustomViewPtr() == customViewConnector)
633  return it->second;
634  }
635 
636  return nullptr;
637  }
638 
640 
643  {
644  for (customViewControllerMap::const_iterator it = customSubControllerMap.begin(), end = customSubControllerMap.end(); it != end; ++it)
645  {
646  if (it->second->getCustomViewPtr() == customViewConnector)
647  return it->second;
648  }
649 
650  return nullptr;
651  }
652 };
653 
654 // --- GUI -> Plugin interface
670 class AUMIDIEventQueue : public IMidiEventQueue
671 {
672 public:
673 
676  {
677  pluginCore = _pluginCore;
678  writingQueueA.store(true);
679  };
680 
683  {
684  clearEvents();
685  }
686 
688  void clearEvents()
689  {
692  }
693 
696  {
697  if(midiEventQueueA.size() > 0)
698  fprintf(stderr, "midiEventQueueA.size() > 0: %u", midiEventQueueA.size() > 0);
699 
700  while(midiEventQueueA.size() > 0)
701  midiEventQueueA.pop();
702  }
703 
706  {
707  if(midiEventQueueB.size() > 0)
708  fprintf(stderr, "midiEventQueueB.size() > 0: %u", midiEventQueueB.size() > 0);
709 
710  while(midiEventQueueB.size() > 0)
711  midiEventQueueB.pop();
712  }
713 
715  void toggleQueue()
716  {
717  // --- toggle the atomic bool
719 
720  // --- clear out write-queue (should never be non-empty)
721  if(writingQueueA)
723  else
725  }
726 
728  inline void addEvent(midiEvent event)
729  {
730  if(writingQueueA)
731  {
732  midiEventQueueA.push(event);
733  // fprintf(stderr, "QA addEvent: %u", event.midiData1);
734  // fprintf(stderr, " with offset: %u\n", event.midiSampleOffset);
735 
736  }
737  else
738  {
739  midiEventQueueB.push(event);
740  //fprintf(stderr, "QB addEvent: %u", event.midiData1);
741  // fprintf(stderr, " with offset: %u\n", event.midiSampleOffset);
742 
743  }
744  }
745 
747  virtual unsigned int getEventCount()
748  {
749  if(writingQueueA)
750  return midiEventQueueB.size();
751  else
752  return midiEventQueueA.size();
753  }
754 
756  virtual bool fireMidiEvents(unsigned int sampleOffset)
757  {
758  std::queue<midiEvent>* readingQueue = writingQueueA ? &midiEventQueueB : &midiEventQueueA;
759 
760  if(readingQueue->size() <= 0 || !pluginCore) return false;
761 
762  while(readingQueue->size() > 0)
763  {
764  // --- check the current top
765  midiEvent event = readingQueue->front();
766  if(event.midiSampleOffset != sampleOffset) return false;
767 
768  // fprintf(stderr, "fired MIDI Event: %u", event.midiData1);
769  // fprintf(stderr, " with offset: %u\n", event.midiSampleOffset);
770 
771  // --- send to core for processing
772  if(pluginCore)
774 
775  // --- pop to remove
776  readingQueue->pop();
777  }
778  return true;
779  }
780 
781 
782 protected:
783  PluginCore* pluginCore = nullptr;
784  std::queue<midiEvent> midiEventQueueA;
785  std::queue<midiEvent> midiEventQueueB;
786  std::atomic<bool> writingQueueA;
787 };
virtual OSStatus NewFactoryPresetSet(const AUPreset &inNewFactoryPreset)
user has selected a new preset
Definition: ausynthplugin.cpp:943
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:808
PluginParameter * getPluginParameterByControlID(int32_t controlID)
get a parameter by control ID - uses map (slowest)
Definition: pluginbase.h:299
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:357
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:410
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:730
~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:527
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:994
double getAUParameter(unsigned int controlID)
safely get a parameter value
Definition: ausynthplugin.cpp:318
virtual void updateView()
Definition: ausynthplugin.h:370
virtual bool processMIDIEvent(midiEvent &event)
process a MIDI event
Definition: plugincore.cpp:415
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:299
interface file for ASPiK GUI object
uint32_t controlID
ID value.
Definition: pluginstructures.h:352
double getTailTimeInMSec()
Description query: tail time.
Definition: pluginbase.h:456
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:355
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:209
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:574
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:637
virtual OSStatus Render(AudioUnitRenderActionFlags &ioActionFlags, const AudioTimeStamp &inTimeStamp, UInt32 inNumberFrames)
first function to be called during buffer process cycle
Definition: ausynthplugin.cpp:417
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:551
bool hasSidechain
sidechain flag
Definition: ausynthplugin.h:272
int currentPreset
current preset&#39;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:1473
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&#39;s queue
Definition: ausynthplugin.cpp:1086
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:281
PluginCore * pluginCore
the core object
Definition: AAXPluginParameters.h:799
Custom View interface to allow plugin core to create safe communication channels with GUI custom view...
Definition: pluginstructures.h:1395
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:1014
void setAUParameterChangeEvent(unsigned int controlID, double actualValue)
safely issue a parameter change event
Definition: ausynthplugin.cpp:299
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:1064
Definition: pluginstructures.h:485
Double buffered queue for MIDI messages.
Definition: pluginstructures.h:1561
virtual bool guiParameterChanged(int32_t controlID, double actualValue)
has nothing to do with actual variable or updated variable (binding)
Definition: plugincore.cpp:326
The GUIPluginConnector interface creates a safe message mechanism for the GUI to issue requests to th...
Definition: AAXPluginParameters.h:587
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:890
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:173
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:821
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:780
virtual ComponentResult Initialize()
the AU init function
Definition: ausynthplugin.cpp:247
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:1416
virtual OSStatus GetPropertyInfo(AudioUnitPropertyID inID, AudioUnitScope nScope, AudioUnitElement inElement, UInt32 &outDataSize, Boolean &outWritable)
queries from host about plugin properties
Definition: ausynthplugin.cpp:679
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:1034
Information that defines a single GUI parameter&#39;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:342
virtual void updateView()=0
double getAUParameter(unsigned int controlID)
safely get a parameter value
Definition: aufxplugin.cpp:318
void updateHostInfo(HostInfo *hostInfo)
set the HostInfo for the core (varies by API)
Definition: ausynthplugin.cpp:490
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:1543
The PluginHostConnector implements the IPluginHostConnector interface for the plugin shell object...
Definition: AAXPluginParameters.h:467
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:819
void updateAUParametersWithPluginCore()
send parameter update info (metering, output)
Definition: ausynthplugin.cpp:389
virtual void pushDataValue(double data)
Definition: pluginstructures.h:1406
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&#39;s parameter list
Definition: ausynthplugin.cpp:331