Jamba  3.0.2
pongasoft::VST::GUI::Views::ScrollbarView Class Reference

#include <ScrollbarView.h>

Inherits pongasoft::VST::GUI::Views::CustomView.

Classes

class  Creator
 
struct  ZoomBox
 

Public Member Functions

void draw (CDrawContext *iContext) override
 
bool getEnableZoomDoubleClick () const
 
Margin const & getMargin () const
 
double getOffsetPercent () const
 
int32_t getOffsetPercentTag () const
 
const CColor & getScrollbarColor () const
 
CCoord getScrollbarGutterSpacing () const
 
CCoord getScrollbarMinSize () const
 
Range const & getShiftDragFactor () const
 
const CColor & getZoomHandlesColor () const
 
CCoord getZoomHandlesSize () const
 
double getZoomPercent () const
 
int32_t getZoomPercentTag () const
 
 ScrollbarView (const CRect &iSize)
 
void setEnableZoomDoubleClick (bool iEnableZoomDoubleClick)
 
void setMargin (Margin const &iMargin)
 
void setOffsetPercent (double iOffsetPercent)
 
void setOffsetPercentTag (int32_t offsetPercentTag)
 
void setScrollbarColor (const CColor &iColor)
 
void setScrollbarGutterSpacing (CCoord iScrollbarGutterSpacing)
 
void setScrollbarMinSize (CCoord iScrollbarMinSize)
 
void setShiftDragFactor (Range const &iShiftDragFactor)
 
void setZoomHandlesColor (const CColor &iColor)
 
void setZoomHandlesSize (CCoord iSize)
 
void setZoomPercent (double iZoomPercent)
 
void setZoomPercentTag (int32_t zoomPercentTag)
 
bool showHandles () 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 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 > &oGUIVstParam)
 
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 Types

enum  DragType {
  DragType::kNone, DragType::kScroll, DragType::kZoomLeft, DragType::kZoomRight,
  DragType::kStretchLeft, DragType::kStretchRight
}
 

Protected Member Functions

ZoomBox computeZoomBox () const
 
virtual void drawLeftHandle (CDrawContext *iContext)
 
virtual void drawRightHandle (CDrawContext *iContext)
 
virtual void drawScrollbar (CDrawContext *iContext)
 
CCoord getScrollbarWidth () const
 
void needsRecomputing ()
 
CMouseEventResult onMouseCancel () override
 
CMouseEventResult onMouseDown (CPoint &where, const CButtonState &buttons) override
 
CMouseEventResult onMouseMoved (CPoint &where, const CButtonState &buttons) override
 
CMouseEventResult onMouseUp (CPoint &where, const CButtonState &buttons) override
 
void onParameterChange (ParamID iParamID) override
 
void recompute ()
 
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

RelativeCoord fDragGestureX {-1.0}
 
DragType fDragType {DragType::kNone}
 
bool fEnableZoomDoubleClick {true}
 
AbsoluteRect fLeftHandleRect
 
Margin fMargin {}
 
bool fNeedsRecomputing {true}
 
GUIRawVstParamEditor fOffsetPercentEditor {nullptr}
 
GUIRawVstParam fOffsetPercentParam {}
 
int32_t fOffsetPercentTag {-1}
 
double fOffsetPercentValue {}
 
AbsoluteRect fRightHandleRect
 
CColor fScrollbarColor {kWhiteCColor}
 
CCoord fScrollbarGutterSpacing {1}
 
CCoord fScrollbarMinSize {-1}
 
AbsoluteRect fScrollbarRect
 
Range fShiftDragFactor {1.0}
 
ZoomBox fZoomBox {}
 
CColor fZoomHandlesColor {kWhiteCColor}
 
CCoord fZoomHandlesSize {-1}
 
GUIRawVstParamEditor fZoomPercentEditor {nullptr}
 
GUIRawVstParam fZoomPercentParam {}
 
int32_t fZoomPercentTag {-1}
 
double fZoomPercentValue {}
 
- 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 {}
 

Detailed Description

Generic scrollbar which handles scrolling and (optional) zooming via handles. The scrollbar is driven by 2 parameters which can be tied to Vst parameters:

  • offsetPercent which represents the position of the scrollbar as a percent (0 means completely left, 1 means completely right)
  • zoomPercent which represents the size of the scrollbar as a percent (0 means completely zoomed out (hence the scrollbar is full), 1 means completely zoomed in (hence the scrollbar is at its minimum size)). At the moment, it handles only horizontal scrollbar.

Member Enumeration Documentation

◆ DragType

Enumerator
kNone 
kScroll 
kZoomLeft 
kZoomRight 
kStretchLeft 
kStretchRight 

Constructor & Destructor Documentation

