|
Jamba C++ API 7.5.0
|
This class can be used to extend VSTGUI classes directly while still benefiting from the extensions added by Jamba. More...
#include <CustomView.h>
Inherits TView, ParamAware, and ICustomViewLifecycle.
Inherited by StateAwareCustomViewAdapter< TView, TGUIState >.
Classes | |
| class | Creator |
| Defines and registers the attributes exposed in the VSTGUI Editor and XML file (.uidesc) for CustomViewAdapter. More... | |
Public Types | |
| using | creator_super_type = TCustomViewCreator<CustomViewAdapter> |
Public Member Functions | |
| void | afterApplyAttributes () override |
| Handles the lifecycle behavior getting triggered once all the attributes have been set (which usually happens after the XML file (uidesc) has been read/processed, or when you modify attributes in the VSTGUI Editor). | |
| template<typename... Args> | |
| CustomViewAdapter (const CRect &iSize, Args &&...args) | |
| TagID | getCustomViewTag () const |
| The tag associated to this custom view. | |
| bool | getEditorMode () const |
| A flag whose purpose is to render/log information during development when the flag is set to true. | |
| void | markDirty () |
| Marks this view dirty which will (at the appropriate time in the rendering lifecycle) trigger a call to draw(). | |
| void | onParameterChange (ParamID iParamID) override |
| Callback when a parameter changes. | |
| void | setCustomViewTag (TagID iTag) |
| void | setEditorMode (bool iEditorMode) |
| Public Member Functions inherited from ParamAware | |
| virtual void | initState (GUIState *iGUIState) |
| Called during initialization. | |
| void | invokeAll () |
| Invoke all (currently) registered callbacks and onParameterChange() (if registered). | |
| void | onParameterChange (ParamID iParamID) override |
| This is the callback that should be implemented to handle parameter changes. | |
| IGUIParam | registerBaseCallback (ParamID iParamID, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback) |
| Registers a callback for the "base" param for the most generic use case. | |
| IGUIParam | registerBaseCallback (ParamID iParamID, Parameters::ChangeCallback1< IGUIParam > iChangeCallback, bool iInvokeCallback) |
| Registers a callback for the "base" param for the most generic use case. | |
| IGUIParam | registerBaseParam (ParamID iParamID, bool iSubscribeToChanges=true) |
| Registers the "base" param for the most generic use case but as a result is fairly limited and mainly gives access to the string representation of the param. | |
| template<typename T> | |
| GUIJmbParam< T > | registerCallback (GUIJmbParam< T > &iParam, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false) |
| Convenient call to register a callback for the Jmb param simply by using the param from the state (accessible in state-aware views via fState->fMyParam). | |
| template<typename T> | |
| GUIJmbParam< T > | registerCallback (GUIJmbParam< T > &iParam, Parameters::ChangeCallback1< GUIJmbParam< T > > iChangeCallback, bool iInvokeCallback=false) |
| Convenient call to register a callback for the Jmb param simply by using the param from the state (accessible in state-aware views via fState->fMyParam). | |
| template<typename T> | |
| GUIJmbParam< T > | registerCallback (JmbParam< T > const &iParamDef, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false) |
| Convenient call to register a callback for the Jmb param simply by using its description (accessible in state-aware views via fParams->fMyParam). | |
| template<typename T> | |
| GUIJmbParam< T > | registerCallback (JmbParam< T > const &iParamDef, Parameters::ChangeCallback1< GUIJmbParam< T > > iChangeCallback, bool iInvokeCallback=false) |
| Convenient call to register a callback for the Jmb param simply by using its description (accessible in state-aware views via fParams->fMyParam). | |
| GUIRawVstParam | registerCallback (RawVstParam const &iParamDef, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false) |
| Registers a raw parameter (no conversion). | |
| GUIRawVstParam | registerCallback (RawVstParam const &iParamDef, Parameters::ChangeCallback1< GUIRawVstParam > iChangeCallback, bool iInvokeCallback=false) |
| Registers a raw parameter (no conversion). | |
| template<typename T> | |
| GUIVstParam< T > | registerCallback (VstParam< T > const &iParamDef, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false) |
| Convenient call to register a callback for the Vst param simply by using its description (accessible in state-aware views via fParams->fMyParam). | |
| template<typename T> | |
| GUIVstParam< T > | registerCallback (VstParam< T > const &iParamDef, Parameters::ChangeCallback1< GUIVstParam< T > > iChangeCallback, bool iInvokeCallback=false) |
| Convenient call to register a callback for the Vst param simply by using its description (accessible in state-aware views via fParams->fMyParam). | |
| template<typename T> | |
| GUIJmbParam< T > | registerJmbCallback (ParamID iParamID, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false) |
| Registers a callback for the Jmb param by its id and return the wrapper to the param. | |
| template<typename T> | |
| GUIJmbParam< T > | registerJmbCallback (ParamID iParamID, Parameters::ChangeCallback1< GUIJmbParam< T > > iChangeCallback, bool iInvokeCallback=false) |
| Registers a callback for the Jmb param by its id and return the wrapper to the param. | |
| template<typename T> | |
| GUIJmbParam< T > | registerJmbParam (ParamID iParamID, bool iSubscribeToChanges=true) |
| Registers the Jmb param by its id and return the wrapper to the param. | |
| template<typename T> | |
| GUIOptionalParam< T > | registerOptionalCallback (ParamID iParamID, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false) |
| Registers an optional parameter which handles Vst, Jmb or no parameter at all. | |
| template<typename T> | |
| GUIOptionalParam< T > | registerOptionalCallback (ParamID iParamID, Parameters::ChangeCallback1< GUIOptionalParam< T > > iChangeCallback, bool iInvokeCallback=false) |
| Registers an optional parameter which handles Vst, Jmb or no parameter at all. | |
| GUIOptionalParam< int32 > | registerOptionalDiscreteCallback (ParamID iParamID, int32 iStepCount, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false) |
| Registers an optional discrete parameter which handles Vst, Jmb or no parameter at all. | |
| GUIOptionalParam< int32 > | registerOptionalDiscreteCallback (ParamID iParamID, int32 iStepCount, Parameters::ChangeCallback1< GUIOptionalParam< int32 > > iChangeCallback, bool iInvokeCallback=false) |
| Registers an optional discrete parameter which handles Vst, Jmb or no parameter at all. | |
| GUIOptionalParam< int32 > | registerOptionalDiscreteParam (ParamID iParamID, int32 iStepCount, bool iSubscribeToChanges=true) |
| Registers an optional discrete parameter which handles Vst, Jmb or no parameter at all. | |
| template<typename T> | |
| GUIOptionalParam< T > | registerOptionalParam (ParamID iParamID, bool iSubscribeToChanges=true) |
| Registers an optional parameter which handles Vst, Jmb or no parameter at all. | |
| template<typename T> | |
| GUIJmbParam< T > | registerParam (GUIJmbParam< T > &iParam, bool iSubscribeToChanges=true) |
| Convenient call to register a Jmb param simply by using the param from the state (accessible in state-aware views via fState->fMyParam). | |
| template<typename T> | |
| GUIJmbParam< T > | registerParam (JmbParam< T > const &iParamDef, bool iSubscribeToChanges=true) |
| Convenient call to register a Jmb param simply by using its description (accessible in state-aware views via fParams->fMyParam). | |
| GUIRawVstParam | registerParam (RawVstParam const &iParamDef, bool iSubscribeToChanges=true) |
| Registers a raw parameter (no conversion). | |
| template<typename T> | |
| GUIVstParam< T > | registerParam (VstParam< T > const &iParamDef, bool iSubscribeToChanges=true) |
| Convenient call to register a Vst param simply by using its description (accessible in state-aware views via fParams->fMyParam). | |
| virtual void | registerParameters () |
| Subclasses should override this method to register each parameter. | |
| GUIRawVstParam | registerRawVstCallback (ParamID iParamID, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false) |
| Registers a raw parameter (no conversion) The callback will be invoked when the parameter changes. | |
| GUIRawVstParam | registerRawVstCallback (ParamID iParamID, Parameters::ChangeCallback1< GUIRawVstParam > iChangeCallback, bool iInvokeCallback=false) |
| Registers a raw parameter (no conversion) The callback will be invoked when the parameter changes. | |
| GUIRawVstParam | registerRawVstParam (ParamID iParamID, bool iSubscribeToChanges=true) |
| Registers a raw parameter (no conversion) onParameterChange() will be called on changes (if iSubscribeToChanges is set to true). | |
| GUIVstParam< bool > | registerVstBooleanParam (ParamID iParamID, bool iSubscribeToChanges=true) |
| template<typename T> | |
| GUIVstParam< T > | registerVstCallback (ParamID iParamID, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false) |
| Register a callback for a Vst parameter simply given its id The callback will be invoked when the parameter changes. | |
| template<typename T> | |
| GUIVstParam< T > | registerVstCallback (ParamID iParamID, Parameters::ChangeCallback1< GUIVstParam< T > > iChangeCallback, bool iInvokeCallback=false) |
| Register a callback for a Vst parameter simply given its id The callback will be invoked when the parameter changes. | |
| template<typename T> | |
| GUIVstParam< T > | registerVstParam (ParamID iParamID, bool iSubscribeToChanges=true) |
| Register a Vst parameter simply given its id onParameterChange() will be called on changes (if iSubscribeToChanges is set to true). | |
| GUIVstParam< Percent > | registerVstPercentParam (ParamID iParamID, bool iSubscribeToChanges=true) |
| void | unregisterAll () |
| Unregisters all parameters. | |
| template<typename T> | |
| GUIJmbParam< T > | unregisterParam (GUIJmbParam< T > const &iParam) |
| Removes the registration of the provided param (closing the connection/stopping to listen). | |
| GUIRawVstParam | unregisterParam (GUIRawVstParam const &iParam) |
| Removes the registration of the provided param (closing the connection/stopping to listen). | |
| template<typename T> | |
| GUIVstParam< T > | unregisterParam (GUIVstParam< T > const &iParam) |
| Removes the registration of the provided param (closing the connection/stopping to listen). | |
| bool | unregisterParam (ParamID iParamID) |
| Removes the registration of the provided param (closing the connection/stopping to listen). | |
| virtual | ~ParamAware () |
| Public Member Functions inherited from ICustomViewLifecycle | |
| virtual | ~ICustomViewLifecycle ()=default |
| Destructor (virtual / requirement for interface). | |
Protected Attributes | |
| TagID | fTag |
| Protected Attributes inherited from ParamAware | |
| std::unique_ptr< GUIParamCxMgr > | fParamCxMgr {} |
This class can be used to extend VSTGUI classes directly while still benefiting from the extensions added by Jamba.
CustomView extends CView to create a completely custom class. If, on the other end, you simply want to extend another class from VSTGUI (ex: CTextEdit), you can use this class which implements most of the behavior from CustomView.
In addition to the attributes exposed by TView, this class exposes the following attributes:
| Attribute | Description |
|---|---|
| custom-view-tag | The tag associated to this custom view. This tag (which is not related to a parameter), is optional and can be used to differentiate between views when implementing a custom controller. // Example
CView *SampleEditController::verifyView(CView *iView,
const UIAttributes &iAttributes,
const IUIDescription *iDescription)
{
if(button) {
switch(button->getCustomViewTag()) {
case ESampleSplitterParamID::kNormalize0Action:
initButton(button, SampleDataAction::Type::kNormalize0, false);
break;
// ....
}
}
}
Extension of the CTextButton view to add more functionality. Definition TextButtonView.h:49 |
| editor-mode | A flag whose purpose is to render/log information during development when the flag is set to true. It can be flipped directly in the VSTGUI Editor without having to recompile the code. // Example
void SampleEditView::draw(CDrawContext *iContext) {
// ...
#if EDITOR_MODE
if(getEditorMode())
{
rdc.debug("SampleRange: [%.3f,%.3f] | PixelRange: [%.3f,%.3f] | Visible: [%.3f,%.3f] | BPM: %f",
fState->fWESelectedSampleRange->fFrom, fState->fWESelectedSampleRange->fTo,
fSelectedPixelRange.fFrom, fSelectedPixelRange.fTo,
fVisibleSampleRange.fFrom, fVisibleSampleRange.fTo,
fHostInfo->fTempo);
}
#endif
}
Encapsulates the draw context provided by VSTGUI to reason in relative coordinates (0,... Definition DrawContext.h:170 bool getEditorMode() const A flag whose purpose is to render/log information during development when the flag is set to true. Definition CustomView.h:370
|
| TView | the view class (for ex: CTextEdit) |
| using creator_super_type = TCustomViewCreator<CustomViewAdapter> |
|
inlineexplicit |
|
inlineoverridevirtual |
Handles the lifecycle behavior getting triggered once all the attributes have been set (which usually happens after the XML file (uidesc) has been read/processed, or when you modify attributes in the VSTGUI Editor).
Reimplemented from ICustomViewLifecycle.
Reimplemented in DebugParamDisplayView.
|
inline |
The tag associated to this custom view.
This tag (which is not related to a parameter), is optional and can be used to differentiate between views when implementing a custom controller.
|
inline |
A flag whose purpose is to render/log information during development when the flag is set to true.
It can be flipped directly in the VSTGUI Editor without having to recompile the code.
|
inline |
Marks this view dirty which will (at the appropriate time in the rendering lifecycle) trigger a call to draw().
|
inlineoverridevirtual |
Callback when a parameter changes.
By default simply marks the view as dirty. This method is intended to be overriden to implement specific behavior.
Implements Parameters::IChangeListener.
Reimplemented in DebugParamDisplayView, and SwitchViewContainer.
|
inline |
|
inline |
|
protected |