struct CCL::IParameter
Overview
A parameter object is the link between application logic (controller) and GUI widgets. More…
#include <iparameter.h> struct IParameter: public CCL::IUnknown { // enums enum Flags; enum Type; // methods virtual StringID CCL_API getName () const = 0; virtual void CCL_API setName (StringID name) = 0; virtual tbool CCL_API isEnabled () const = 0; virtual void CCL_API enable (tbool state) = 0; virtual tbool CCL_API getState (int mask) const = 0; virtual void CCL_API setState (int mask, tbool state) = 0; virtual int CCL_API getVisualState () const = 0; virtual void CCL_API setVisualState (int state) = 0; virtual void CCL_API connect (IParamObserver* controller, int tag) = 0; virtual int CCL_API getTag () const = 0; virtual IUnknown*CCL_API getController () const = 0; virtual void CCL_API performUpdate () = 0; virtual void CCL_API beginEdit () = 0; virtual void CCL_API endEdit () = 0; virtual IParameter*CCL_API getOriginal () = 0; virtual IUnknown*CCL_API createIdentity () = 0; virtual Variant CCL_API getValue () const = 0; virtual void CCL_API setValue (VariantRef value, tbool update = false) = 0; virtual Variant CCL_API getMin () const = 0; virtual Variant CCL_API getMax () const = 0; virtual void CCL_API setMin (VariantRef min) = 0; virtual void CCL_API setMax (VariantRef max) = 0; virtual Variant CCL_API getDefaultValue () const = 0; virtual void CCL_API setDefaultValue (VariantRef value) = 0; virtual Variant CCL_API boundValue (VariantRef value) const = 0; virtual tbool CCL_API canIncrement () const = 0; virtual int CCL_API getPrecision () const = 0; virtual tbool CCL_API setPrecision (int precision) = 0; virtual void CCL_API increment () = 0; virtual void CCL_API decrement () = 0; virtual void CCL_API takeValue (const IParameter& param, tbool update = false) = 0; virtual float CCL_API getNormalized () const = 0; virtual void CCL_API setNormalized (float value, tbool update = false) = 0; virtual float CCL_API getValueNormalized (VariantRef value) const = 0; virtual Variant CCL_API getValuePlain (float valueNormalized) const = 0; virtual IParamCurve*CCL_API getCurve () const = 0; virtual void CCL_API setCurve (IParamCurve* curve) = 0; virtual IFormatter*CCL_API getFormatter () const = 0; virtual void CCL_API setFormatter (IFormatter* formatter) = 0; virtual void CCL_API getString (String& string, VariantRef value) const = 0; virtual void CCL_API toString (String& string) const = 0; virtual void CCL_API fromString (StringRef string, tbool update = false) = 0; IParameter bool isSignalFirst () const; void setSignalFirst (bool state = true); bool isSignalAlways () const; void setSignalAlways (bool state = true); bool isBipolar () const; void setBipolar (bool state = true); bool isReverse () const; void setReverse (bool state = true); bool isOutOfRange () const; void setOutOfRange (bool state = true); bool isWrapAround () const; void setWrapAround (bool state = true); bool isStorable () const; void setStorable (bool state = true); bool isStoreListValue () const; void setStoreListValue (bool state = true); bool isGroupable () const; void setGroupable (bool state = true); bool isPublic () const; void setPublic (bool state = true); bool isMutable () const; void setMutable (bool state = true); bool isReadOnly () const; void setReadOnly (bool state = true); void setFeedbackNeeded (bool state); void setPriorityChange (); bool isPriorityChange () const; void setCanUndo (bool state = true); bool canUndo () const; double getIncrement () const; void setIncrement (double increment); };
Inherited Members
public: // methods virtual tresult CCL_API queryInterface (UIDRef iid, void** ptr) = 0; virtual unsigned int CCL_API retain () = 0; virtual unsigned int CCL_API release () = 0;
Detailed Documentation
A parameter object is the link between application logic (controller) and GUI widgets.
If a GUI widget causes the parameter to change its value by user input, the controller is notified to update its data model. If the underlying data model changes, changing the parameter value forces the GUI widget to be updated on screen. A single parameter can be associated to any number of widgets simultaneously. No additional coding is required to keep multiple graphical representations in sync.
Methods
virtual StringID CCL_API getName () const = 0
Get parameter name.
virtual void CCL_API setName (StringID name) = 0
Set parameter name.
virtual tbool CCL_API isEnabled () const = 0
Check if parameter is enabled.
virtual void CCL_API enable (tbool state) = 0
Enable or disable parameter.
virtual tbool CCL_API getState (int mask) const = 0
Get parameter state.
virtual void CCL_API setState (int mask, tbool state) = 0
Set parameter state.
virtual int CCL_API getVisualState () const = 0
Get visual state.
virtual void CCL_API setVisualState (int state) = 0
Set visual state.
virtual void CCL_API connect (IParamObserver* controller, int tag) = 0
Connect parameter to controller with specified identification tag.
virtual int CCL_API getTag () const = 0
Get identification tag used by controller.
virtual IUnknown*CCL_API getController () const = 0
Get controller this parameter is associated with.
virtual void CCL_API performUpdate () = 0
Force controller update, usually IParamObserver::paramChanged.
virtual void CCL_API beginEdit () = 0
Notify controller about start of user interaction.
virtual void CCL_API endEdit () = 0
Notify controller about end of user interaction.
virtual IParameter*CCL_API getOriginal () = 0
Get original parameter (usually this, delegated by alias otherwise).
virtual IUnknown*CCL_API createIdentity () = 0
Create object identifying this parameter (controller must implement IResolver).
virtual Variant CCL_API getValue () const = 0
Get current value.
virtual void CCL_API setValue (VariantRef value, tbool update = false) = 0
Set value and (optionally) force controller update.
virtual Variant CCL_API getMin () const = 0
Get minimum numerical value (does not apply to string type).
virtual Variant CCL_API getMax () const = 0
Get maximum numerical value (does not apply to string type).
virtual void CCL_API setMin (VariantRef min) = 0
Set minimum numerical value (does not apply to string type).
virtual void CCL_API setMax (VariantRef max) = 0
Set maximum numerical value (does not apply to string type).
virtual Variant CCL_API getDefaultValue () const = 0
Get associated default value.
virtual void CCL_API setDefaultValue (VariantRef value) = 0
Set default value.
virtual Variant CCL_API boundValue (VariantRef value) const = 0
Bound value between minimum and maximum numerical value (does not apply to string type).
virtual tbool CCL_API canIncrement () const = 0
Check if value can be incremented/decremented (does not apply to string type).
virtual int CCL_API getPrecision () const = 0
Get precision used for increment/decrement.
virtual tbool CCL_API setPrecision (int precision) = 0
Set precision used for increment/decrement (delta = range / precision).
virtual void CCL_API increment () = 0
Increment numerical value, depending on precision.
virtual void CCL_API decrement () = 0
Decrement numerical value, depending on precision.
virtual void CCL_API takeValue (const IParameter& param, tbool update = false) = 0
Take value from other parameter.
virtual float CCL_API getNormalized () const = 0
Get normalized value between 0.0 and 1.0.
virtual void CCL_API setNormalized (float value, tbool update = false) = 0
Set value normalized and (optionally) force controller update.
virtual float CCL_API getValueNormalized (VariantRef value) const = 0
Get normalized float by plain value.
virtual Variant CCL_API getValuePlain (float valueNormalized) const = 0
Get plain value by normalized float.
virtual IParamCurve*CCL_API getCurve () const = 0
Get associated curve object.
virtual void CCL_API setCurve (IParamCurve* curve) = 0
Set curve object (shared by parameter).
virtual IFormatter*CCL_API getFormatter () const = 0
Get associated formatter object.
virtual void CCL_API setFormatter (IFormatter* formatter) = 0
Set formatter object (shared by parameter).
virtual void CCL_API getString (String& string, VariantRef value) const = 0
Shortcut to retrieve string representation of given value.
virtual void CCL_API toString (String& string) const = 0
Convert current value to string.
virtual void CCL_API fromString (StringRef string, tbool update = false) = 0
Set current value by string and (optionally) force controller update.