Jamba C++ API  4.0.0
GUIDiscreteValParameter Class Reference

Simple extension class to treat a Val parameter as a discrete one. More...

#include <GUIValParameter.h>

Inherits GUIValParameter< int32 >.

Public Member Functions

int32 getStepCount () const override
 When a parameter is a discrete parameter (which means its underlying backing type is an int32 with values in the discrete range [0, getStepCount()]), this method will return the number of steps (> 0). More...
 
 GUIDiscreteValParameter (ParamID iParamID, int32 iDefaultValue, int32 iStepCount)
 
- Public Member Functions inherited from GUIValParameter< int32 >
tresult accessValue (typename ITGUIParameter< int32 >::ValueAccessor const &iGetter) const override
 
std::shared_ptr< GUIDiscreteParameterasDiscreteParameter (int32 iStepCount) override
 Converts this parameter into a discrete parameter. More...
 
std::unique_ptr< FObjectCxconnect (Parameters::IChangeListener *iChangeListener) const override
 
std::unique_ptr< FObjectCxconnect (Parameters::ChangeCallback iChangeCallback) const override
 
std::unique_ptr< EditorTypeedit () override
 
ParamID getParamID () const override
 Each parameter has a unique ID returned by this method. More...
 
int32 getStepCount () const override
 When a parameter is a discrete parameter (which means its underlying backing type is an int32 with values in the discrete range [0, getStepCount()]), this method will return the number of steps (> 0). More...
 
ParamType const & getValue () const
 
ParamTypegetValue ()
 
 GUIValParameter (ParamID iParamID, ParamType const &iDefaultValue)
 
 GUIValParameter (ParamID iParamID, ParamType &&iDefaultValue)
 
void setParamID (ParamID iParamID)
 
tresult setValue (ParamType const &iValue) override
 Sets the value. More...
 
tresult setValue (ParamType &&iValue)
 Sets the value. More...
 
std::string toUTF8String (int32 iPrecision) const override
 Returns the current value of the parameter as a string (which is properly UTF-8 encoded). More...
 
bool update (ParamType const &iValue) override
 Update the parameter with a value. More...
 
bool updateIf (ValueModifier const &iValueModifier)
 Use this flavor of update if you want to modify the value itself. More...
 
 ~GUIValParameter () override
 
- Public Member Functions inherited from ITGUIParameter< int32 >
virtual tresult accessValue (ValueAccessor const &iGetter) const=0
 API to access the underlying value. More...
 
virtual std::unique_ptr< ITEditor > edit (ParamType const &iValue)
 Shortcut api which creates an editor followed by ITEditor::setValue(ParamType const &) to set the parameter value to iValue. More...
 
- Public Member Functions inherited from IGUIParameter
template<typename T >
std::shared_ptr< ITGUIParameter< T > > cast ()
 Downcasts this parameter into a typed version. More...
 

Protected Attributes

int32 fStepCount
 
- Protected Attributes inherited from GUIValParameter< int32 >
ParamID fParamID
 
int32 fValue
 

Additional Inherited Members

- Public Types inherited from GUIValParameter< int32 >
using EditorType = typename ITGUIParameter< int32 >::ITEditor
 
using ParamType = int32
 
- Public Types inherited from ITGUIParameter< int32 >
using ParamType = int32
 The type of the param (alias) More...
 
using ValueAccessor = std::function< void(int32 const &)>
 API to access the value of the param. More...
 

Detailed Description

Simple extension class to treat a Val parameter as a discrete one.

Note
GUIValParameter is internal and not shared across views. As a result this implementation does not wrap another GUIValParameter (like GUIJmbParameter implementation does) which suffices for the current need. If GUIValParameter gets promoted to api level at a later date, then this implementation will need to be changed.
Private API
This is part of the internal/private API of Jamba and should not be used directly.

Constructor & Destructor Documentation

◆ GUIDiscreteValParameter()

GUIDiscreteValParameter ( ParamID  iParamID,
int32  iDefaultValue,
int32  iStepCount 
)
inline

Member Function Documentation

◆ getStepCount()

int32 getStepCount ( ) const
inlineoverridevirtual

When a parameter is a discrete parameter (which means its underlying backing type is an int32 with values in the discrete range [0, getStepCount()]), this method will return the number of steps (> 0).

Note
Although a parameter may not be a discrete parameter itself, the method asDiscreteParameter(int32) may be able to convert/adapt it to one.
Returns
the number of steps which is > 0 if and only if this parameter is a discrete parameter.

Implements IGUIParameter.

Member Data Documentation

◆ fStepCount

int32 fStepCount
protected

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