ASPiK SDK
AAXPluginParameters.h
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------
2 // ASPiK AAX Shell File: aaxpluginparameters.h
3 //
20 // -----------------------------------------------------------------------------
21 #pragma once
22 #ifndef AAX_PARAMETERS_H
23 #define AAX_PARAMETERS_H
24 
25 #include "AAX_CEffectParameters.h"
26 #pragma warning(disable : 4985) // --- 'ceil': attributes not present on previous declaration NOTE: for VS2008 only, see the google for more info
27 
28 #include "AAX_CAtomicQueue.h"
29 #include "AAX_IParameter.h"
30 #include "AAX_IMIDINode.h"
31 #include "AAX_IString.h"
32 #include "AAX_IEffectDescriptor.h"
33 #include "AAX_IComponentDescriptor.h"
34 #include "AAX_IPropertyMap.h"
35 
36 #include <set>
37 #include <list>
38 #include <utility>
39 #include <vector>
40 
41 // --- our plugin core object
42 #include "plugincore.h"
43 #include "customcontrols.h"
44 
45 #if MAC
46 #include <CoreFoundation/CoreFoundation.h>
47 #else
48 #include <windows.h>
49 #endif
50 
51 // --- see AAX_ITransport.h before enabling this: performance hits!
52 // #define ENABLE_EXTRA_HOST_INFO
53 
54 // --- constants
55 const AAX_CTypeID PLUGIN_CUSTOMDATA_ID = 0;
56 
57 // --- special ProTools meter
58 const AAX_CTypeID GR_MeterID = 'grMT';
59 const unsigned int meterTapCount = 1;
60 
61 // --- setup context struct
63 class GUIPluginConnector;
65 class AAXMIDIEventQueue;
66 
79 {
80  GUIPluginConnector* guiPlugin_Connector = nullptr; // added nullptr 5.9.18
81  PluginCore* plugin_Core = nullptr;
82 };
83 
98 {
99  AAXPluginParameters* aaxPluginParameters;
100 };
101 
115 // --- processing struct
117 {
118  // --- audio
119  pluginPrivateData* privateData; // --- the Monolithic Parameters
120  float** inputBufferPtrs; // --- inputs buffer
121  float** outputBufferPtrs; // --- outputs buffer
122  int32_t* bufferLength; // --- buffer size (per channel)
123 #ifdef PT_GR_METER
124  float** grMeterPtrs; // --- Meter taps; currrently support one GR meter (have never seen more than 1)
125 #endif
126 
127 #ifdef WANT_SIDECHAIN
128  int32_t* sidechainChannel; // --- sidechain channel pointer
129 #endif
130 
131  // --- MIDI
132  AAX_IMIDINode* midiInputNode; // --- MIDI input node -> plugin
133  AAX_IMIDINode* midiTransportNode; // --- for getting info about the host BPM, etc...
134 
135  // --- params
136  int64_t* currentStateNum; // --- state value
137 };
138 
139 
140 #define kMaxAdditionalMIDINodes 15
141 #define kMaxAuxOutputStems 32
142 
143 // --- NOTE: default here is 64 parameters; you should tweak this value to your final parameter count
144 // for the smallest size plugin; undetermined if this is more efficient or not.
153 #define kSynchronizedParameterQueueSize 64
154 
162 typedef std::pair<AAX_CParamID const, const AAX_IParameterValue*> TParamValPair;
163 
176 class AAXPluginParameters : public AAX_CEffectParameters
177 {
178 public:
180  virtual ~AAXPluginParameters();
181 
183  static AAX_CEffectParameters* AAX_CALLBACK Create();
184 
186  virtual AAX_Result UpdateParameterNormalizedValue (AAX_CParamID iParameterID, double iValue, AAX_EUpdateSource iSource );
187 
189  void AddSynchronizedParameter(const AAX_IParameter& inParameter);
190 
191 public:
192  // --- Overrides from AAX_CEffectParameters
193  virtual AAX_Result EffectInit();
194  virtual AAX_Result ResetFieldData (AAX_CFieldIndex inFieldIndex, void * oData, uint32_t iDataSize) const;
195  virtual AAX_Result GenerateCoefficients();
196  virtual AAX_Result TimerWakeup();
197 
199  static void AAX_CALLBACK StaticRenderAudio(AAXAlgorithm* const inInstancesBegin[], const void* inInstancesEnd);
200 
202  static AAX_Result StaticDescribe(AAX_IComponentDescriptor& outDesc);
203 
205  virtual AAX_Result GetCustomData(AAX_CTypeID iDataBlockID, uint32_t iDataSize, void* oData, uint32_t* oDataWritten) const;
206 
208  void updateHostInfo(AAXAlgorithm* ioRenderInfo, HostInfo* hostInfo);
209 
211  void ProcessAudio(AAXAlgorithm* ioRenderInfo, const TParamValPair* inSynchronizedParamValues[], int32_t inNumSynchronizedParamValues);
212 
214  void UpdatePluginParameters(const TParamValPair* inSynchronizedParamValues[], int32_t inNumSynchronizedParamValues);
215 
218 
231  {
232  // Using 4x the preset queue size: the buffer must be large enough to accommodate the maximum
233  // number of updates that we expect to be queued between/before executions of the render callback.
234  // The maximum queuing that will likely ever occur is during a preset change (i.e. a call to
235  // SetChunk()), in which updates to all parameters may be queued in the same state frame. It is
236  // possible that the host would call SetChunk() on the plug-in more than once before the render
237  // callback executes, but probably not more than 2-3x. Therefore 4x seems like a safe upper limit
238  // for the capacity of this buffer.
239  static const int32_t sCap = 4*kSynchronizedParameterQueueSize;
240 
241  TParamValPair* mElem[sCap];
242  int32_t mSize;
243 
244  SParamValList()
245  {
246  Clear();
247  }
248 
249  void Add(TParamValPair* inElem)
250  {
251  AAX_ASSERT(sCap > mSize);
252  if (sCap > mSize)
253  {
254  mElem[mSize++] = inElem;
255  }
256  }
257 
258  void Append(const SParamValList& inOther)
259  {
260  AAX_ASSERT(sCap >= mSize + inOther.mSize);
261  for (int32_t i = 0; i < inOther.mSize; ++i)
262  {
263  Add(inOther.mElem[i]);
264  }
265  }
266 
267  void Append(const std::list<TParamValPair*>& inOther)
268  {
269  AAX_ASSERT(sCap >= mSize + (int64_t)inOther.size());
270  for (std::list<TParamValPair*>::const_iterator iter = inOther.begin(); iter != inOther.end(); ++iter)
271  {
272  Add(*iter);
273  }
274  }
275 
276  void Merge(AAX_IPointerQueue<TParamValPair>& inOther)
277  {
278  do
279  {
280  TParamValPair* const val = inOther.Pop();
281  if (NULL == val) { break; }
282  Add(val);
283  } while (1);
284  }
285 
286  void Clear()
287  {
288  std::memset(mElem, 0x0, sizeof(mElem));
289  mSize = 0;
290  }
291  };
292 
293 private:
294  // --- see AAX_CMonolithicParameters in SDK
295  // these are identically declared and used with the AAX_CMonolithicParameters sample code
296  // this is the AVID method of synchronizing the playback-head to the controls
297  typedef std::set<const AAX_IParameter*> TParamSet;
298  typedef std::pair<int64_t, std::list<TParamValPair*> > TNumberedParamStateList;
299  typedef AAX_CAtomicQueue<TNumberedParamStateList, 256> TNumberedStateListQueue;
300 
301  typedef AAX_CAtomicQueue<const TParamValPair, 16*kSynchronizedParameterQueueSize> TParamValPairQueue;
302 
303  SParamValList GetUpdatesForState(int64_t inTargetStateNum);
304  void DeleteUsedParameterChanges();
305  std::set<std::string> mSynchronizedParameters;
306  int64_t mStateCounter;
307  TParamSet mDirtyParameters;
308  TNumberedStateListQueue mQueuedParameterChanges;
309  TNumberedStateListQueue mFinishedParameterChanges;
310  TParamValPairQueue mFinishedParameterValues;
311  int64_t mCurrentStateNum;
312 
313  // --- soft bypass flag
314  bool softBypass = false;
315 
316  // --- plugin core and interfaces
317  PluginCore* pluginCore = nullptr;
318  GUIPluginConnector* guiPluginConnector = nullptr;
319  PluginHostConnector* pluginHostConnector = nullptr;
320  AAXMIDIEventQueue* midiEventQueue = nullptr;
321 
323  uint32_t getChannelFormatForAAXStemFormat(AAX_EStemFormat format)
324  {
325  switch(format)
326  {
327  case AAX_eStemFormat_None: {
328  return kCFNone; }
329 
330  case AAX_eStemFormat_Mono: {
331  return kCFMono; }
332 
333  case AAX_eStemFormat_Stereo: {
334  return kCFStereo; }
335 
336  case AAX_eStemFormat_LCR: {
337  return kCFLCR; }
338 
339  case AAX_eStemFormat_LCRS: {
340  return kCFLCRS; }
341 
342  case AAX_eStemFormat_Quad: {
343  return kCFQuad; }
344 
345  case AAX_eStemFormat_5_0: {
346  return kCF5p0; }
347 
348  case AAX_eStemFormat_5_1: {
349  return kCF5p1; }
350 
351  case AAX_eStemFormat_6_0: {
352  return kCF6p0; }
353 
354  case AAX_eStemFormat_6_1: {
355  return kCF6p1; }
356 
357  case AAX_eStemFormat_7_0_SDDS: {
358  return kCF7p0Sony; }
359 
360  case AAX_eStemFormat_7_0_DTS: {
361  return kCF7p0DTS; }
362 
363  case AAX_eStemFormat_7_1_SDDS: {
364  return kCF7p1Sony; }
365 
366  case AAX_eStemFormat_7_1_DTS: {
367  return kCF7p1DTS; }
368 
369  case AAX_eStemFormat_7_1_2: {
370  return kCF7p1Proximity; }
371 
372  default: {
373  return kCFNone; }
374  }
375  return kCFNone;
376  }
377 
378 #if defined _WINDOWS || defined _WINDLL
379  wchar_t* convertCharArrayToLPCWSTR(const char* charArray)
380  {
381  wchar_t* wString = new wchar_t[4096];
382  MultiByteToWideChar(CP_ACP, 0, charArray, -1, wString, 4096);
383  return wString;
384  }
385  // --- getMyDLLDirectory()
386  // returns the directory where the .component resides
387  char* getMyDLLDirectory(const char* dllName)
388  {
389  wchar_t* cPluginName = convertCharArrayToLPCWSTR(dllName);
390  HMODULE hmodule = GetModuleHandle(cPluginName);
391 
392  TCHAR dir[MAX_PATH];
393  memset(&dir[0], 0, MAX_PATH*sizeof(TCHAR));
394  dir[MAX_PATH-1] = '\0';
395 
396  if(hmodule)
397  GetModuleFileName(hmodule, &dir[0], MAX_PATH);
398  else
399  return nullptr;
400 
401  // --- use string tools
402  std::wstring backslash(L"\\");
403  std::wstring strPlugin(cPluginName);
404  std::wstring strDir(&dir[0]);
405  int pathLen = strDir.size() - strPlugin.size() - backslash.size();
406  if (pathLen > 0)
407  {
408  std::wstring strPath = strDir.substr(0, pathLen);
409  char* str = new char[MAX_PATH];
410  sprintf(str, "%ls", strPath.c_str());
411  delete[] cPluginName;
412 
413  return str; // dllPath.c_str();
414  }
415  return "";
416  }
417 
418 #else
419  char* getMyComponentDirectory(CFStringRef bundleID)
420  {
421  if (bundleID != nullptr)
422  {
423  CFBundleRef helixBundle = CFBundleGetBundleWithIdentifier( bundleID );
424  if(helixBundle != nullptr)
425  {
426  CFURLRef bundleURL = CFBundleCopyBundleURL ( helixBundle );
427  if(bundleURL != nullptr)
428  {
429  CFURLRef componentFolderPathURL = CFURLCreateCopyDeletingLastPathComponent(nullptr, bundleURL);
430 
431  CFStringRef myComponentPath = CFURLCopyFileSystemPath(componentFolderPathURL, kCFURLPOSIXPathStyle);
432  CFRelease(componentFolderPathURL);
433 
434  if(myComponentPath != nullptr)
435  {
436  int nSize = CFStringGetLength(myComponentPath);
437  char* path = new char[nSize+1];
438  memset(path, 0, (nSize+1)*sizeof(char));
439 
440  bool success = CFStringGetCString(myComponentPath, path, nSize+1, kCFStringEncodingASCII);
441  CFRelease(myComponentPath);
442 
443  if(success) return path;
444  else return nullptr;
445  }
446  CFRelease(bundleURL);
447  }
448  }
449  CFRelease(bundleID);
450  }
451  return nullptr;
452  }
453 #endif
454 };
455 
468 {
469 public:
470  PluginHostConnector(AAX_IEffectParameters* _aaxParameters) {aaxParameters = _aaxParameters;}
471  virtual ~PluginHostConnector(){}
472 
478  virtual void sendHostMessage(const HostMessageInfo& hostMessageInfo)
479  {
480  switch(hostMessageInfo.hostMessage)
481  {
482  case sendGUIUpdate:
483  {
484  GUIUpdateData guiUpdateData = hostMessageInfo.guiUpdateData;
485 
486  for (uint32_t i = 0; i < guiUpdateData.guiParameters.size(); i++)
487  {
488  GUIParameter guiParam = guiUpdateData.guiParameters[i];
489 
490  std::stringstream str;
491  str << guiParam.controlID + 1;
492  AAX_IParameter* oParameter;
493  AAX_Result result = aaxParameters->GetParameter(str.str().c_str(), &oParameter);
494  if(AAX_SUCCESS == result)
495  {
496  oParameter->SetValueWithDouble(guiParam.actualValue);
497  }
498  }
499 
500  // --- clean up
501  for (uint32_t i = 0; i < guiUpdateData.guiParameters.size(); i++)
502  guiUpdateData.guiParameters.pop_back();
503 
504  break;
505  }
506  default:
507  break;
508  }
509  }
510 
511 protected:
512  AAX_IEffectParameters* aaxParameters;
513 };
514 
515 
528 {
529 public:
531  CustomViewController(ICustomView* _customViewIF) { customViewIF = _customViewIF; }
532  virtual ~CustomViewController() {}
533 
535  virtual void updateView()
536  {
537  if (customViewIF)
538  customViewIF->updateView();
539  }
540 
542  virtual void pushDataValue(double data)
543  {
544  if (customViewIF)
545  customViewIF->pushDataValue(data);
546  }
547 
549  virtual void sendMessage(void* data)
550  {
551  if (customViewIF)
552  customViewIF->sendMessage(data);
553  }
554 
556  void setCustomViewPtr(ICustomView* _customViewIF) { customViewIF = _customViewIF; }
557 
559  const ICustomView* getCustomViewPtr() { return customViewIF; }
560 
562  void clearCustomViewPtr() { customViewIF = nullptr; }
563 
564 
565 private:
566  ICustomView* customViewIF = nullptr;
567 };
568 
588 {
589 public:
591  GUIPluginConnector(AAX_IEffectParameters* _aaxParameters, PluginCore* _pluginCore){pluginCore = _pluginCore; aaxParameters = _aaxParameters;}
592 
595  {
596  for (customViewControllerMap::const_iterator it = customSubControllerMap.begin(), end = customSubControllerMap.end(); it != end; ++it)
597  {
598  delete it->second;
599  }
600  for (customViewControllerMap::const_iterator it = customViewMap.begin(), end = customViewMap.end(); it != end; ++it)
601  {
602  delete it->second;
603  }
604  }
605 
607  virtual void parameterChanged(int32_t controlID, double actualValue, double /*normalizedValue*/)
608  {
609  if(pluginCore)
610  pluginCore->guiParameterChanged(controlID, actualValue);
611  }
612 
614  virtual double getNormalizedPluginParameter(int32_t controlID)
615  {
616  // --- NOTE: this is the proper way for the GUI to get parameter values
617  std::stringstream str;
618  str << controlID + 1;
619  double param = 0.0;
620  AAX_Result result = aaxParameters->GetParameterNormalizedValue(str.str().c_str(), &param);
621  if(AAX_SUCCESS == result)
622  return param;
623 
624  return 0.0;
625  }
626 
628  virtual void setNormalizedPluginParameter(int32_t controlID, double value)
629  {
630  // --- NOTE: this is the proper way for the GUI to set parameter values
631  std::stringstream str;
632  str << controlID + 1;
633  aaxParameters->SetParameterNormalizedValue(str.str().c_str(), value);
634  }
635 
637  virtual void beginParameterChangeGesture(int controlTag)
638  {
639  if(aaxParameters)
640  {
641  std::stringstream str;
642  str << controlTag+1;
643  aaxParameters->TouchParameter(str.str().c_str());
644  }
645  }
646 
648  virtual void endParameterChangeGesture(int controlTag)
649  {
650  if(aaxParameters )
651  {
652  std::stringstream str;
653  str << controlTag+1;
654  aaxParameters->ReleaseParameter(str.str().c_str());
655  }
656  }
657 
659  virtual bool registerSubcontroller(std::string subcontrollerName, ICustomView* customViewConnector)
660  {
661  // --- do we have this in our map already?
662  CustomViewController* pCVC = nullptr;
663 
664  customViewControllerMap::const_iterator it = customSubControllerMap.find(subcontrollerName);
665  if (it != customSubControllerMap.end())
666  {
667  pCVC = it->second;
668  pCVC->setCustomViewPtr(customViewConnector);
669  }
670  else
671  {
672  pCVC = new CustomViewController(customViewConnector);
673  customSubControllerMap.insert(std::make_pair(subcontrollerName, pCVC));
674  }
675 
676  MessageInfo info(PLUGINGUI_REGISTER_SUBCONTROLLER);
677  info.inMessageString = subcontrollerName;
678  info.inMessageData = pCVC;
679 
680  if (pluginCore && pluginCore->processMessage(info))
681  return true;
682 
683  return false;
684  }
685 
687  virtual bool deRregisterSubcontroller(ICustomView* customViewConnector)
688  {
689  CustomViewController* pCVC = getCustomSubController(customViewConnector);
690  if (pCVC)
691  {
692  pCVC->clearCustomViewPtr();
693 
694  MessageInfo info(PLUGINGUI_DE_REGISTER_SUBCONTROLLER);
695  info.inMessageString = "";
696  info.inMessageData = pCVC;
697 
698  if (pluginCore && pluginCore->processMessage(info))
699  return true;
700  }
701 
702  return false;
703  }
704 
706  virtual bool registerCustomView(std::string customViewName, ICustomView* customViewConnector)
707  {
708  // --- do we have this in our map already?
709  CustomViewController* pCVC = nullptr;
710 
711  customViewControllerMap::const_iterator it = customViewMap.find(customViewName);
712  if (it != customViewMap.end())
713  {
714  pCVC = it->second;
715  pCVC->setCustomViewPtr(customViewConnector);
716  }
717  else
718  {
719  pCVC = new CustomViewController(customViewConnector);
720  customViewMap.insert(std::make_pair(customViewName, pCVC));
721  }
722 
723  MessageInfo info(PLUGINGUI_REGISTER_CUSTOMVIEW);
724  info.inMessageString = customViewName;
725  info.inMessageData = pCVC;
726 
727  if(pluginCore && pluginCore->processMessage(info))
728  return true;
729 
730  return false;
731  }
732 
734  virtual bool deRegisterCustomView(ICustomView* customViewConnector)
735  {
736  CustomViewController* pCVC = getCustomViewController(customViewConnector);
737  if (pCVC)
738  {
739  // --- clear it
740  pCVC->clearCustomViewPtr();
741 
742  MessageInfo info(PLUGINGUI_DE_REGISTER_CUSTOMVIEW);
743  info.inMessageString = "";
744  info.inMessageData = pCVC;
745 
746  if (pluginCore && pluginCore->processMessage(info))
747  return true;
748  }
749 
750  return false;
751  }
752 
754  virtual bool guiDidOpen()
755  {
756  if(!pluginCore) return false;
757  MessageInfo info(PLUGINGUI_DIDOPEN);
758  return pluginCore->processMessage(info);
759  }
760 
762  virtual bool guiWillClose()
763  {
764  if(!pluginCore) return false;
765 
766  for (customViewControllerMap::const_iterator it = customViewMap.begin(), end = customViewMap.end(); it != end; ++it)
767  {
768  it->second->clearCustomViewPtr();
769  }
770  for (customViewControllerMap::const_iterator it = customSubControllerMap.begin(), end = customSubControllerMap.end(); it != end; ++it)
771  {
772  it->second->clearCustomViewPtr();
773  }
774 
775  MessageInfo info(PLUGINGUI_WILLCLOSE);
776  return pluginCore->processMessage(info);
777  }
778 
780  virtual bool guiTimerPing()
781  {
782  if(!pluginCore) return false;
783  MessageInfo info(PLUGINGUI_TIMERPING);
784  return pluginCore->processMessage(info);
785  }
786 
788  virtual bool checkNonBoundValueChange(int tag, float normalizedValue)
789  {
790  if(!pluginCore) return false;
791 
792  // --- do any additional stuff here
793  // --- dispatch non-bound value changes directly to receiver
794 
795  return false;
796  }
797 
798 protected:
799  PluginCore* pluginCore = nullptr;
800  AAX_IEffectParameters* aaxParameters = nullptr;
801 
802  // --- this is for supporting the persistent interface pointer for the core object
803  // and is required by ASPiK Specifications
804  typedef std::map<std::string, CustomViewController*> customViewControllerMap;
805  customViewControllerMap customViewMap;
806 
809  {
810  for (customViewControllerMap::const_iterator it = customViewMap.begin(), end = customViewMap.end(); it != end; ++it)
811  {
812  if (it->second->getCustomViewPtr() == customViewConnector)
813  return it->second;
814  }
815 
816  return nullptr;
817  }
818 
820 
822  {
823  for (customViewControllerMap::const_iterator it = customSubControllerMap.begin(), end = customSubControllerMap.end(); it != end; ++it)
824  {
825  if (it->second->getCustomViewPtr() == customViewConnector)
826  return it->second;
827  }
828 
829  return nullptr;
830  }
831 };
832 
850 {
851 public:
854  : ioPacketPtr(0),
855  midiBuffersize(0)
856  {
857  pluginCore = _pluginCore;
858  };
859 
860  virtual ~AAXMIDIEventQueue(){}
861 
863  void setMIDIpackets(const AAX_CMidiPacket*& _ioPacketPtr, uint32_t& _midiBuffersize)
864  {
865  ioPacketPtr = _ioPacketPtr;
866  midiBuffersize = _midiBuffersize;
867 
868  }
869 
871  virtual unsigned int getEventCount()
872  {
873  return midiBuffersize;
874  }
875 
877  virtual bool fireMidiEvents(unsigned int sampleOffset)
878  {
879  while( (midiBuffersize > 0) && (NULL != ioPacketPtr) && ((ioPacketPtr->mTimestamp <= sampleOffset)))
880  {
881  const uint8_t uMessage = (ioPacketPtr->mData[0] & 0xF0); // message
882  const uint8_t uChannel = (ioPacketPtr->mData[0] & 0x0F); // channel
883 
884  midiEvent event;
885  event.midiMessage = (unsigned int)uMessage;
886  event.midiChannel = (unsigned int)uChannel;
887  event.midiData1 = (unsigned int)ioPacketPtr->mData[1];
888  event.midiData2 = (unsigned int)ioPacketPtr->mData[2];
889  event.midiSampleOffset = sampleOffset;
890 
891  // --- send to core for processing
892  if(pluginCore)
894 
895  ++ioPacketPtr;
896  --midiBuffersize;
897  }
898  return true;
899  }
900 
901 protected:
902  PluginCore* pluginCore = nullptr;
903  const AAX_CMidiPacket* ioPacketPtr;
904  uint32_t midiBuffersize = 0;
905 };
906 
907 #endif
908 
std::pair< AAX_CParamID const, const AAX_IParameterValue * > TParamValPair
Defines a parameter-value pair for the monolithic parameters AAX programming paradigm; this is very w...
Definition: AAXPluginParameters.h:162
Information that includes the message code as well as the message data.
Definition: pluginstructures.h:705
CustomViewController * getCustomViewController(ICustomView *customViewConnector)
Definition: AAXPluginParameters.h:808
The AAXPluginParameters object implements the monolithic parameters AAX plugin programming paradigm w...
Definition: AAXPluginParameters.h:176
uint32_t midiBuffersize
midi buffer size for each bunch of packets
Definition: AAXPluginParameters.h:904
virtual bool guiWillClose()
Definition: AAXPluginParameters.h:762
void setMIDIpackets(const AAX_CMidiPacket *&_ioPacketPtr, uint32_t &_midiBuffersize)
Definition: AAXPluginParameters.h:863
The CustomViewController is part of the safe ICustomView feature in ASPiK. The CustomViewController m...
Definition: AAXPluginParameters.h:527
virtual void updateView()
Definition: AAXPluginParameters.h:535
virtual bool processMIDIEvent(midiEvent &event)
process a MIDI event
Definition: plugincore.cpp:415
See AAX_CMonolithicParameters in SDK; this is part of the strict parameter synchronization in monolit...
Definition: AAXPluginParameters.h:230
void UpdatePluginParameters(const TParamValPair *inSynchronizedParamValues[], int32_t inNumSynchronizedParamValues)
called once per buffer process operation to update any parameters that changed during the buffer fill...
Definition: AAXPluginParameters.cpp:399
virtual void pushDataValue(double data)
Definition: AAXPluginParameters.h:542
AAX_IEffectParameters * aaxParameters
parent parameters; lifelong existence
Definition: AAXPluginParameters.h:512
GUIPluginConnector(AAX_IEffectParameters *_aaxParameters, PluginCore *_pluginCore)
Definition: AAXPluginParameters.h:591
AAX_IEffectParameters * aaxParameters
the parent object
Definition: AAXPluginParameters.h:800
#define kSynchronizedParameterQueueSize
This is the maximum size of the plugin-core&#39;s parameter list; make sure to adjust itg if your core ne...
Definition: AAXPluginParameters.h:153
virtual AAX_Result UpdateParameterNormalizedValue(AAX_CParamID iParameterID, double iValue, AAX_EUpdateSource iSource)
called when a parameter needs to be updated (aka it is "dirty") as part of the AAX monolithic paramet...
Definition: AAXPluginParameters.cpp:761
virtual bool deRregisterSubcontroller(ICustomView *customViewConnector)
Definition: AAXPluginParameters.h:687
uint32_t controlID
ID value.
Definition: pluginstructures.h:352
static AAX_Result StaticDescribe(AAX_IComponentDescriptor &outDesc)
static describe function that exists as an object member and is part of the monolithic programming pa...
Definition: AAXPluginParameters.cpp:633
static void AAX_CALLBACK StaticRenderAudio(AAXAlgorithm *const inInstancesBegin[], const void *inInstancesEnd)
static callback function that exists as an object member and is part of the monolithic programming pa...
Definition: AAXPluginParameters.cpp:595
void AddSynchronizedParameter(const AAX_IParameter &inParameter)
called to add parameters to the synchronized list; this is only called once during EffectInit( ) as p...
Definition: AAXPluginParameters.cpp:740
void clearCustomViewPtr()
Definition: AAXPluginParameters.h:562
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: AAXPluginParameters.h:706
virtual bool checkNonBoundValueChange(int tag, float normalizedValue)
Definition: AAXPluginParameters.h:788
CustomViewController(ICustomView *_customViewIF)
Definition: AAXPluginParameters.h:531
virtual AAX_Result ResetFieldData(AAX_CFieldIndex inFieldIndex, void *oData, uint32_t iDataSize) const
AAX Override.
Definition: AAXPluginParameters.cpp:795
void updateOutboundAAXParameters()
threadsafe update of outbound parameters (meter variables) for GUI.
Definition: AAXPluginParameters.cpp:921
Structure of data that is passed to GUI object once at creation time.
Definition: AAXPluginParameters.h:78
const AAX_CTypeID GR_MeterID
pro tools gr meter id
Definition: AAXPluginParameters.h:58
void ProcessAudio(AAXAlgorithm *ioRenderInfo, const TParamValPair *inSynchronizedParamValues[], int32_t inNumSynchronizedParamValues)
audio processing function; note that ALL algorithms point to this function so we have to decode chann...
Definition: AAXPluginParameters.cpp:476
virtual unsigned int getEventCount()
Definition: AAXPluginParameters.h:871
uint32_t midiMessage
BYTE message as UINT.
Definition: pluginstructures.h:641
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: AAXPluginParameters.h:734
AAXPluginParameters()
object constructor; this creates the ASPiK core and all of its required interfaces.
Definition: AAXPluginParameters.cpp:75
Custom interface so that GUI can pass information to plugin shell in a thread-safe manner...
Definition: pluginstructures.h:1473
virtual AAX_Result TimerWakeup()
AAX Override.
Definition: AAXPluginParameters.cpp:904
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 updateHostInfo(AAXAlgorithm *ioRenderInfo, HostInfo *hostInfo)
called once per buffer process operation to set the host information structure for the core ...
Definition: AAXPluginParameters.cpp:432
virtual void parameterChanged(int32_t controlID, double actualValue, double)
Definition: AAXPluginParameters.h:607
const AAX_CMidiPacket * ioPacketPtr
array of packets
Definition: AAXPluginParameters.h:903
virtual void endParameterChangeGesture(int controlTag)
Definition: AAXPluginParameters.h:648
Definition: pluginstructures.h:485
AAXMIDIEventQueue(PluginCore *_pluginCore)
Definition: AAXPluginParameters.h:853
Double buffered queue for MIDI messages.
Definition: pluginstructures.h:1561
Processing structure; this is described in detail in Designing Audio Effects in C++ 2nd Ed...
Definition: AAXPluginParameters.h:116
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
virtual void setNormalizedPluginParameter(int32_t controlID, double value)
Definition: AAXPluginParameters.h:628
std::map< std::string, CustomViewController * > customViewControllerMap
map of custom view controllers
Definition: AAXPluginParameters.h:804
const AAX_CTypeID PLUGIN_CUSTOMDATA_ID
custom data parameter number (we only need one)
Definition: AAXPluginParameters.h:55
Back-pointer to the parameters; this is described in detail in Designing Audio Effects in C++ 2nd Ed...
Definition: AAXPluginParameters.h:97
virtual double getNormalizedPluginParameter(int32_t controlID)
Definition: AAXPluginParameters.h:614
virtual AAX_Result EffectInit()
AAX Override.
Definition: AAXPluginParameters.cpp:185
virtual AAX_Result GenerateCoefficients()
AAX Override.
Definition: AAXPluginParameters.cpp:694
void * inMessageData
incoming message data (interpretation depends on message)
Definition: pluginstructures.h:733
The AAXMIDIEventQueue interface queues incoming MIDI messages and blasts them out during the buffer p...
Definition: AAXPluginParameters.h:849
std::vector< GUIParameter > guiParameters
list of updates
Definition: pluginstructures.h:461
virtual bool registerSubcontroller(std::string subcontrollerName, ICustomView *customViewConnector)
Definition: AAXPluginParameters.h:659
uint32_t midiData2
BYTE data 2 as UINT.
Definition: pluginstructures.h:644
void setCustomViewPtr(ICustomView *_customViewIF)
Definition: AAXPluginParameters.h:556
CustomViewController * getCustomSubController(ICustomView *customViewConnector)
Definition: AAXPluginParameters.h:821
virtual bool guiDidOpen()
Definition: AAXPluginParameters.h:754
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: AAXPluginParameters.h:594
virtual void sendMessage(void *data)
Definition: pluginstructures.h:1416
virtual AAX_Result GetCustomData(AAX_CTypeID iDataBlockID, uint32_t iDataSize, void *oData, uint32_t *oDataWritten) const
note the data that is transferred to GUI; the core is ONLY used for initialization and then it is unu...
Definition: AAXPluginParameters.cpp:159
Information that defines a single GUI parameter&#39;s possible values and ID.
Definition: pluginstructures.h:331
virtual bool fireMidiEvents(unsigned int sampleOffset)
Definition: AAXPluginParameters.h:877
interface file for ASPiK custom control objects (knobs, buttons, meters, etc...)
PluginCore * pluginCore
core
Definition: AAXPluginParameters.h:902
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
virtual void updateView()=0
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
static AAX_CEffectParameters *AAX_CALLBACK Create()
creation mechanism for this object
Definition: AAXPluginParameters.cpp:59
virtual void sendHostMessage(const HostMessageInfo &hostMessageInfo)
process a message; by default it processes sendGUIUpdate to safely send a parameter change event but ...
Definition: AAXPluginParameters.h:478
virtual void beginParameterChangeGesture(int controlTag)
Definition: AAXPluginParameters.h:637
const ICustomView * getCustomViewPtr()
Definition: AAXPluginParameters.h:559
customViewControllerMap customSubControllerMap
map of custom sub-controllers
Definition: AAXPluginParameters.h:819
virtual void pushDataValue(double data)
Definition: pluginstructures.h:1406
const unsigned int meterTapCount
number of gr meters (we&#39;ve only ever seen one on any AVID surface/SW)
Definition: AAXPluginParameters.h:59
virtual void sendMessage(void *data)
Definition: AAXPluginParameters.h:549
virtual bool guiTimerPing()
Definition: AAXPluginParameters.h:780
virtual ~AAXPluginParameters()
object destructor; this destroys the ASPiK core and all of its required interfaces.
Definition: AAXPluginParameters.cpp:138
Information about a MIDI event.
Definition: pluginstructures.h:561