Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   Related Pages  

ParamIntC Class Reference

Integer parameter class. More...

#include <ParamI.h>

Inheritance diagram for ParamIntC:

ParamI EditableI DataBlockI List of all members.

Public Methods

virtual Edit::DataBlockIcreate ()
 Creates new parameter.

virtual Edit::DataBlockIcreate (Edit::EditableI *pOriginal)
 Creates new datablock, with reference to the original.

virtual void copy (Edit::EditableI *pEditable)
 Deep copy from a data block, see Edit::DataBlockI::copy().

virtual void restore (Edit::EditableI *pEditable)
 Shallow copy from a editable, see Edit::EditableI::restore().

virtual PajaTypes::uint32 get_type () const
 Returns the type of the parameter.

virtual void set_controller (ControllerC *cnt)
 Sets the controller of the parameter.

virtual ControllerCget_controller ()
 Returns the conroller attached to the parameter.

virtual void set_min_max (PajaTypes::int32 i32Min, PajaTypes::int32 i32Max)
 Sets the range of the parameter.

virtual PajaTypes::int32 get_min () const
 Returns the minimum of the value range.

virtual PajaTypes::int32 get_max () const
 Returns the maximum of the value range.

virtual void set_increment (PajaTypes::float32 inc)
 Sets the spinner increment of the parameter.

virtual PajaTypes::float32 get_increment () const
 Returns the spinner increment.

virtual bool get_min_max (PajaTypes::float32 *pMin, PajaTypes::float32 *pMax)
 Returns the range of the parameter.

virtual void set_style (PajaTypes::uint32 style)
 Sets the style of the parameter.

virtual PajaTypes::uint32 get_style () const
 Returns the style of the parameter.

virtual void set_id (PajaTypes::uint32 id)
 Sets the ID of the parmeter.

virtual PajaTypes::uint32 get_id () const
 Returns the ID of the parameter.

virtual void clear_labels ()
 Clears all labels.

virtual void add_label (PajaTypes::int32 i32Val, const char *szName)
 Adds a value label.

virtual void add_label (PajaTypes::int32 i32Val, const std::string &sName)
 Adds a value label.

virtual PajaTypes::uint32 get_label_count () const
 Returns number of labels.

virtual const char * get_label_name (PajaTypes::uint32 i)
 Returns the name of the label at specified index.

virtual PajaTypes::int32 get_label_value (PajaTypes::uint32 i)
 Returns the value of the label at specified index.

virtual void remove_label (PajaTypes::int32 val)
 Removes the label at specified index.

virtual PajaTypes::uint32 set_val (PajaTypes::int32 t, const PajaTypes::int32 &val)
 Sets the value of the parameter at specified time.

virtual void get_val (PajaTypes::int32 t, PajaTypes::int32 &val)
 Gets the value of the parameter at specified time.

virtual PajaTypes::uint32 save (FileIO::SaveC *pSave)
 Serialize the parameter to a Demopaja output stream.

virtual PajaTypes::uint32 load (FileIO::LoadC *pLoad)
 Serialize the parameter from a Demopaja input stream.


Static Public Methods

ParamIntC * create_new (GizmoI *pParent, const char *szName, PajaTypes::int32 i32Value, PajaTypes::uint32 ui32ID, PajaTypes::uint32 ui32Style=PARAM_STYLE_EDITBOX, bool bAnimatable=true, PajaTypes::int32 i32Min=0, PajaTypes::int32 i32Max=0, PajaTypes::int32 i32Inc=1)
 Creates a new integer parameter.


Protected Methods

 ParamIntC ()
 Default constructor.

 ParamIntC (GizmoI *pParent, const char *name, PajaTypes::int32 value, PajaTypes::uint32 id, PajaTypes::uint32 style=PARAM_STYLE_EDITBOX, bool animatable=true, PajaTypes::int32 min=0, PajaTypes::int32 max=0, PajaTypes::int32 inc=1)
 Constructor.

 ParamIntC (Edit::EditableI *pOriginal)
 Constructor with reference to the original.

