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

#include <MomentaryButtonView.h>

Inherits pongasoft::VST::GUI::Views::TCustomControlView< bool >.

Classes

class  Creator
 

Public Member Functions

void draw (CDrawContext *iContext) override
 
virtual void drawOff (CDrawContext *iContext)
 
virtual void drawOn (CDrawContext *iContext)
 
BitmapPtr getImage () const
 
CColor const & getOnColor () const
 
bool isOff () const
 
bool isOn () const
 
 MomentaryButtonView (const CRect &iSize)
 
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 setImage (BitmapPtr iImage)
 
void setOnColor (CColor const &iColor)
 
bool sizeToFit () override
 
- Public Member Functions inherited from pongasoft::VST::GUI::Views::TCustomControlView< bool >
bool getControlValue () const
 
void registerParameters () override
 
void setControlTag (int32_t iTag) override
 
virtual void setControlValue (bool 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< Percent > registerVstPercentParam (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

BitmapSPtr fImage {nullptr}
 
CColor fOnColor {kRedCColor}
 
- Protected Attributes inherited from pongasoft::VST::GUI::Views::TCustomControlView< bool >
GUIVstParam< bool > fControlParameter
 
bool 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< GUIParamCxMgr > fParamCxMgr {}
 

Additional Inherited Members

- Public Types inherited from pongasoft::VST::GUI::Views::TCustomControlView< bool >
using Creator = CustomViewCreator< TCustomControlView< bool, GUIVstParam< bool > >, 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

Represents a momentary button: a button which is "on" only when pressed. The VSTGUI sdk has a class called CKickButton which is similar but it behaves improperly (for example, the button gets stuck in "pressed" state for some reason...)

Constructor & Destructor Documentation

◆ MomentaryButtonView()

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

Member Function Documentation

◆ draw()

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

◆ drawOff()

void pongasoft::VST::GUI::Views::MomentaryButtonView::drawOff ( CDrawContext *  iContext)
virtual

◆ drawOn()

void pongasoft::VST::GUI::Views::MomentaryButtonView::drawOn ( CDrawContext *  iContext)
virtual

◆ getImage()

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

get/setImage 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 off state
  • at y = image height / 2, the button in its on state

◆ getOnColor()

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

◆ isOff()

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

◆ isOn()

bool pongasoft::VST::GUI::Views::MomentaryButtonView::isOn ( ) const
inline

◆ onKeyDown()

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

◆ onKeyUp()

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

◆ onMouseCancel()

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

◆ onMouseDown()

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

◆ onMouseUp()

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

◆ setImage()

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

◆ setOnColor()

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

◆ sizeToFit()

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

Member Data Documentation

◆ fImage

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

◆ fOnColor

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

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