◆ ScrollbarView()

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

Member Function Documentation

◆ computeZoomBox()

ScrollbarView::ZoomBox pongasoft::VST::GUI::Views::ScrollbarView::computeZoomBox ( ) const
protected

◆ draw()

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

◆ drawLeftHandle()

void pongasoft::VST::GUI::Views::ScrollbarView::drawLeftHandle ( CDrawContext *  iContext)
protectedvirtual

◆ drawRightHandle()

void pongasoft::VST::GUI::Views::ScrollbarView::drawRightHandle ( CDrawContext *  iContext)
protectedvirtual

◆ drawScrollbar()

void pongasoft::VST::GUI::Views::ScrollbarView::drawScrollbar ( CDrawContext *  iContext)
protectedvirtual

◆ getEnableZoomDoubleClick()

bool pongasoft::VST::GUI::Views::ScrollbarView::getEnableZoomDoubleClick ( ) const
inline

◆ getMargin()

Margin const& pongasoft::VST::GUI::Views::ScrollbarView::getMargin ( ) const
inline

◆ getOffsetPercent()

double pongasoft::VST::GUI::Views::ScrollbarView::getOffsetPercent ( ) const

◆ getOffsetPercentTag()

int32_t pongasoft::VST::GUI::Views::ScrollbarView::getOffsetPercentTag ( ) const
inline

◆ getScrollbarColor()

const CColor& pongasoft::VST::GUI::Views::ScrollbarView::getScrollbarColor ( ) const
inline

◆ getScrollbarGutterSpacing()

CCoord pongasoft::VST::GUI::Views::ScrollbarView::getScrollbarGutterSpacing ( ) const
inline

◆ getScrollbarMinSize()

CCoord pongasoft::VST::GUI::Views::ScrollbarView::getScrollbarMinSize ( ) const
inline

◆ getScrollbarWidth()

CCoord pongasoft::VST::GUI::Views::ScrollbarView::getScrollbarWidth ( ) const
protected

◆ getShiftDragFactor()

Range const& pongasoft::VST::GUI::Views::ScrollbarView::getShiftDragFactor ( ) const
inline

◆ getZoomHandlesColor()

const CColor& pongasoft::VST::GUI::Views::ScrollbarView::getZoomHandlesColor ( ) const
inline

◆ getZoomHandlesSize()

CCoord pongasoft::VST::GUI::Views::ScrollbarView::getZoomHandlesSize ( ) const
inline

◆ getZoomPercent()

double pongasoft::VST::GUI::Views::ScrollbarView::getZoomPercent ( ) const

◆ getZoomPercentTag()

int32_t pongasoft::VST::GUI::Views::ScrollbarView::getZoomPercentTag ( ) const
inline

◆ needsRecomputing()

void pongasoft::VST::GUI::Views::ScrollbarView::needsRecomputing ( )
inlineprotected

◆ onMouseCancel()

CMouseEventResult pongasoft::VST::GUI::Views::ScrollbarView::onMouseCancel ( )
overrideprotected

◆ onMouseDown()

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

◆ onMouseMoved()

CMouseEventResult pongasoft::VST::GUI::Views::ScrollbarView::onMouseMoved ( CPoint &  where,
const CButtonState &  buttons 
)
overrideprotected

◆ onMouseUp()

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

◆ onParameterChange()

void pongasoft::VST::GUI::Views::ScrollbarView::onParameterChange ( ParamID  iParamID)
overrideprotectedvirtual

Callback when a parameter changes. By default simply marks the view as dirty.

Reimplemented from pongasoft::VST::GUI::Views::CustomView.

◆ recompute()

void pongasoft::VST::GUI::Views::ScrollbarView::recompute ( )
protected

◆ registerParameters()

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

Subclasses should override this method to register each parameter

Reimplemented from pongasoft::VST::GUI::Params::GUIParamCxAware.

◆ setEnableZoomDoubleClick()

void pongasoft::VST::GUI::Views::ScrollbarView::setEnableZoomDoubleClick ( bool  iEnableZoomDoubleClick)
inline

◆ setMargin()

void pongasoft::VST::GUI::Views::ScrollbarView::setMargin ( Margin const &  iMargin)
inline

◆ setOffsetPercent()

void pongasoft::VST::GUI::Views::ScrollbarView::setOffsetPercent ( double  iOffsetPercent)

◆ setOffsetPercentTag()

void pongasoft::VST::GUI::Views::ScrollbarView::setOffsetPercentTag ( int32_t  offsetPercentTag)

◆ setScrollbarColor()

void pongasoft::VST::GUI::Views::ScrollbarView::setScrollbarColor ( const CColor &  iColor)
inline

◆ setScrollbarGutterSpacing()

