Parameter

Plugin parameter. Implement the Observer pattern for UI support. Note: Recursive mutexes are needed here because getNormalized() could need locking an already taken mutex.

Listener patter: Every Parameter maintain a list of IParameterListener. This is typically used by UI elements to update with parameters changes from all kinds of sources (UI itself, host automation...). But they are not necessarily UI elements.

FUTURE: easier to make widget if every Parameter has a setFromGUINormalized call.

Constructors

this
this(int index, string name, string label)
Undocumented in source.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

addListener
void addListener(IParameterListener listener)

Adds a parameter listener.

beginParamEdit
void beginParamEdit()

Warns the host that a parameter will be edited. Should only ever be called from the UI thread.

beginParamHover
void beginParamHover()

Warns the listeners that a parameter is being hovered in the UI. Should only ever be called from the UI thread.

checkBeingEdited
void checkBeingEdited()
Undocumented in source. Be warned that the author may not have intended to support it.
endParamEdit
void endParamEdit()

Warns the host that a parameter has finished being edited. Should only ever be called from the UI thread.

endParamHover
void endParamHover()

Warns the listeners that a parameter has finished being hovered in the UI. Should only ever be called from the UI thread. This doesn't communicate anything to the host.

getForHost
double getForHost()
getNormalized
double getNormalized()
getNormalizedDefault
double getNormalizedDefault()
index
int index()
isAutomatable
bool isAutomatable()
isDiscrete
bool isDiscrete()
isEdited
bool isEdited()
Undocumented in source. Be warned that the author may not have intended to support it.
label
string label()
name
string name()
nonAutomatable
Parameter nonAutomatable()

Makes parameter non-automatable.

normalizedValueFromString
bool normalizedValueFromString(const(char)[] valueString, double result)
notifyListeners
void notifyListeners()
Undocumented in source. Be warned that the author may not have intended to support it.
removeListener
void removeListener(IParameterListener listener)

Removes a parameter listener.

setClientReference
void setClientReference(Client client)

Parameters are owned by a client, this is used to make them refer back to it.

setFromHost
void setFromHost(double hostValue)

From a normalized double [0..1], set the parameter value. This is a Dplug internal call, not for plug-in code.

setNormalized
void setNormalized(double hostValue)

From a normalized double, set the parameter value. No guarantee at all that getNormalized will return the same, because this value is rounded to fit.

stringFromNormalizedValue
void stringFromNormalizedValue(double normalizedValue, char* buffer, size_t len)
toDisplayN
void toDisplayN(char* buffer, size_t numBytes)

Output a string representation of a Parameter.

toLabelN
void toLabelN(char* p, int bufLength)

Output label as a zero-terminated C string, truncate if needed.

toNameN
void toNameN(char* p, int bufLength)

Output name as a zero-terminated C string, truncate if needed.

toStringN
void toStringN(char* buffer, size_t numBytes)

Display parameter (without label). This always adds a terminal zero within numBytes.

Meta