SynthLab SDK
DynamicStringManager Class Reference

Dynamic string manager - this object connects plugin parameters and their GUI controls with new or different sets of strings to display. More...

#include <synthlabds.h>

Public Member Functions

 DynamicStringManager (std::shared_ptr< SynthLab::SynthEngine > _synthEngine, void *_pluginCore)
 Constructs the manager object; the manager needs access to the synth engine to query it for custom GUI strings and labels. It needs a pointer to the plugincore in order to connect the engine's custom strings to the plugin parameters, which ultimately represent the GUI controls. More...
 
std::vector< std::string > getModuleCoreNames (uint32_t moduleType)
 This demonstrates how to get the module core names from the engine. More...
 
void clearCustomViewInfo ()
 simple clearing of data
 
bool setCustomUpdateCodes (uint32_t customUpdateCode_1, uint32_t customUpdateCode_2)
 Functions for dealing with a custom update code uint32_t where each bit encodes a particular GUI control that needs updating. More...
 
bool isCustomViewDataQueueEnabled () const
 set atomic variable with float
 
void enableCustomViewDataQueue (bool value)
 get atomic variable as float
 
bool haveCustomUpdates () const
 set atomic variable with float
 
void enableCustomUpdates (bool value)
 get atomic variable as float
 
bool updateCustomView (uint32_t slot)
 Sets information about the custom view including the strings for the controls. More...
 
bool setModKnobLabelView (uint32_t controlID, ICustomView *modKnobLabelControl, bool isRAFXView)
 Adds a custom view interface pointer to the list of custom controls for mod knob labels. More...
 
bool setCustomDroplistView (uint32_t controlID, ICustomView *_droplistControl, bool isRAFXView, bool isCoreList)
 Adds a custom view interface pointer to the list of custom controls for drop-lists or list controls. More...
 

Protected Member Functions

int32_t customUpdateCodeToIndex (uint32_t code, uint32_t mask, bool upper32)
 Converts a custom update code (bits in a uint32_t) into an index for the custom view information array. More...
 
int32_t customUpdateMaskToIndex (uint32_t mask, bool upper32)
 Converts a custom update mask (bits in a uint32_t) into an index for the custom view information array. More...
 
void enqueueCustomData (uint32_t index)
 Queues up GUI dynamic strings for reloading into the GUI. The operation is asynchronous thus the queue. For ASPiK, this update occurs on the next GUI timer ping. See your plugin framework for non ASPiK implementations. More...
 
bool getWaveformStrings (uint32_t index, std::vector< std::string > &strings)
 De-queue the lists to see if there are waveform strings for a GUI control. More...
 
bool getModKnobLabel (uint32_t slot, uint32_t index, std::string &string)
 De-queue the lists to see if there are mod knob labels for a GUI control. More...
 

Protected Attributes

std::shared_ptr< SynthLab::SynthEnginesynthEngine = nullptr
 
void * pluginCore = nullptr
 
uint32_t customUpdateCode_1 = 0.0
 
CustomViewInfo customViewInfo [TOTAL_CUSTOM_VIEWS]
 one slot per bit * 2 because MSB sets more stuff
 
std::atomic< bool > queueEnabler
 atomic bool for enabling/disabling the queue
 
std::atomic< bool > updateEnabler
 atomic bool for enabling/disabling the queue
 

Detailed Description

Dynamic string manager - this object connects plugin parameters and their GUI controls with new or different sets of strings to display.

  • This is not part of SynthLab. It is only for ASPiK and RAFX integration and can be ignored for any other framework, or can be used to demonstrate how to maintain these controls.
Author
Will Pirkle http://www.willpirkle.com
Remarks
This object is included and described in further detail in Designing Software Synthesizer Plugins in C++ 2nd Ed. by Will Pirkle
Version
Revision : 1.0
Date
Date : 2021 / 04 / 26

Constructor & Destructor Documentation

◆ DynamicStringManager()

DynamicStringManager::DynamicStringManager ( std::shared_ptr< SynthLab::SynthEngine _synthEngine,
void *  _pluginCore 
)

Constructs the manager object; the manager needs access to the synth engine to query it for custom GUI strings and labels. It needs a pointer to the plugincore in order to connect the engine's custom strings to the plugin parameters, which ultimately represent the GUI controls.

Specialized string management constructor

  • This is not part of SynthLab. It is only for ASPiK and RAFX integration and can be ignored for any other framework.
