Jamba  3.2.0
pongasoft::VST::GUI::Views::DiscreteButtonView Class Reference

#include <DiscreteButtonView.h>

Inherits pongasoft::VST::GUI::Views::TCustomControlView< T, TGUIParam >.

Classes

class  Creator
 

Public Member Functions

 DiscreteButtonView (const CRect &iSize)
 
void draw (CDrawContext *iContext) override
 
int getFrames () const
 
BitmapPtr getImage () const
 
bool getInverse () const
 
CColor const & getOnColor () const
 
int32 getStep () const
 
bool isOff () const
 
bool isOn () const
 
int32_t onKeyDown (VstKeyCode &keyCode) override
 
int32_t onKeyUp (VstKeyCode &keyCode) override
 
CMouseEventResult onMouseCancel () override
 
CMouseEventResult onMouseDown (CPoint &where, const CButtonState &buttons) override
 
CMouseEventResult onMouseUp (CPoint &where, const CButtonState &buttons) override
 
void registerParameters () override
 
void setFrames (int iFrames)
 
void setImage (BitmapPtr iImage)
 
void setInverse (bool iInverse)
 
void setOn ()
 
void setOnColor (CColor const &iColor)
 
void setStep (int32 step)
 
bool sizeToFit () override
 
- Public Member Functions inherited from pongasoft::VST::GUI::Views::TCustomControlView< T, TGUIParam >
getControlValue () const
 
void setControlTag (int32_t iTag) override
 
virtual void setControlValue (T const &iControlValue)
 
 TCustomControlView (const CRect &iSize)
 
- Public Member Functions inherited from pongasoft::VST::GUI::Views::CustomControlView
 CustomControlView (const CRect &iSize)
 
int32_t getControlTag () const
 
- Public Member Functions inherited from pongasoft::VST::GUI::Views::CustomView
 CustomView (const CRect &iSize)
 
 CustomView (const CustomView &c)=delete
 
void draw (CDrawContext *iContext) override
 
virtual void drawBackColor (CDrawContext *iContext)
 
void drawStyleChanged ()
 
CColor const & getBackColor () const
 
int32_t getCustomViewTag () const
 
bool getEditorMode () const
 
void markDirty ()
 
void onParameterChange (ParamID iParamID) override
 
void setBackColor (CColor const &iColor)
 
void setCustomViewTag (int32_t iTag)
 
void setEditorMode (bool iEditorMode)
 
- Public Member Functions inherited from pongasoft::VST::GUI::Params::GUIParamCxAware
bool __internal__registerRawVstControl (int32_t iParamID, ParamValue &oControlValue, GUIRawVstParam &oGUIRawVstParam)
 
template<typename T >
bool __internal__registerVstControl (int32_t iParamID, T &oControlValue, GUIVstParam< T > &oParam)
 
bool __internal__registerVstControl (int32_t iParamID, ParamValue &oControlValue, GUIRawVstParam &oParam)
 
virtual void initState (GUIState *iGUIState)
 
void invokeAll ()
 
GUIRawVstParam registerCallback (RawVstParam const &iParamDef, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false)
 
template<typename T >
GUIVstParam< T > registerCallback (VstParam< T > const &iParamDef, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false)
 
template<typename T >
bool registerCallback (VstParam< T > const &iParamDef, Parameters::ChangeCallback1< GUIVstParam< T >> iChangeCallback, bool iInvokeCallback=false)
 
template<typename T >
GUIJmbParam< T > registerCallback (GUIJmbParam< T > &iParamDef, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false)
 
template<typename T >
bool registerCallback (GUIJmbParam< T > &iParamDef, Parameters::ChangeCallback1< GUIJmbParam< T >> iChangeCallback, bool iInvokeCallback=false)
 
template<typename T >
GUIJmbParam< T > registerJmbCallback (ParamID iParamID, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false)
 
template<typename T >
GUIJmbParam< T > registerJmbParam (ParamID iParamID, bool iSubscribeToChanges=true)
 
bool registerParam (int32_t iParamID, GUIRawVstParam &oGUIRawVstParam)
 
GUIRawVstParam registerParam (RawVstParam const &iParamDef, bool iSubscribeToChanges=true)
 
template<typename T >
GUIVstParam< T > registerParam (VstParam< T > const &iParamDef, bool iSubscribeToChanges=true)
 
template<typename T >
GUIJmbParam< T > registerParam (GUIJmbParam< T > &iParamDef)
 
GUIRawVstParam registerRawVstCallback (ParamID iParamID, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false)
 
GUIRawVstParam registerRawVstParam (ParamID iParamID, bool iSubscribeToChanges=true)
 
GUIVstParam< bool > registerVstBooleanParam (ParamID iParamID, bool iSubscribeToChanges=true)
 
template<typename T >
GUIVstParam< T > registerVstCallback (ParamID iParamID, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false)
 
template<typename T >
GUIVstParam< T > registerVstParam (ParamID iParamID, bool iSubscribeToChanges=true)
 
GUIVstParam< PercentregisterVstPercentParam (ParamID iParamID, bool iSubscribeToChanges=true)
 
void unregisterAll ()
 
bool unregisterParam (ParamID iParamID)
 
GUIRawVstParam unregisterParam (GUIRawVstParam const &iParam)
 
template<typename T >
GUIVstParam< T > unregisterParam (GUIVstParam< T > const &iParam)
 
template<typename T >
GUIJmbParam< T > unregisterParam (GUIJmbParam< T > const &iParam)
 
virtual ~GUIParamCxAware ()
 

Protected Attributes

int fFrames {4}
 
BitmapSPtr fImage {nullptr}
 
bool fInverse {false}
 
CColor fOnColor {kRedCColor}
 
bool fPressed {false}
 
int32 fStep {0}
 
- Protected Attributes inherited from pongasoft::VST::GUI::Views::TCustomControlView< T, TGUIParam >
TGUIParam fControlParameter {}
 
fControlValue {}
 
- Protected Attributes inherited from pongasoft::VST::GUI::Views::CustomControlView
int32_t fControlTag {-1}
 
- Protected Attributes inherited from pongasoft::VST::GUI::Views::CustomView
CColor fBackColor
 
bool fEditorMode
 
int32_t fTag
 
- Protected Attributes inherited from pongasoft::VST::GUI::Params::GUIParamCxAware
std::unique_ptr< GUIParamCxMgrfParamCxMgr {}
 

Additional Inherited Members

- Public Types inherited from pongasoft::VST::GUI::Views::TCustomControlView< T, TGUIParam >
using Creator = CustomViewCreator< TCustomControlView< T, TGUIParam >, CustomControlView >
 
- Protected Member Functions inherited from pongasoft::VST::GUI::Views::CustomView
void sizeToFit (CCoord iWidth, CCoord iHeight)
 
bool sizeToFit (BitmapPtr iBitmap, int iFrameCount=1)
 

Detailed Description

A discrete button behaves like a toggle button except that it is on only if the control value (tied to a vst parameter) is equal to the step value (DiscreteButtonView::getStep() / step property in the xml). Selecting the button will set the underlying vst parameter to step. This button is designed to be used with a discrete parameter (where the raw param value is divided into steps) and uses the underlying GUIVstParameter::getStepCount() method to determine how many steps to account for.

Constructor & Destructor Documentation

◆ DiscreteButtonView()

pongasoft::VST::GUI::Views::DiscreteButtonView::DiscreteButtonView ( const CRect &  iSize)
inlineexplicit

Member Function Documentation

◆ draw()

void pongasoft::VST::GUI::Views::DiscreteButtonView::draw ( CDrawContext *  iContext)
override

◆ getFrames()

int pongasoft::VST::GUI::Views::DiscreteButtonView::getFrames ( ) const
inline

◆ getImage()

BitmapPtr pongasoft::VST::GUI::Views::DiscreteButtonView::getImage ( ) const
inline