virtual ~ParamIntC ()
 Default destructor.


Detailed Description

Integer parameter class.

The integer parameter can be used to coltrol parameters which can be represent as integers. This parameter also gives a possibility to have set of predefined values, which can be named, and selected using a combobox control.

Even this is integer parameter the internal format is 32-bit float. So it is not possible to access the whole 32-bit integer range.

A new integer parameter is created using the create_new() static method.


Constructor & Destructor Documentation

ParamIntC   [protected]
 

Default constructor.

ParamIntC GizmoI   pParent,
const char *    name,
PajaTypes::int32    value,
PajaTypes::uint32    id,
PajaTypes::uint32    style = PARAM_STYLE_EDITBOX,
bool    animatable = true,
PajaTypes::int32    min = 0,
PajaTypes::int32    max = 0,
PajaTypes::int32    inc = 1
[protected]
 

Constructor.

ParamIntC Edit::EditableI   pOriginal [protected]
 

Constructor with reference to the original.

virtual ~ParamIntC   [protected, virtual]
 

Default destructor.


Member Function Documentation

virtual void add_label PajaTypes::int32    i32Val,
const std::string &    sName
[virtual]
 

Adds a value label.

Parameters:
i32Val  Value to bind the label.
sName  Name of the value as STL string.

virtual void add_label PajaTypes::int32    i32Val,
const char *    szName
[virtual]
 

Adds a value label.

Parameters:
i32Val  Value to bind the label.
szName  Name of the value as NULL terminated string.

virtual void clear_labels   [virtual]
 

Clears all labels.

virtual void copy Edit::EditableI   pEditable [virtual]
 

Deep copy from a data block, see Edit::DataBlockI::copy().

Reimplemented from ParamI.

virtual Edit::DataBlockI* create Edit::EditableI   pOriginal [virtual]
 

Creates new datablock, with reference to the original.

Parameters:
pOriginal  Pointer to the original editable. This method is used by the undo system to create a copy of the editable while keeping reference to the original.
The method restore() is used to restore the data from the original copy.

Implements EditableI.

virtual Edit::DataBlockI* create   [virtual]
 

Creates new parameter.

Following default values are used:

            pParent = 0,
            szName = 0,
            i32Value = 0,
            ui32ID = 0,
            ui32Style = 0,
            bAnimatable = false,
            i32Min = 0,
            i32Max = 0,
            i32Inc = 1

See also:
create_new

Implements EditableI.

ParamIntC* create_new GizmoI   pParent,
const char *    szName,
PajaTypes::int32    i32Value,
PajaTypes::uint32    ui32ID,
PajaTypes::uint32    ui32Style = PARAM_STYLE_EDITBOX,
bool    bAnimatable = true,
PajaTypes::int32    i32Min = 0,
PajaTypes::int32    i32Max = 0,
PajaTypes::int32    i32Inc = 1
[static]
 

Creates a new integer parameter.

Parameters:
pParent  Pointer to the parent gizmo.
szName  The name of the parameter as NULL terminated string.
i32Value  Start value of the parameter.
ui32ID  ID of the parameter.
ui32Style  The style of the parameter. Can be PARAM_STYLE_EDITBOX or PARAM_STYLE_COMBOBOX. Default PARAM_STYLE_EDITBOX.
bAnimatable  If set true the parameter is animatable, else it's not (you may use PARAM_ANIMATABLE or PARAM_NOT_ANIMATABLE too). Default true.
i32Min  The minimum of the parameter value range. Default 0.
i32Max  The maximum of the parameter value range. Default 0.
i32Inc  The increment of the value spinner in type-in.
If minimum and maximum of the range are same no range checking is used.

If the stype is PARAM_STYLE_COMBOBOX only labeled values can be selected from the type-in.

