Jamba  3.1.0
pongasoft::VST::GUI::Views::StepButtonView Class Reference

#include <StepButtonView.h>

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

Classes

class  Creator
 

Public Member Functions

void draw (CDrawContext *iContext) override
 
virtual void drawHeldButton (CDrawContext *iContext)
 
virtual void drawReleasedButton (CDrawContext *iContext)
 
CColor const & getHeldColor () const
 
BitmapPtr getImage () const
 
CColor const & getReleasedColor () const
 
double getShiftStepIncrement () const
 
double getStepIncrement () const
 
bool getWrap () const
 get/setWrap => whether the discrete value wraps around when it reaches max (or min) More...
 
bool isHeld () 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 setHeldColor (CColor const &iColor)
 
void setImage (BitmapPtr iImage)
 
void setReleasedColor (CColor const &iColor)
 
void setShiftStepIncrement (double iStepIncrement)
 
void setStepIncrement (double iStepIncrement)
 
void setWrap (bool iFlag)
 
 StepButtonView (const CRect &iSize)
 
- 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)
 
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 Member Functions

virtual ParamValue computeNextValue (double iIncrement) const
 
virtual CDrawContext::PointList * getButtonPolygon ()
 
void registerParameters () override
 
void setViewSize (const CRect &rect, bool invalid) override
 
- Protected Member Functions inherited from pongasoft::VST::GUI::Views::CustomView
void sizeToFit (CCoord iWidth, CCoord iHeight)
 
bool sizeToFit (BitmapPtr iBitmap, int iFrameCount=1)
 

Protected Attributes

std::unique_ptr< CDrawContext::PointList > fButtonPolygon {}
 
bool fHeld {false}
 
CColor fHeldColor {kRedCColor}
 
BitmapSPtr fImage {nullptr}
 
CColor fReleasedColor {kGreyCColor}
 
double fShiftStepIncrement {0.0}
 
double fStepIncrement {1.0}
 
bool fWrap {false}
 
- 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 >
 

Detailed Description

A step button lets you step through the values of a parameter by repeatedly clicking on the button. It works for discrete values (stepCount > 0) in which case the increments should be an integer, or continuous values (stepCount == 0) in which case the increment should be in the range ]-1.0, 1.0[

  • The step-increment attribute defines whether this button will increment (positive) or decrement (negative) the value and by which amount.
  • The shift-step-increment attribute allows for a different value when the shift modifier is being held (for example having bigger steps or smaller steps).
  • The wrap attribute defines what happens when the value reaches its end of range after being incremented (resp. decremented). When set to true it will wrap around, otherwise it will remain at its max (resp. min).

Constructor & Destructor Documentation

◆ StepButtonView()

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

Member Function Documentation

◆ computeNextValue()

ParamValue pongasoft::VST::GUI::Views::StepButtonView::computeNextValue ( double  iIncrement) const
protectedvirtual

Adds the increment to the current value and wrap if necessary. Note that if the parameter represents a discrete value (step count > 0), then the increment will be applied to the discrete value!

Returns
the next value (which may be the current value if no wrap)

◆ draw()

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

◆ drawHeldButton()

void pongasoft::VST::GUI::Views::StepButtonView::drawHeldButton ( CDrawContext *  iContext)
virtual

◆ drawReleasedButton()

void pongasoft::VST::GUI::Views::StepButtonView::drawReleasedButton ( CDrawContext *  iContext)
virtual

◆ getButtonPolygon()

CDrawContext::PointList * pongasoft::VST::GUI::Views::StepButtonView::getButtonPolygon ( )
protectedvirtual
Returns
the polygon used to draw the button (by default a triangle pointing up if fStepIncrement is positive).

◆ getHeldColor()

CColor const& pongasoft::VST::GUI::Views::StepButtonView::getHeldColor ( ) const
inline

◆ getImage()

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

returns the image for the button which should have 2 frames The images should contain the following 2 frames (each is of size image height / 2):

  • at y = 0, the button in its released state
  • at y = image height / 2, the button in its held state

◆ getReleasedColor()

CColor const& pongasoft::VST::GUI::Views::StepButtonView::getReleasedColor ( ) const
inline

◆ getShiftStepIncrement()

double pongasoft::VST::GUI::Views::StepButtonView::getShiftStepIncrement ( ) const
inline
Returns
the increment value applied every time the step button is released while shift is being selected. Negative value will be decreasing and positive value will be increasing

◆ getStepIncrement()

double pongasoft::VST::GUI::Views::StepButtonView::getStepIncrement ( ) const
inline
Returns
the increment value applied every time the step button is released, negative value will be decreasing and positive value will be increasing

◆ getWrap()

bool pongasoft::VST::GUI::Views::StepButtonView::getWrap ( ) const
inline

get/setWrap => whether the discrete value wraps around when it reaches max (or min)

◆ isHeld()

bool pongasoft::VST::GUI::Views::StepButtonView::isHeld ( ) const
inline

◆ onKeyDown()

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

◆ onKeyUp()

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

◆ onMouseCancel()

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

◆ onMouseDown()

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

◆ onMouseUp()

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

◆ registerParameters()

void pongasoft::VST::GUI::Views::StepButtonView::registerParameters ( )
overrideprotectedvirtual

Subclasses should override this method to register each parameter

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

◆ setHeldColor()

void pongasoft::VST::GUI::Views::StepButtonView::setHeldColor ( CColor const &  iColor)
inline

◆ setImage()

void pongasoft::VST::GUI::Views::StepButtonView::setImage ( BitmapPtr  iImage)
inline
See also
getImage

◆ setReleasedColor()

void pongasoft::VST::GUI::Views::StepButtonView::setReleasedColor ( CColor const &  iColor)
inline

◆ setShiftStepIncrement()

void pongasoft::VST::GUI::Views::StepButtonView::setShiftStepIncrement ( double  iStepIncrement)
inline

◆ setStepIncrement()

void pongasoft::VST::GUI::Views::StepButtonView::setStepIncrement ( double  iStepIncrement)
inline

◆ setViewSize()

void pongasoft::VST::GUI::Views::StepButtonView::setViewSize ( const CRect &  rect,
bool  invalid 
)
overrideprotected

◆ setWrap()

void pongasoft::VST::GUI::Views::StepButtonView::setWrap ( bool  iFlag)
inline

Member Data Documentation

◆ fButtonPolygon

std::unique_ptr<CDrawContext::PointList> pongasoft::VST::GUI::Views::StepButtonView::fButtonPolygon {}
protected

◆ fHeld

bool pongasoft::VST::GUI::Views::StepButtonView::fHeld {false}
protected

State of the button (true for held, false for released)

◆ fHeldColor

CColor pongasoft::VST::GUI::Views::StepButtonView::fHeldColor {kRedCColor}
protected

◆ fImage

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

◆ fReleasedColor

CColor pongasoft::VST::GUI::Views::StepButtonView::fReleasedColor {kGreyCColor}
protected

◆ fShiftStepIncrement

double pongasoft::VST::GUI::Views::StepButtonView::fShiftStepIncrement {0.0}
protected

◆ fStepIncrement

double pongasoft::VST::GUI::Views::StepButtonView::fStepIncrement {1.0}
protected

◆ fWrap

bool pongasoft::VST::GUI::Views::StepButtonView::fWrap {false}
protected

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