Parameters
_synthEngineshared pointer to the engine
_pluginCorecloaked void* (to avoid cyclic #includes)

Member Function Documentation

◆ customUpdateCodeToIndex()

int32_t DynamicStringManager::customUpdateCodeToIndex ( uint32_t  code,
uint32_t  mask,
bool  upper32 
)
inlineprotected

Converts a custom update code (bits in a uint32_t) into an index for the custom view information array.

Parameters
codethe 32-bit custom update code
maska mask containing the bit that is being indexed
upper32set to TRUE to query for mod knobs, FALSE to query for module strings

◆ customUpdateMaskToIndex()

int32_t DynamicStringManager::customUpdateMaskToIndex ( uint32_t  mask,
bool  upper32 
)
inlineprotected

Converts a custom update mask (bits in a uint32_t) into an index for the custom view information array.

Parameters
maska mask containing the bit that is being indexed
upper32set to TRUE to query for mod knobs, FALSE to query for module strings

◆ enqueueCustomData()

void DynamicStringManager::enqueueCustomData ( uint32_t  index)
inlineprotected

Queues up GUI dynamic strings for reloading into the GUI. The operation is asynchronous thus the queue. For ASPiK, this update occurs on the next GUI timer ping. See your plugin framework for non ASPiK implementations.

  • demonstrates how to ask the engine for a particular set of module strings
  • demonstrates how to use a lock free ring buffer to enqueue the information
Parameters
indexthe location (slot) in the custom view array

◆ getModKnobLabel()

bool DynamicStringManager::getModKnobLabel ( uint32_t  slot,
uint32_t  index,
std::string &  string 
)
inlineprotected

De-queue the lists to see if there are mod knob labels for a GUI control.

  • demonstrates how to use a lock free ring buffer to dequeue the information
Parameters
indexthe location (slot) in the custom view array

◆ getModuleCoreNames()

std::vector<std::string> DynamicStringManager::getModuleCoreNames ( uint32_t  moduleType)
inline

This demonstrates how to get the module core names from the engine.

  • for ASPiK plugins, this is called at startup and when the user changes cores
Parameters
moduleTypethe kind of module to get core names for; see synthconstants.h
Returns
a vector of the core names; there will be four (4) of them and they may be empty strings or "-----"

◆ getWaveformStrings()

bool DynamicStringManager::getWaveformStrings ( uint32_t  index,
std::vector< std::string > &  strings 
)
inlineprotected

De-queue the lists to see if there are waveform strings for a GUI control.

  • demonstrates how to use a lock free ring buffer to dequeue the information
Parameters
indexthe location (slot) in the custom view array

◆ setCustomDroplistView()

bool DynamicStringManager::setCustomDroplistView ( uint32_t  controlID,
ICustomView *  _droplistControl,
bool  isRAFXView,
bool  isCoreList 
)

Adds a custom view interface pointer to the list of custom controls for drop-lists or list controls.

  • This is not part of SynthLab. It is only for ASPiK and RAFX integration and can be ignored for any other framework.
Parameters
controlIDthe ID of the parameter connected to the GUI control
_droplistControla custom view interface pointer (in ASPiK, once registered, a custom view pointer will NEVER go out of scope and can be safely used at anytime prior to termination.
isRAFXViewthis is true only for the RackAFX prototyping panel
isCoreListtrue if this custom control holds a list of four (4) cores

◆ setCustomUpdateCodes()

bool DynamicStringManager::setCustomUpdateCodes ( uint32_t  customUpdateCode_1,
uint32_t  customUpdateCode_2 
)

Functions for dealing with a custom update code uint32_t where each bit encodes a particular GUI control that needs updating.

Store the two custom update code values, uin32_t variables where each bit encodes a type of control.

  • This is not part of SynthLab. It is only for ASPiK and RAFX integration and can be ignored for any other framework.
Parameters
customUpdateCode_1the uint32_t custom code for drop-lists (core names and module strings)
customUpdateCode_2the uint32_t custom code for mod-knobs
Returns
true if sucessful, false otherwise

◆ setModKnobLabelView()

bool DynamicStringManager::setModKnobLabelView ( uint32_t  controlID,
ICustomView *  modKnobLabelControl,
bool  isRAFXView 
)

Adds a custom view interface pointer to the list of custom controls for mod knob labels.

  • This is not part of SynthLab. It is only for ASPiK and RAFX integration and can be ignored for any other framework.
Parameters
controlIDthe ID of the parameter connected to the GUI control
modKnobLabelControla custom view interface pointer(in ASPiK, once registered, a custom view pointer will NEVER go out of scope and can be safely used at anytime prior to termination.
isRAFXViewthis is true only for the RackAFX prototyping panel
isCoreListtrue if this custom control holds a list of four(4) cores
Returns
true if sucessful, false otherwise

◆ updateCustomView()

bool DynamicStringManager::updateCustomView ( uint32_t  slot)

Sets information about the custom view including the strings for the controls.

  • This is not part of SynthLab. It is only for ASPiK and RAFX integration and can be ignored for any other framework.
Parameters
slotlocation within the custom view array
Returns
true if sucessful, false otherwise

The documentation for this class was generated from the following files: