ASPiK SDK
aufxplugin.h
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------
2 // ASPiK AU Shell File: aufxplugin.h
3 //
17 // -----------------------------------------------------------------------------
18 #include <AudioToolbox/AudioUnitUtilities.h>
19 #include "AUMIDIEffectBase.h" // For FX + MIDI
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
45 {
46  kOpenGUI = 64000,
47  kCloseGUI
48 };
49 
50 class GUIPluginConnector;
52 class AUMIDIEventQueue;
53 
70 class AUFXPlugin : public AUMIDIEffectBase
71 {
72 public:
73  AUFXPlugin(AudioUnit component);
74  ~AUFXPlugin();
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 OSStatus ProcessBufferLists(AudioUnitRenderActionFlags& ioActionFlags,
152  const AudioBufferList& inBuffer,
153  AudioBufferList& outBuffer,
154  UInt32 inFramesToProcess );
155 
157  virtual ComponentResult Reset(AudioUnitScope inScope,
158  AudioUnitElement inElement);
159 
161  virtual ComponentResult GetParameterValueStrings(AudioUnitScope inScope,
162  AudioUnitParameterID inParameterID,
163  CFArrayRef* outStrings);
164 
165  // --- need this for when user selects a NON factory-preset (ie they created the preset in the Client)
167  virtual ComponentResult RestoreState(CFPropertyListRef inData);
169  virtual UInt32 SupportedNumChannels(const AUChannelInfo** outInfo);
170 
171  // --- MIDI Functions
173  virtual OSStatus HandleNoteOn(UInt8 inChannel,
174  UInt8 inNoteNumber,
175  UInt8 inVelocity,
176  UInt32 inStartFrame);
177 
179  virtual OSStatus HandleNoteOff(UInt8 inChannel,
180  UInt8 inNoteNumber,
181  UInt8 inVelocity,
182  UInt32 inStartFrame);
183 
184  // --- MIDI Pitchbend (slightly different from all other CCs)
186  virtual OSStatus HandlePitchWheel(UInt8 inChannel,
187  UInt8 inPitch1,
188  UInt8 inPitch2,
189  UInt32 inStartFrame);
190 
191  // --- all other MIDI CC messages
193  virtual OSStatus HandleControlChange(UInt8 inChannel,
194  UInt8 inController,
195  UInt8 inValue,
196  UInt32 inStartFrame);
197 
198  // --- for ALL other MIDI messages you can get them here
200  virtual OSStatus HandleMidiEvent(UInt8 status,
201  UInt8 channel,
202  UInt8 data1,
203  UInt8 data2,
204  UInt32 inStartFrame);
205 
213  char* getMyComponentDirectory(CFStringRef bundleID)
214  {
215  if (bundleID != NULL)
216  {
217  CFBundleRef helixBundle = CFBundleGetBundleWithIdentifier( bundleID );
218  if(helixBundle != NULL)
219  {
220  CFURLRef bundleURL = CFBundleCopyBundleURL ( helixBundle );
221  if(bundleURL != NULL)
222  {
223  CFURLRef componentFolderPathURL = CFURLCreateCopyDeletingLastPathComponent(NULL, bundleURL);
224 
225  CFStringRef myComponentPath = CFURLCopyFileSystemPath(componentFolderPathURL, kCFURLPOSIXPathStyle);
226  CFRelease(componentFolderPathURL);
227 
228  if(myComponentPath != NULL)
229  {
230  int nSize = CFStringGetLength(myComponentPath);
231  char* path = new char[nSize+1];
232  memset(path, 0, (nSize+1)*sizeof(char));
233 
234  bool success = CFStringGetCString(myComponentPath, path, nSize+1, kCFStringEncodingASCII);
235  CFRelease(myComponentPath);
236 
237  if(success) return path;
238  else return NULL;
239  }
240  CFRelease(bundleURL);
241  }
242  }
243  CFRelease(bundleID);
244  }
245  return NULL;
246  }
247 
254  void setAUParameterChangeEvent(unsigned int controlID, double actualValue);
255 
263  double getAUParameter(unsigned int controlID);
264 
268 
269 protected:
270  // --- Plugin Core
271  PluginCore* pluginCore = nullptr;
275  void updateHostInfo(HostInfo* hostInfo);
276 
277  // --- sidechaining
278  bool hasSidechain = false;
279  AudioBufferList* sidechainBufferList = nullptr;
281  AUChannelInfo* auChannelInfo = nullptr;
282  float** inputBuffers = nullptr;
283  float** outputBuffers = nullptr;
284  float** sidechainInputBuffers = nullptr;
285 
286  // --- raw bytes for "static" preset data
287  void* presetsArrayData = nullptr;
288  int currentPreset = 0;
289 
290  // --- NOTE: AU takes latency in seconds, not samples; this is recalculated
291  // during init() and reset() operations
292  Float64 latencyInSeconds = 0 ;
293 
294 
296  // It should NEVER be used to try to communicate
297  // directly with the GUI - not thread safe
298  PluginGUI* pluginGUI = nullptr;
299 };
300 
313 {
314 public:
315  PluginHostConnector(AUFXPlugin* _auInstance){auInstance = _auInstance;}
316  virtual ~PluginHostConnector(){}
317 
323  virtual void sendHostMessage(const HostMessageInfo& hostMessageInfo)
324  {
325  switch(hostMessageInfo.hostMessage)
326  {
327  case sendGUIUpdate:
328  {
329  GUIUpdateData guiUpdateData = hostMessageInfo.guiUpdateData;
330 
331  for(int i = 0; i < guiUpdateData.guiParameters.size(); i++)
332  {
333  GUIParameter guiParam = guiUpdateData.guiParameters[i];
334 
335  // --- threadsafe atomic write to global param & GUI update dispatch
337  }
338 
339  // --- clean up
340  for(int i = 0; i < guiUpdateData.guiParameters.size(); i++)
341  guiUpdateData.guiParameters.pop_back();
342 
343  break;
344  }
345  default:
346  break;
347  }
348  }
349 
350 protected:
351  AUFXPlugin* auInstance = nullptr;
352 };
353 
354 // --- GUI -> Plugin interface
366 //
367 // --- container for a custom view pointer
368 class CustomViewController : public ICustomView
369 {
370 public:
372  CustomViewController(ICustomView* _customViewIF) { customViewIF = _customViewIF; }
373  virtual ~CustomViewController() {}
374 
376  virtual void updateView()
377  {
378  if (customViewIF)
379  customViewIF->updateView();
380  }
381 
383  virtual void pushDataValue(double data)
384  {
385  if (customViewIF)
386  customViewIF->pushDataValue(data);
387  }
388 
390  virtual void sendMessage(void* data)
391  {
392  if (customViewIF)
393  customViewIF->sendMessage(data);
394  }
395 
397  void setCustomViewPtr(ICustomView* _customViewIF) { customViewIF = _customViewIF; }
398 
400  const ICustomView* getCustomViewPtr() { return customViewIF; }
401 
403  void clearCustomViewPtr() { customViewIF = nullptr; }
404 
405 
406 private:
407  ICustomView* customViewIF = nullptr;
408 };
409 
410 // --- GUI -> Plugin interface
430 {
431 public:
433  GUIPluginConnector(AUFXPlugin* _auInstance, PluginCore* _pluginCore){auInstance = _auInstance; pluginCore = _pluginCore;}
434 
437  {
438  for (customViewControllerMap::const_iterator it = customSubControllerMap.begin(), end = customSubControllerMap.end(); it != end; ++it)
439  {
440  delete it->second;
441  }
442  for (customViewControllerMap::const_iterator it = customViewMap.begin(), end = customViewMap.end(); it != end; ++it)
443  {
444  delete it->second;
445  }
446  }
447 
449  virtual void parameterChanged(int32_t controlID, double actualValue, double /*normalizedValue*/)
450  {
451  if(pluginCore)
452  pluginCore->guiParameterChanged(controlID, actualValue);
453  }
454 
456  virtual double getActualPluginParameter(int32_t controlID)
457  {
459  if(piParam)
460  {
461  return auInstance->getAUParameter(controlID);
462  }
463  else
464  return 0.0;
465  }
466 
468  virtual double getNormalizedPluginParameter(int32_t controlID)
469  {
470  if(pluginCore && auInstance)
471  {
473  if(piParam)
474  {
475  double actualValue = getActualPluginParameter(controlID);
476  return piParam->getNormalizedControlValueWithActualValue(actualValue);
477  }
478  }
479  return 0.0;
480  }
481 
483  virtual bool registerSubcontroller(std::string subcontrollerName, ICustomView* customViewConnector)
484  {
485  // --- do we have this in our map already?
486  CustomViewController* pCVC = nullptr;
487 
488  customViewControllerMap::const_iterator it = customSubControllerMap.find(subcontrollerName);
489  if (it != customSubControllerMap.end())
490  {
491  pCVC = it->second;
492  pCVC->setCustomViewPtr(customViewConnector);
493  }
494  else
495  {
496  pCVC = new CustomViewController(customViewConnector);
497  customSubControllerMap.insert(std::make_pair(subcontrollerName, pCVC));
498  }
499 
500  MessageInfo info(PLUGINGUI_REGISTER_SUBCONTROLLER);
501  info.inMessageString = subcontrollerName;
502  info.inMessageData = pCVC;
503 
504  if (pluginCore && pluginCore->processMessage(info))
505  return true;
506 
507  return false;
508  }
509 
511  virtual bool deRregisterSubcontroller(ICustomView* customViewConnector)
512  {
513  CustomViewController* pCVC = getCustomSubController(customViewConnector);
514  if (pCVC)
515  {
516  pCVC->clearCustomViewPtr();
517 
518  MessageInfo info(PLUGINGUI_DE_REGISTER_SUBCONTROLLER);
519  info.inMessageString = "";
520  info.inMessageData = pCVC;
521 
522  if (pluginCore && pluginCore->processMessage(info))
523  return true;
524  }
525 
526  return false;
527  }
528 
529 
531  virtual bool registerCustomView(std::string customViewName, ICustomView* customViewConnector)
532  {
533  // --- do we have this in our map already?
534  CustomViewController* pCVC = nullptr;
535 
536  customViewControllerMap::const_iterator it = customViewMap.find(customViewName);
537  if (it != customViewMap.end())
538  {
539  pCVC = it->second;
540  pCVC->setCustomViewPtr(customViewConnector);
541  }
542  else
543  {
544  pCVC = new CustomViewController(customViewConnector);
545  customViewMap.insert(std::make_pair(customViewName, pCVC));
546  }
547 
548  MessageInfo info(PLUGINGUI_REGISTER_CUSTOMVIEW);
549  info.inMessageString = customViewName;
550  info.inMessageData = pCVC;
551 
552  if(pluginCore && pluginCore->processMessage(info))
553  return true;
554 
555  return false;
556  }
557 
559  virtual bool deRegisterCustomView(ICustomView* customViewConnector)
560  {
561  CustomViewController* pCVC = getCustomViewController(customViewConnector);
562  if (pCVC)
563  {
564  // --- clear it
565  pCVC->clearCustomViewPtr();
566 
567  MessageInfo info(PLUGINGUI_DE_REGISTER_CUSTOMVIEW);
568  info.inMessageString = "";
569  info.inMessageData = pCVC;
570 
571  if (pluginCore && pluginCore->processMessage(info))
572  return true;
573  }
574 
575  return false;
576  }
577 
579  virtual bool guiDidOpen()
580  {
581  if(!pluginCore) return false;
582  MessageInfo info(PLUGINGUI_DIDOPEN);
583  return pluginCore->processMessage(info);
584  }
585 
587  virtual bool guiWillClose()
588  {
589  if(!pluginCore) return false;
590 
591  for (customViewControllerMap::const_iterator it = customViewMap.begin(), end = customViewMap.end(); it != end; ++it)
592  {
593  it->second->clearCustomViewPtr();
594  }
595  for (customViewControllerMap::const_iterator it = customSubControllerMap.begin(), end = customSubControllerMap.end(); it != end; ++it)
596  {
597  it->second->clearCustomViewPtr();
598  }
599 
600  MessageInfo info(PLUGINGUI_WILLCLOSE);
601  return pluginCore->processMessage(info);
602  }
603 
605  virtual bool guiTimerPing()
606  {
607  if(!pluginCore) return false;
608  MessageInfo info(PLUGINGUI_TIMERPING);
609  return pluginCore->processMessage(info);
610  }
611 
613  virtual bool checkNonBoundValueChange(int tag, float normalizedValue)
614  {
615  if(!pluginCore) return false;
616 
617  // --- do any additional stuff here
618  // --- dispatch non-bound value changes directly to receiver
619 
620  return false;
621  }
622 
623 
624 protected:
625  PluginCore* pluginCore = nullptr;
626  AUFXPlugin* auInstance = nullptr;
627 
628  // --- this is for supporting the persistent interface pointer for the core object
629  // and is required by ASPiK Specifications
630  typedef std::map<std::string, CustomViewController*> customViewControllerMap;
631  customViewControllerMap customViewMap;
632 
635  {
636  for (customViewControllerMap::const_iterator it = customViewMap.begin(), end = customViewMap.end(); it != end; ++it)
637  {
638  if (it->second->getCustomViewPtr() == customViewConnector)
639  return it->second;
640  }
641 
642  return nullptr;
643  }
644 
646 
649  {
650  for (customViewControllerMap::const_iterator it = customSubControllerMap.begin(), end = customSubControllerMap.end(); it != end; ++it)
651  {
652  if (it->second->getCustomViewPtr() == customViewConnector)
653  return it->second;
654  }
655 
656  return nullptr;
657  }
658 };
659 
660 // --- GUI -> Plugin interface
677 {
678 public:
679 
682  {
683  pluginCore = _pluginCore;
684  writingQueueA.store(true);
685  };
686 
689  {
690  clearEvents();
691  }
692 
694  void clearEvents()
695  {
698  }
699 
702  {
703  if(midiEventQueueA.size() > 0)
704  fprintf(stderr, "midiEventQueueA.size() > 0: %u", midiEventQueueA.size() > 0);
705 
706  while(midiEventQueueA.size() > 0)
707  midiEventQueueA.pop();
708  }
709 
712  {
713  if(midiEventQueueB.size() > 0)
714  fprintf(stderr, "midiEventQueueB.size() > 0: %u", midiEventQueueB.size() > 0);
715 
716  while(midiEventQueueB.size() > 0)
717  midiEventQueueB.pop();
718  }
719 
721  void toggleQueue()
722  {
723  // --- toggle the atomic bool
725 
726  // --- clear out write-queue (should never be non-empty)
727  if(writingQueueA)
729  else
731  }
732 
734  inline void addEvent(midiEvent event)
735  {
736  if(writingQueueA)
737  {
738  midiEventQueueA.push(event);
739  // fprintf(stderr, "QA addEvent: %u", event.midiData1);
740  // fprintf(stderr, " with offset: %u\n", event.midiSampleOffset);
741 
742  }
743  else
744  {
745  midiEventQueueB.push(event);
746  //fprintf(stderr, "QB addEvent: %u", event.midiData1);
747  // fprintf(stderr, " with offset: %u\n", event.midiSampleOffset);
748 
749  }
750  }
751 
753  virtual unsigned int getEventCount()
754  {
755  if(writingQueueA)
756  return midiEventQueueB.size();
757  else
758  return midiEventQueueA.size();
759  }
760 
762  virtual bool fireMidiEvents(unsigned int sampleOffset)
763  {
764  std::queue<midiEvent>* readingQueue = writingQueueA ? &midiEventQueueB : &midiEventQueueA;
765 
766  if(readingQueue->size() <= 0 || !pluginCore) return false;
767 
768  while(readingQueue->size() > 0)
769  {
770  // --- check the current top
771  midiEvent event = readingQueue->front();
772  if(event.midiSampleOffset != sampleOffset) return false;
773 
774  // fprintf(stderr, "fired MIDI Event: %u", event.midiData1);
775  // fprintf(stderr, " with offset: %u\n", event.midiSampleOffset);
776 
777  // --- send to core for processing
778  if(pluginCore)
780 
781  // --- pop to remove
782  readingQueue->pop();
783  }
784  return true;
785  }
786 
787 
788 protected:
789  PluginCore* pluginCore = nullptr;
790  std::queue<midiEvent> midiEventQueueA;
791  std::queue<midiEvent> midiEventQueueB;
792  std::atomic<bool> writingQueueA;
793 };
virtual OSStatus HandlePitchWheel(UInt8 inChannel, UInt8 inPitch1, UInt8 inPitch2, UInt32 inStartFrame)
specialized MIDI handler for only this message; CURRENTLY NOT USED, see HandleMidiEvent ...
Definition: aufxplugin.cpp:1087
virtual double getActualPluginParameter(int32_t controlID)
Definition: aufxplugin.h:456
Information that includes the message code as well as the message data.
Definition: pluginstructures.h:545
CustomViewController * getCustomViewController(ICustomView *customViewConnector)
Definition: AAXPluginParameters.h:721
PluginParameter * getPluginParameterByControlID(int32_t controlID)
get a parameter by control ID - uses map (slowest)
Definition: pluginbase.h:314
virtual OSStatus SetProperty(AudioUnitPropertyID inID, AudioUnitScope inScope, AudioUnitElement inElement, const void *inData, UInt32 inDataSize)
open and close the GUI object
Definition: aufxplugin.cpp:833
virtual ~AUMIDIEventQueue()
Definition: aufxplugin.h:688
The AUMIDIEventQueue interface queues incoming MIDI messages and blasts them out during the buffer pr...
Definition: aufxplugin.h:676
virtual unsigned int getEventCount()
Definition: aufxplugin.h:753
virtual OSStatus HandleNoteOff(UInt8 inChannel, UInt8 inNoteNumber, UInt8 inVelocity, UInt32 inStartFrame)
specialized MIDI handler for only this message; CURRENTLY NOT USED, see HandleMidiEvent ...
Definition: aufxplugin.cpp:1067
virtual bool guiWillClose()
Definition: aufxplugin.h:587
virtual OSStatus ProcessBufferLists(AudioUnitRenderActionFlags &ioActionFlags, const AudioBufferList &inBuffer, AudioBufferList &outBuffer, UInt32 inFramesToProcess)
process the de-interleaved channel buffers
Definition: aufxplugin.cpp:463
The CustomViewController is part of the safe ICustomView feature in ASPiK. The CustomViewController m...
Definition: AAXPluginParameters.h:440
virtual ComponentResult Initialize()
the AU init function
Definition: aufxplugin.cpp:231
AUMIDIEventQueue(PluginCore *_pluginCore)
Definition: aufxplugin.h:681
virtual OSStatus NewFactoryPresetSet(const AUPreset &inNewFactoryPreset)
user has selected a new preset
Definition: aufxplugin.cpp:996
virtual void updateView()
Definition: aufxplugin.h:376
virtual bool processMIDIEvent(midiEvent &event)
process a MIDI event
Definition: plugincore.cpp:395
virtual bool fireMidiEvents(unsigned int sampleOffset)
Definition: aufxplugin.h:762
void toggleQueue()
Definition: aufxplugin.h:721
virtual void pushDataValue(double data)
Definition: aufxplugin.h:383
AUChannelInfo * auChannelInfo
the current channel information
Definition: aufxplugin.h:281
void updateHostInfo(HostInfo *hostInfo)
set the HostInfo for the core (varies by API)
Definition: aufxplugin.cpp:543
virtual bool deRregisterSubcontroller(ICustomView *customViewConnector)
Definition: aufxplugin.h:511
void setAUParameterChangeEvent(unsigned int controlID, double actualValue)
safely issue a parameter change event
Definition: aufxplugin.cpp:283
interface file for ASPiK GUI object
uint32_t controlID
ID value.
Definition: pluginstructures.h:299
double getTailTimeInMSec()
Description query: tail time.
Definition: pluginbase.h:471
AUFXPlugin * auInstance
the AU plugin (NOTE this is not base-class)
Definition: aufxplugin.h:626
virtual ComponentResult Version()
Definition: aufxplugin.h:77
void clearCustomViewPtr()
Definition: aufxplugin.h:403
virtual bool processMessage(MessageInfo &messageInfo)
For Custom View and Custom Sub-Controller Operations.
Definition: plugincore.cpp:335
float ** outputBuffers
de-interleaved outgoing audio output buffers
Definition: aufxplugin.h:283
std::queue< midiEvent > midiEventQueueB
queue B
Definition: aufxplugin.h:791
virtual bool registerCustomView(std::string customViewName, ICustomView *customViewConnector)
Definition: aufxplugin.h:531
virtual bool checkNonBoundValueChange(int tag, float normalizedValue)
Definition: aufxplugin.h:613
CustomViewController(ICustomView *_customViewIF)
Definition: aufxplugin.h:372
char * getMyComponentDirectory(CFStringRef bundleID)
helper function to get a path to the location where THIS library is loaded
Definition: aufxplugin.h:213
virtual UInt32 SupportedNumChannels(const AUChannelInfo **outInfo)
return an array of AUChannelInfo structures with input and output channel combinations ...
Definition: aufxplugin.cpp:193
PluginHostConnector * pluginHostConnector
Plugin -> Host interface.
Definition: aufxplugin.h:266
void updateAUParametersWithPluginCore()
send parameter update info (metering, output)
Definition: aufxplugin.cpp:374
AUFXPlugin * auInstance
our plugin object for setAUParameterChangeEvent()
Definition: aufxplugin.h:351
void addEvent(midiEvent event)
Definition: aufxplugin.h:734
float ** inputBuffers
de-interleaved incoming audio input buffers
Definition: aufxplugin.h:282
void updatePluginCoreParameters()
set the plugin core parameters from the AU parameters (called during each buffer process cycle) ...
Definition: aufxplugin.cpp:342
Information about a GUI update message; this is for sending GUI control information from the plugin c...
Definition: pluginstructures.h:368
virtual bool deRegisterCustomView(ICustomView *customViewConnector)
Definition: aufxplugin.h:559
AudioBufferList * sidechainBufferList
sidechain buffers (if active)
Definition: aufxplugin.h:279
Custom interface so that GUI can pass information to plugin shell in a thread-safe manner...
Definition: pluginstructures.h:1219
Float64 latencyInSeconds
au latency (seconds!)
Definition: aufxplugin.h:292
virtual OSStatus HandleNoteOn(UInt8 inChannel, UInt8 inNoteNumber, UInt8 inVelocity, UInt32 inStartFrame)
specialized MIDI handler for only this message; CURRENTLY NOT USED, see HandleMidiEvent ...
Definition: aufxplugin.cpp:1047
PluginCore * pluginCore
the core object
Definition: AAXPluginParameters.h:712
virtual OSStatus Render(AudioUnitRenderActionFlags &ioActionFlags, const AudioTimeStamp &inTimeStamp, UInt32 inNumberFrames)
first function to be called during buffer process cycle
Definition: aufxplugin.cpp:403
Custom View interface to allow plugin core to create safe communication channels with GUI custom view...
Definition: pluginstructures.h:1141
AUFXPlugin(AudioUnit component)
constructor for plugin object
Definition: aufxplugin.cpp:51
void clearQueueAEvents()
Definition: aufxplugin.h:701
PluginCore * pluginCore
GUI the plugin core: alive for FULL lifecycle of shell.
Definition: aufxplugin.h:271
virtual void parameterChanged(int32_t controlID, double actualValue, double)
Definition: aufxplugin.h:449
virtual ComponentResult Reset(AudioUnitScope inScope, AudioUnitElement inElement)
reset function for AU and core
Definition: aufxplugin.cpp:157
AUMIDIEventQueue * midiEventQueue
double-buffered-queue for MIDI messaging
Definition: aufxplugin.h:267
void * presetsArrayData
contiguous memory block for persistent preset data
Definition: aufxplugin.h:287
Definition: pluginstructures.h:397
Double buffered queue for MIDI messages.
Definition: pluginstructures.h:1307
virtual bool guiParameterChanged(int32_t controlID, double actualValue)
has nothing to do with actual variable or updated variable (binding)
Definition: plugincore.cpp:306
The GUIPluginConnector interface creates a safe message mechanism for the GUI to issue requests to th...
Definition: AAXPluginParameters.h:500
virtual ComponentResult GetParameterInfo(AudioUnitScope inScope, AudioUnitParameterID inParameterID, AudioUnitParameterInfo &outParameterInfo)
get information about each AU parameter that was initialized
Definition: aufxplugin.cpp:627
virtual OSStatus GetPropertyInfo(AudioUnitPropertyID inID, AudioUnitScope nScope, AudioUnitElement inElement, UInt32 &outDataSize, Boolean &outWritable)
queries from host about plugin properties
Definition: aufxplugin.cpp:732
void initAUParametersWithPluginCore()
setup the AU parameter list with the plugin core&#39;s parameter list
Definition: aufxplugin.cpp:315
std::map< std::string, CustomViewController * > customViewControllerMap
map of custom view controllers
Definition: aufxplugin.h:630
std::atomic< bool > writingQueueA
atomic flag for toggling buffers
Definition: aufxplugin.h:792
void clearEvents()
Definition: aufxplugin.h:694
virtual Float64 GetLatency()
Definition: aufxplugin.h:134
virtual OSStatus HandleControlChange(UInt8 inChannel, UInt8 inController, UInt8 inValue, UInt32 inStartFrame)
specialized MIDI handler for only this message; CURRENTLY NOT USED, see HandleMidiEvent ...
Definition: aufxplugin.cpp:1117
virtual double getNormalizedPluginParameter(int32_t controlID)
Definition: aufxplugin.h:468
virtual ComponentResult GetPresets(CFArrayRef *outData) const
return a static array of preset information structures
Definition: aufxplugin.cpp:943
void * inMessageData
incoming message data (interpretation depends on message)
Definition: pluginstructures.h:559
int sidechainChannelCount
num sidechain channels
Definition: aufxplugin.h:280
virtual ComponentResult RestoreState(CFPropertyListRef inData)
called when a user preset is updated; may also be called during init; note the call sequence depends ...
Definition: aufxplugin.cpp:265
std::vector< GUIParameter > guiParameters
list of updates
Definition: pluginstructures.h:373
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: aufxplugin.cpp:1139
virtual bool registerSubcontroller(std::string subcontrollerName, ICustomView *customViewConnector)
Definition: aufxplugin.h:483
void setCustomViewPtr(ICustomView *_customViewIF)
Definition: aufxplugin.h:397
CustomViewController * getCustomSubController(ICustomView *customViewConnector)
Definition: AAXPluginParameters.h:734
std::queue< midiEvent > midiEventQueueA
queue A
Definition: aufxplugin.h:790
virtual OSStatus GetProperty(AudioUnitPropertyID inID, AudioUnitScope inScope, AudioUnitElement inElement, void *outData)
queries from host to get property information
Definition: aufxplugin.cpp:783
virtual bool guiDidOpen()
Definition: aufxplugin.h:579
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: aufxplugin.h:436
virtual void sendMessage(void *data)
Definition: pluginstructures.h:1162
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
Information that defines a single GUI parameter&#39;s possible values and ID.
Definition: pluginstructures.h:291
void clearQueueBEvents()
Definition: aufxplugin.h:711
The AUFXPlugin is the ASPiK plugin shell for Audio Units plugin. It contains the plugin kernel and al...
Definition: aufxplugin.h:70
PluginCore * pluginCore
the core object to send MIDI messages to
Definition: aufxplugin.h:789
GUIPluginConnector * guiPluginConnector
GUI -> Plugin interface.
Definition: aufxplugin.h:265
GUIPluginConnector(AUFXPlugin *_auInstance, PluginCore *_pluginCore)
Definition: aufxplugin.h:433
~AUFXPlugin()
destructor for plugin object
Definition: aufxplugin.cpp:117
base class interface file for ASPiK plugincore object
double actualValue
actual value
Definition: pluginstructures.h:300
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:729
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
virtual ComponentResult SetParameter(AudioUnitParameterID inID, AudioUnitScope inScope, AudioUnitElement inElement, AudioUnitParameterValue inValue, UInt32 inBufferOffsetInFrames)
this just calls base class
Definition: aufxplugin.cpp:604
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:302
virtual bool SupportsTail()
Definition: aufxplugin.h:117
std::string inMessageString
incoming message data as a std::string (interpretation depends on message)
Definition: pluginstructures.h:562
Custom interface to send the plugin shell a message from plugin core.
Definition: pluginstructures.h:1289
The PluginHostConnector implements the IPluginHostConnector interface for the plugin shell object...
Definition: AAXPluginParameters.h:380
float ** sidechainInputBuffers
de-interleaved incoming audio sidechain buffers
Definition: aufxplugin.h:284
virtual void sendHostMessage(const HostMessageInfo &hostMessageInfo)
process a message; by default it processes sendGUIUpdate to safely send a parameter change event but ...
Definition: aufxplugin.h:323
const ICustomView * getCustomViewPtr()
Definition: aufxplugin.h:400
virtual ComponentResult GetParameterValueStrings(AudioUnitScope inScope, AudioUnitParameterID inParameterID, CFArrayRef *outStrings)
get parameter string-lists (for string-list params only)
Definition: aufxplugin.cpp:690
customViewControllerMap customSubControllerMap
map of custom sub-controllers
Definition: AAXPluginParameters.h:732
virtual void pushDataValue(double data)
Definition: pluginstructures.h:1152
virtual void sendMessage(void *data)
Definition: aufxplugin.h:390
int currentPreset
current preset&#39;s index value
Definition: aufxplugin.h:288
virtual bool guiTimerPing()
Definition: aufxplugin.h:605
Information about a MIDI event.
Definition: pluginstructures.h:449
bool hasSidechain
sidechain flag
Definition: aufxplugin.h:278