get/setImage for the button which should have 2 or 4 frames depending on the fFrames value The images should contain the following :

  • for 2 frames each is of size image height / 2:
    • at y = 0, the button in its off state
    • at y = image height / 2, the button in its on state
  • for 4 frames each is of size image height / 4:
    • at y = 0 0/4, the button in its off state
    • at y = image height * 1/4, the button in its off state depressed
    • at y = image height * 2/4, the button in its on state
    • at y = image height * 3/4, the button in its on state depressed

◆ getInverse()

bool pongasoft::VST::GUI::Views::DiscreteButtonView::getInverse ( ) const
inline

◆ getOnColor()

CColor const& pongasoft::VST::GUI::Views::DiscreteButtonView::getOnColor ( ) const
inline

◆ getStep()

int32 pongasoft::VST::GUI::Views::DiscreteButtonView::getStep ( ) const
inline

◆ isOff()

bool pongasoft::VST::GUI::Views::DiscreteButtonView::isOff ( ) const
inline

◆ isOn()

bool pongasoft::VST::GUI::Views::DiscreteButtonView::isOn ( ) const

◆ onKeyDown()

int32_t pongasoft::VST::GUI::Views::DiscreteButtonView::onKeyDown ( VstKeyCode &  keyCode)
override

◆ onKeyUp()

int32_t pongasoft::VST::GUI::Views::DiscreteButtonView::onKeyUp ( VstKeyCode &  keyCode)
override

◆ onMouseCancel()

CMouseEventResult pongasoft::VST::GUI::Views::DiscreteButtonView::onMouseCancel ( )
override

◆ onMouseDown()

CMouseEventResult pongasoft::VST::GUI::Views::DiscreteButtonView::onMouseDown ( CPoint &  where,
const CButtonState &  buttons 
)
override

◆ onMouseUp()

CMouseEventResult pongasoft::VST::GUI::Views::DiscreteButtonView::onMouseUp ( CPoint &  where,
const CButtonState &  buttons 
)
override

◆ registerParameters()

void pongasoft::VST::GUI::Views::DiscreteButtonView::registerParameters ( )
overridevirtual

Subclasses should override this method to register each parameter

Reimplemented from pongasoft::VST::GUI::Views::TCustomControlView< T, TGUIParam >.

◆ setFrames()

void pongasoft::VST::GUI::Views::DiscreteButtonView::setFrames ( int  iFrames)

◆ setImage()

void pongasoft::VST::GUI::Views::DiscreteButtonView::setImage ( BitmapPtr  iImage)
inline

◆ setInverse()

void pongasoft::VST::GUI::Views::DiscreteButtonView::setInverse ( bool  iInverse)
inline

◆ setOn()

void pongasoft::VST::GUI::Views::DiscreteButtonView::setOn ( )

◆ setOnColor()

void pongasoft::VST::GUI::Views::DiscreteButtonView::setOnColor ( CColor const &  iColor)
inline

◆ setStep()

void pongasoft::VST::GUI::Views::DiscreteButtonView::setStep ( int32  step)

◆ sizeToFit()

bool pongasoft::VST::GUI::Views::DiscreteButtonView::sizeToFit ( )
override

Member Data Documentation

◆ fFrames

int pongasoft::VST::GUI::Views::DiscreteButtonView::fFrames {4}
protected

◆ fImage

BitmapSPtr pongasoft::VST::GUI::Views::DiscreteButtonView::fImage {nullptr}
protected

◆ fInverse

bool pongasoft::VST::GUI::Views::DiscreteButtonView::fInverse {false}
protected

◆ fOnColor

CColor pongasoft::VST::GUI::Views::DiscreteButtonView::fOnColor {kRedCColor}
protected

◆ fPressed

bool pongasoft::VST::GUI::Views::DiscreteButtonView::fPressed {false}
protected

◆ fStep

int32 pongasoft::VST::GUI::Views::DiscreteButtonView::fStep {0}
protected

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