Example: This example creates new parameter. The name of the parameter is "Filter mode", it's default value is 0 (zero) and it's ID is ID_FILTERMODE (constant defined by the plugin writer), the type-in style is combobox, the parameter can be animated, and the value range of the parameter is from 0 to 1. Also labels are defined for values 0, and 1. Default increment value 1 is used.

            m_pParamFilterMode = ParamIntC::create_new( this, "Filter mode", 0, ID_FILTERMODE,
                                                        PARAM_STYLE_COMBOBOX, PARAM_ANIMATABLE, 0, 1 );
            m_pParamFilterMode->add_label( 0, "Bilinear" );
            m_pParamFilterMode->add_label( 1, "Nearest" );

virtual ControllerC* get_controller   [virtual]
 

Returns the conroller attached to the parameter.

NULL is returned if the parameter cannot be animated.

Implements ParamI.

virtual PajaTypes::uint32 get_id   const [virtual]
 

Returns the ID of the parameter.

Implements ParamI.

virtual PajaTypes::float32 get_increment   const [virtual]
 

Returns the spinner increment.

Implements ParamI.

virtual PajaTypes::uint32 get_label_count   const [virtual]
 

Returns number of labels.

virtual const char* get_label_name PajaTypes::uint32    i [virtual]
 

Returns the name of the label at specified index.

virtual PajaTypes::int32 get_label_value PajaTypes::uint32    i [virtual]
 

Returns the value of the label at specified index.

virtual PajaTypes::int32 get_max   const [virtual]
 

Returns the maximum of the value range.

virtual PajaTypes::int32 get_min   const [virtual]
 

Returns the minimum of the value range.

virtual bool get_min_max PajaTypes::float32   pMin,
PajaTypes::float32   pMax
[virtual]
 

Returns the range of the parameter.

Parameters:
pMin  pointer to a array of maximum of KEY_MAXCHANNEL floats.
pMax  pointer to a array of maximum of KEY_MAXCHANNEL floats.
If the type of the parameter id not know use arrays of KEY_MAXCHANNEL floats.

Returns :
true if the range is valid, false if the range is not used.

Implements ParamI.

virtual PajaTypes::uint32 get_style   const [virtual]
 

Returns the style of the parameter.

Implements ParamI.

virtual PajaTypes::uint32 get_type   const [virtual]
 

Returns the type of the parameter.

Implements ParamI.

virtual void get_val PajaTypes::int32    t,
PajaTypes::int32   val
[virtual]
 

Gets the value of the parameter at specified time.

virtual PajaTypes::uint32 load FileIO::LoadC   pLoad [virtual]
 

Serialize the parameter from a Demopaja input stream.

Reimplemented from ParamI.

virtual void remove_label PajaTypes::int32    val [virtual]
 

Removes the label at specified index.

virtual void restore Edit::EditableI   pEditable [virtual]
 

Shallow copy from a editable, see Edit::EditableI::restore().

Reimplemented from ParamI.

virtual PajaTypes::uint32 save FileIO::SaveC   pSave [virtual]
 

Serialize the parameter to a Demopaja output stream.

Reimplemented from ParamI.

virtual void set_controller ControllerC   cnt [virtual]
 

Sets the controller of the parameter.

Implements ParamI.

virtual void set_id PajaTypes::uint32    id [virtual]
 

Sets the ID of the parmeter.

Implements ParamI.

virtual void set_increment PajaTypes::float32    inc [virtual]
 

Sets the spinner increment of the parameter.

The spinner increment is the smallest value the parameter is meant to control. For 1/10th accuracy use spinner increment of 0.1. The spinner increment is used in the spinners of the type-ins and also to draw the values in the GUI.

Implements ParamI.

virtual void set_min_max PajaTypes::int32    i32Min,
PajaTypes::int32    i32Max
[virtual]
 

Sets the range of the parameter.

virtual void set_style PajaTypes::uint32    style [virtual]
 

Sets the style of the parameter.

Implements ParamI.

virtual PajaTypes::uint32 set_val PajaTypes::int32    t,
const PajaTypes::int32   val
[virtual]
 

Sets the value of the parameter at specified time.


Moppi Demopaja SDK Documentation -- Copyright © 2000-2002 Moppi Productions