AAX SDK  2.4.1
Avid Audio Extensions Development Kit
AAX_CEffectParameters.h
Go to the documentation of this file.
1 /*================================================================================================*/
2 /*
3  *
4  * Copyright 2013-2017, 2019 by Avid Technology, Inc.
5  * All rights reserved.
6  *
7  * CONFIDENTIAL: This document contains confidential information. Do not
8  * read or examine this document unless you are an Avid Technology employee
9  * or have signed a non-disclosure agreement with Avid Technology which protects
10  * the confidentiality of this document. DO NOT DISCLOSE ANY INFORMATION
11  * CONTAINED IN THIS DOCUMENT TO ANY THIRD-PARTY WITHOUT THE PRIOR WRITTEN CONSENT
12  * OF Avid Technology, INC.
13  *
14  */
15 
22 /*================================================================================================*/
23 
24 
25 #ifndef AAX_CEFFECTPARAMETERS_H
26 #define AAX_CEFFECTPARAMETERS_H
27 
28 #include "AAX_IEffectParameters.h"
29 #include "AAX_IPageTable.h"
30 #include "AAX_CString.h"
31 #include "AAX_CChunkDataParser.h"
32 #include "AAX_CParameterManager.h"
33 #include "AAX_CPacketDispatcher.h"
34 
35 #include <set>
36 #include <string>
37 #include <vector>
38 
39 class AAX_IController;
43 class AAX_ITransport;
44 
47 
66 {
67 public:
71 
72 public:
85 
89  AAX_Result NotificationReceived( /* AAX_ENotificationEvent */ AAX_CTypeID inNotificationType, const void * inNotificationData, uint32_t inNotificationDataSize) AAX_OVERRIDE;
91 
100  AAX_Result GetNumberOfParameters (int32_t * oNumControls) const AAX_OVERRIDE;
103  AAX_Result GetParameterNumberOfSteps (AAX_CParamID iParameterID, int32_t * oNumSteps ) const AAX_OVERRIDE;
105  AAX_Result GetParameterNameOfLength (AAX_CParamID iParameterID, AAX_IString * oName, int32_t iNameLength ) const AAX_OVERRIDE;
108  AAX_Result GetParameterType (AAX_CParamID iParameterID, AAX_EParameterType * oParameterType ) const AAX_OVERRIDE;
111  AAX_Result GetParameterIndex (AAX_CParamID iParameterID, int32_t * oControlIndex ) const AAX_OVERRIDE;
112  AAX_Result GetParameterIDFromIndex (int32_t iControlIndex, AAX_IString * oParameterIDString ) const AAX_OVERRIDE;
113  AAX_Result GetParameterValueInfo ( AAX_CParamID iParameterID, int32_t iSelector, int32_t* oValue) const AAX_OVERRIDE;
115 
124  AAX_Result GetParameterValueFromString (AAX_CParamID iParameterID, double * oValue, const AAX_IString & iValueString ) const AAX_OVERRIDE;
125  AAX_Result GetParameterStringFromValue (AAX_CParamID iParameterID, double iValue, AAX_IString * oValueString, int32_t iMaxLength ) const AAX_OVERRIDE;
126  AAX_Result GetParameterValueString (AAX_CParamID iParameterID, AAX_IString * oValueString, int32_t iMaxLength) const AAX_OVERRIDE;
127  AAX_Result GetParameterNormalizedValue (AAX_CParamID iParameterID, double * oValuePtr ) const AAX_OVERRIDE;
131 
146 
168 
172  AAX_Result ResetFieldData (AAX_CFieldIndex inFieldIndex, void * oData, uint32_t inDataSize) const AAX_OVERRIDE;
174 
193  AAX_Result GetNumberOfChunks (int32_t * oNumChunks ) const AAX_OVERRIDE;
194  AAX_Result GetChunkIDFromIndex (int32_t iIndex, AAX_CTypeID * oChunkID ) const AAX_OVERRIDE;
195  AAX_Result GetChunkSize (AAX_CTypeID iChunkID, uint32_t * oSize ) const AAX_OVERRIDE;
199  AAX_Result GetNumberOfChanges (int32_t * oNumChanges ) const AAX_OVERRIDE;
201 
208 
213  AAX_Result GetCurveData( /* AAX_ECurveType */ AAX_CTypeID iCurveType, const float * iValues, uint32_t iNumValues, float * oValues ) const AAX_OVERRIDE;
214  AAX_Result GetCurveDataMeterIds( /* AAX_ECurveType */ AAX_CTypeID iCurveType, uint32_t *oXMeterId, uint32_t *oYMeterId) const AAX_OVERRIDE;
215  AAX_Result GetCurveDataDisplayRange( /* AAX_ECurveType */ AAX_CTypeID iCurveType, float *oXMin, float *oXMax, float *oYMin, float *oYMax ) const AAX_OVERRIDE;
216 
223  AAX_Result UpdatePageTable(uint32_t inTableType, int32_t inTablePageSize, IACFUnknown* iHostUnknown, IACFUnknown* ioPageTableUnknown) const AAX_OVERRIDE AAX_FINAL;
225 
236  AAX_Result GetCustomData( AAX_CTypeID iDataBlockID, uint32_t inDataSize, void* oData, uint32_t* oDataWritten) const AAX_OVERRIDE;
237  AAX_Result SetCustomData( AAX_CTypeID iDataBlockID, uint32_t inDataSize, const void* iData ) AAX_OVERRIDE;
239 
248 
255 
256 
257 
258 public:
264  const AAX_IController* Controller() const;
266  const AAX_ITransport* Transport() const;
270 
271 protected:
276  AAX_Result SetTaperDelegate ( AAX_CParamID iParameterID, AAX_ITaperDelegateBase & iTaperDelegate, bool iPreserveValue );
278  bool IsParameterTouched ( AAX_CParamID iParameterID ) const;
279  bool IsParameterLinkReady ( AAX_CParamID inParameterID, AAX_EUpdateSource inSource ) const;
281 
301  virtual AAX_Result EffectInit(void) { return AAX_SUCCESS; };
302 
315  virtual AAX_Result UpdatePageTable(uint32_t /*inTableType*/, int32_t /*inTablePageSize*/, AAX_IPageTable& /*ioPageTable*/) const { return AAX_ERROR_UNIMPLEMENTED; }
316 
329 
333  void BuildChunkData (void) const;
334 
335 protected:
337  mutable int32_t mChunkSize; //this old behavior isn't const friendly yet. Consider this a temp variable.
338  mutable AAX_CChunkDataParser mChunkParser; //this old behavior isn't const friendly yet. Consider this a temp variable.
342  std::set<std::string> mFilteredParameters;
343 
344 private:
345  // interfaces provided by the host via the IACFUnknown passed to Initialize()
346  AAX_IController* mController;
347  AAX_ITransport* mTransport;
348  AAX_IAutomationDelegate* mAutomationDelegate;
349 
350 };
351 
352 // Convenience functions since many legacy plug-ins had internal int32 value representations.
353 extern int32_t NormalizedToInt32 (double normalizedValue );
354 extern double Int32ToNormalized (int32_t value );
355 extern double BoolToNormalized (bool value );
356 
357 #endif
const char * AAX_CParamID
Parameter identifier.
Definition: AAX.h:352
int32_t AAX_Result
Definition: AAX.h:337
uint8_t AAX_CBoolean
Cross-compiler boolean type used by AAX interfaces.
Definition: AAX.h:329
#define AAX_FINAL
final keyword macro
Definition: AAX.h:142
#define AAX_OVERRIDE
override keyword macro
Definition: AAX.h:141
uint32_t AAX_CTypeID
Matches type of OSType used in classic plugins.
Definition: AAX.h:336
AAX_CIndex AAX_CFieldIndex
Not used by AAX plug-ins (except in AAX_FIELD_INDEX macro)
Definition: AAX.h:349
Parser utility for plugin chunks.
int32_t NormalizedToInt32(double normalizedValue)
AAX_CParamID cPreviewID
Definition: AAX_CEffectParameters.h:43
AAX_CParamID cDefaultMasterBypassID
Definition: AAX_CEffectParameters.h:46
double BoolToNormalized(bool value)
double Int32ToNormalized(int32_t value)
Helper classes related to posting AAX packets and handling parameter update events.
A container object for plug-in parameters.
A generic AAX string class with similar functionality to std::string.
AAX_EUpdateSource
Source for values passed into UpdateParameterNormalizedValue().
Definition: AAX_Enums.h:1028
AAX_EParameterType
FIC stuff that I can't include without DAE library dependence.
Definition: AAX_Enums.h:833
int32_t AAX_EParameterOrientation
Typedef for a bitfield of AAX_EParameterOrientationBits values.
Definition: AAX_Enums.h:866
@ AAX_ERROR_UNIMPLEMENTED
Definition: AAX_Errors.h:49
@ AAX_SUCCESS
Definition: AAX_Errors.h:39
The interface for an AAX Plug-in's data model.
COM compatible IUnknown C++ interface.
Definition: AAX_ACFInterface.doxygen:248
Plug-in chunk header + data.
Definition: AAX.h:537
Packet structure for MIDI data.
Definition: AAX.h:637
Parser utility for plugin chunks.
Definition: AAX_CChunkDataParser.h:118
Default implementation of the AAX_IEffectParameters interface.
Definition: AAX_CEffectParameters.h:66
AAX_Result UpdateParameterTouch(AAX_CParamID iParameterID, AAX_CBoolean iTouchState) AAX_OVERRIDE
Sets a "touched" state on a parameter.
void FilterParameterIDOnSave(AAX_CParamID controlID)
CALL: Indicates the indices of parameters that should not be saved in the default AAX_CEffectParamete...
AAX_Result TouchParameter(AAX_CParamID iParameterID) AAX_OVERRIDE
"Touches" (locks) a parameter in the automation system to a particular control in preparation for upd...
AAX_Result GetParameterValueInfo(AAX_CParamID iParameterID, int32_t iSelector, int32_t *oValue) const AAX_OVERRIDE
CALL: Retrieves a property of a parameter.
AAX_Result ResetFieldData(AAX_CFieldIndex inFieldIndex, void *oData, uint32_t inDataSize) const AAX_OVERRIDE
Called by the host to reset a private data field in the plug-in's algorithm.
AAX_Result GetParameter(AAX_CParamID iParameterID, AAX_IParameter **oParameter) AAX_OVERRIDE
CALL: Retrieves an arbitrary setting within a parameter.
void BuildChunkData(void) const
Clears out the current chunk in Chunk Parser and adds all of the new values. Used by default implemen...
AAX_Result GetNumberOfChunks(int32_t *oNumChunks) const AAX_OVERRIDE
Retrieves the number of chunks used by this plug-in.
int32_t mNumPlugInChanges
Definition: AAX_CEffectParameters.h:336
AAX_CPacketDispatcher mPacketDispatcher
Definition: AAX_CEffectParameters.h:340
AAX_Result SetParameterNormalizedRelative(AAX_CParamID iParameterID, double iValue) AAX_OVERRIDE
CALL: Sets the specified parameter to a new value relative to its current value.
AAX_Result Initialize(IACFUnknown *iController) AAX_OVERRIDE
Main data model initialization. Called when plug-in instance is first instantiated.
AAX_Result GetCurveData(AAX_CTypeID iCurveType, const float *iValues, uint32_t iNumValues, float *oValues) const AAX_OVERRIDE
Generate a set of output values based on a set of given input values.
AAX_Result SetCustomData(AAX_CTypeID iDataBlockID, uint32_t inDataSize, const void *iData) AAX_OVERRIDE
An optional interface hook for setting custom data for use by another module.
AAX_IController * Controller()
Access to the Effect controller.
AAX_Result GenerateCoefficients(void) AAX_OVERRIDE
Generates and dispatches new coefficient packets.
AAX_Result RenderAudio_Hybrid(AAX_SHybridRenderInfo *ioRenderInfo) AAX_OVERRIDE
Hybrid audio render function.
virtual AAX_Result EffectInit(void)
Initialization helper routine. Called from AAX_CEffectParameters::Initialize.
Definition: AAX_CEffectParameters.h:301
std::set< std::string > mFilteredParameters
Definition: AAX_CEffectParameters.h:342
AAX_Result SetTaperDelegate(AAX_CParamID iParameterID, AAX_ITaperDelegateBase &iTaperDelegate, bool iPreserveValue)
const AAX_IController * Controller() const
const access to the Effect controller
AAX_Result ReleaseParameter(AAX_CParamID iParameterID) AAX_OVERRIDE
Releases a parameter from a "touched" state.
AAX_Result GetParameterNumberOfSteps(AAX_CParamID iParameterID, int32_t *oNumSteps) const AAX_OVERRIDE
CALL: Retrieves the number of discrete steps for a parameter.
AAX_Result GetChunkIDFromIndex(int32_t iIndex, AAX_CTypeID *oChunkID) const AAX_OVERRIDE
Retrieves the ID associated with a chunk index.
AAX_Result GetParameterStringFromValue(AAX_CParamID iParameterID, double iValue, AAX_IString *oValueString, int32_t iMaxLength) const AAX_OVERRIDE
CALL: Converts a normalized parameter value into a string representing its corresponding real value.
AAX_Result TimerWakeup() AAX_OVERRIDE
Periodic wakeup callback for idle-time operations.
AAX_Result CompareActiveChunk(const AAX_SPlugInChunk *iChunkP, AAX_CBoolean *oIsEqual) const AAX_OVERRIDE
Determine if a chunk represents settings that are equivalent to the plug-in's current state.
AAX_Result GetParameterIDFromIndex(int32_t iControlIndex, AAX_IString *oParameterIDString) const AAX_OVERRIDE
CALL: Retrieves the ID of a parameter.
const AAX_IAutomationDelegate * AutomationDelegate() const
const access to the Effect's automation delegate
AAX_Result GetParameterValueString(AAX_CParamID iParameterID, AAX_IString *oValueString, int32_t iMaxLength) const AAX_OVERRIDE
CALL: Retrieves the value string associated with a parameter's current value.
AAX_Result UpdatePageTable(uint32_t inTableType, int32_t inTablePageSize, IACFUnknown *iHostUnknown, IACFUnknown *ioPageTableUnknown) const AAX_OVERRIDE AAX_FINAL
Allow the plug-in to update its page tables.
AAX_CChunkDataParser mChunkParser
Definition: AAX_CEffectParameters.h:338
AAX_Result GetParameterIndex(AAX_CParamID iParameterID, int32_t *oControlIndex) const AAX_OVERRIDE
CALL: Retrieves the index of a parameter.
virtual AAX_Result UpdatePageTable(uint32_t, int32_t, AAX_IPageTable &) const
Definition: AAX_CEffectParameters.h:315
bool IsParameterTouched(AAX_CParamID iParameterID) const
AAX_Result GetParameterIsAutomatable(AAX_CParamID iParameterID, AAX_CBoolean *oAutomatable) const AAX_OVERRIDE
CALL: Retrieves information about a parameter's automatable status.
int32_t mChunkSize
Definition: AAX_CEffectParameters.h:337
AAX_Result GetParameterOrientation(AAX_CParamID iParameterID, AAX_EParameterOrientation *oParameterOrientation) const AAX_OVERRIDE
CALL: Retrieves the orientation that should be applied to a parameter's controls.
AAX_Result SetParameterNormalizedValue(AAX_CParamID iParameterID, double iValue) AAX_OVERRIDE
CALL: Sets the specified parameter to a new value.
AAX_Result GetParameterType(AAX_CParamID iParameterID, AAX_EParameterType *oParameterType) const AAX_OVERRIDE
CALL: Retrieves the type of a parameter.
AAX_Result SetChunk(AAX_CTypeID iChunkID, const AAX_SPlugInChunk *iChunk) AAX_OVERRIDE
Restores a set of plug-in parameters based on chunk information.
AAX_Result GetNumberOfChanges(int32_t *oNumChanges) const AAX_OVERRIDE
Retrieves the number of parameter changes made since the plug-in's creation.
~AAX_CEffectParameters(void) AAX_OVERRIDE
AAX_Result UpdateParameterNormalizedRelative(AAX_CParamID iParameterID, double iValue) AAX_OVERRIDE
Updates a single parameter's state to its current value, as a difference with the parameter's previou...
AAX_Result UpdateMIDINodes(AAX_CFieldIndex inFieldIndex, AAX_CMidiPacket &iPacket) AAX_OVERRIDE
MIDI update callback.
AAX_Result GetChunkSize(AAX_CTypeID iChunkID, uint32_t *oSize) const AAX_OVERRIDE
Get the size of the data structure that can hold all of a chunk's information.
AAX_Result SetParameterDefaultNormalizedValue(AAX_CParamID iParameterID, double iValue) AAX_OVERRIDE
CALL: Sets the default value of a parameter.
AAX_Result GetNumberOfParameters(int32_t *oNumControls) const AAX_OVERRIDE
CALL: Retrieves the total number of plug-in parameters.
AAX_IAutomationDelegate * AutomationDelegate()
Access to the Effect's automation delegate.
const AAX_ITransport * Transport() const
const access to the Transport object
AAX_Result UpdateControlMIDINodes(AAX_CTypeID nodeID, AAX_CMidiPacket &iPacket) AAX_OVERRIDE
MIDI update callback for control MIDI nodes.
AAX_Result Uninitialize(void) AAX_OVERRIDE
Main data model uninitialization.
AAX_Result SetDisplayDelegate(AAX_CParamID iParameterID, AAX_IDisplayDelegateBase &iDisplayDelegate)
int32_t mNumChunkedParameters
Definition: AAX_CEffectParameters.h:339
bool IsParameterLinkReady(AAX_CParamID inParameterID, AAX_EUpdateSource inSource) const
AAX_Result DoMIDITransfers() AAX_OVERRIDE
MIDI update callback.
Definition: AAX_CEffectParameters.h:244
AAX_Result GetParameterNormalizedValue(AAX_CParamID iParameterID, double *oValuePtr) const AAX_OVERRIDE
CALL: Retrieves a parameter's current value.
AAX_Result GetParameterDefaultNormalizedValue(AAX_CParamID iParameterID, double *oValue) const AAX_OVERRIDE
CALL: Retrieves default value of a parameter.
AAX_CEffectParameters & operator=(const AAX_CEffectParameters &other)
AAX_Result GetChunk(AAX_CTypeID iChunkID, AAX_SPlugInChunk *oChunk) const AAX_OVERRIDE
Fills a block of data with chunk information representing the plug-in's current state.
AAX_Result UpdateParameterNormalizedValue(AAX_CParamID iParameterID, double iValue, AAX_EUpdateSource iSource) AAX_OVERRIDE
Updates a single parameter's state to its current value.
AAX_ITransport * Transport()
Access to the Transport object.
AAX_Result GetParameterNameOfLength(AAX_CParamID iParameterID, AAX_IString *oName, int32_t iNameLength) const AAX_OVERRIDE
CALL: Retrieves an abbreviated name for a parameter.
AAX_Result NotificationReceived(AAX_CTypeID inNotificationType, const void *inNotificationData, uint32_t inNotificationDataSize) AAX_OVERRIDE
Notification Hook.
AAX_Result GetParameterValueFromString(AAX_CParamID iParameterID, double *oValue, const AAX_IString &iValueString) const AAX_OVERRIDE
CALL: Converts a value string to a value.
AAX_Result GetCurveDataDisplayRange(AAX_CTypeID iCurveType, float *oXMin, float *oXMax, float *oYMin, float *oYMax) const AAX_OVERRIDE
Determines the range of the graph shown by the plug-in.
AAX_Result GetParameterName(AAX_CParamID iParameterID, AAX_IString *oName) const AAX_OVERRIDE
CALL: Retrieves the full name for a parameter.
AAX_Result GetCurveDataMeterIds(AAX_CTypeID iCurveType, uint32_t *oXMeterId, uint32_t *oYMeterId) const AAX_OVERRIDE
Indicates which meters correspond to the X and Y axes of the EQ or Dynamics graph.
AAX_CParameterManager mParameterManager
Definition: AAX_CEffectParameters.h:341
AAX_Result GetCustomData(AAX_CTypeID iDataBlockID, uint32_t inDataSize, void *oData, uint32_t *oDataWritten) const AAX_OVERRIDE
An optional interface hook for getting custom data from another module.
AAX_Result GetMasterBypassParameter(AAX_IString *oIDString) const AAX_OVERRIDE
CALL: Retrieves the ID of the plug-in's Master Bypass parameter.
Helper class for managing AAX packet posting.
Definition: AAX_CPacketDispatcher.h:153
A container object for plug-in parameters.
Definition: AAX_CParameterManager.h:52
Hybrid render processing context.
Definition: AAX_IACFEffectParameters.h:878
Interface allowing an AAX plug-in to interact with the host's event system.
Definition: AAX_IAutomationDelegate.h:47
Interface for the AAX host's view of a single instance of an effect. Used by both clients of the AAX ...
Definition: AAX_IController.h:44
Defines the display behavior for a parameter.
Definition: AAX_IDisplayDelegate.h:53
The interface for an AAX Plug-in's data model.
Definition: AAX_IEffectParameters.h:83
Interface to the host's representation of a plug-in instance's page table.
Definition: AAX_IPageTable.h:28
The base interface for all normalizable plug-in parameters.
Definition: AAX_IParameter.h:140
A simple string container that can be passed across a binary boundary. This class,...
Definition: AAX_IString.h:41
Defines the taper conversion behavior for a parameter.
Definition: AAX_ITaperDelegate.h:73
Interface to information about the host's transport state.
Definition: AAX_ITransport.h:45