void pongasoft::VST::GUI::Views::ScrollbarView::setScrollbarGutterSpacing ( CCoord  iScrollbarGutterSpacing)
inline

◆ setScrollbarMinSize()

void pongasoft::VST::GUI::Views::ScrollbarView::setScrollbarMinSize ( CCoord  iScrollbarMinSize)
inline

◆ setShiftDragFactor()

void pongasoft::VST::GUI::Views::ScrollbarView::setShiftDragFactor ( Range const &  iShiftDragFactor)
inline

◆ setViewSize()

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

◆ setZoomHandlesColor()

void pongasoft::VST::GUI::Views::ScrollbarView::setZoomHandlesColor ( const CColor &  iColor)
inline

◆ setZoomHandlesSize()

void pongasoft::VST::GUI::Views::ScrollbarView::setZoomHandlesSize ( CCoord  iSize)
inline

◆ setZoomPercent()

void pongasoft::VST::GUI::Views::ScrollbarView::setZoomPercent ( double  iZoomPercent)

◆ setZoomPercentTag()

void pongasoft::VST::GUI::Views::ScrollbarView::setZoomPercentTag ( int32_t  zoomPercentTag)

◆ showHandles()

bool pongasoft::VST::GUI::Views::ScrollbarView::showHandles ( ) const
inline

Member Data Documentation

◆ fDragGestureX

RelativeCoord pongasoft::VST::GUI::Views::ScrollbarView::fDragGestureX {-1.0}
protected

◆ fDragType

DragType pongasoft::VST::GUI::Views::ScrollbarView::fDragType {DragType::kNone}
protected

◆ fEnableZoomDoubleClick

bool pongasoft::VST::GUI::Views::ScrollbarView::fEnableZoomDoubleClick {true}
protected

◆ fLeftHandleRect

AbsoluteRect pongasoft::VST::GUI::Views::ScrollbarView::fLeftHandleRect
protected

◆ fMargin

Margin pongasoft::VST::GUI::Views::ScrollbarView::fMargin {}
protected

◆ fNeedsRecomputing

bool pongasoft::VST::GUI::Views::ScrollbarView::fNeedsRecomputing {true}
protected

◆ fOffsetPercentEditor

GUIRawVstParamEditor pongasoft::VST::GUI::Views::ScrollbarView::fOffsetPercentEditor {nullptr}
protected

◆ fOffsetPercentParam

GUIRawVstParam pongasoft::VST::GUI::Views::ScrollbarView::fOffsetPercentParam {}
protected

◆ fOffsetPercentTag

int32_t pongasoft::VST::GUI::Views::ScrollbarView::fOffsetPercentTag {-1}
protected

◆ fOffsetPercentValue

double pongasoft::VST::GUI::Views::ScrollbarView::fOffsetPercentValue {}
protected

◆ fRightHandleRect

AbsoluteRect pongasoft::VST::GUI::Views::ScrollbarView::fRightHandleRect
protected

◆ fScrollbarColor

CColor pongasoft::VST::GUI::Views::ScrollbarView::fScrollbarColor {kWhiteCColor}
protected

◆ fScrollbarGutterSpacing

CCoord pongasoft::VST::GUI::Views::ScrollbarView::fScrollbarGutterSpacing {1}
protected

◆ fScrollbarMinSize

CCoord pongasoft::VST::GUI::Views::ScrollbarView::fScrollbarMinSize {-1}
protected

◆ fScrollbarRect

AbsoluteRect pongasoft::VST::GUI::Views::ScrollbarView::fScrollbarRect
protected

◆ fShiftDragFactor

Range pongasoft::VST::GUI::Views::ScrollbarView::fShiftDragFactor {1.0}
protected

◆ fZoomBox

ZoomBox pongasoft::VST::GUI::Views::ScrollbarView::fZoomBox {}
protected

◆ fZoomHandlesColor

CColor pongasoft::VST::GUI::Views::ScrollbarView::fZoomHandlesColor {kWhiteCColor}
protected

◆ fZoomHandlesSize

CCoord pongasoft::VST::GUI::Views::ScrollbarView::fZoomHandlesSize {-1}
protected

◆ fZoomPercentEditor

GUIRawVstParamEditor pongasoft::VST::GUI::Views::ScrollbarView::fZoomPercentEditor {nullptr}
protected

◆ fZoomPercentParam

GUIRawVstParam pongasoft::VST::GUI::Views::ScrollbarView::fZoomPercentParam {}
protected

◆ fZoomPercentTag

int32_t pongasoft::VST::GUI::Views::ScrollbarView::fZoomPercentTag {-1}
protected

◆ fZoomPercentValue

double pongasoft::VST::GUI::Views::ScrollbarView::fZoomPercentValue {}
protected

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