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

# ControllerC Class Reference

Value controller class. More...

`#include <ControllerC.h>`

Inheritance diagram for ControllerC:

List of all members.

## Public Member Functions
virtual Edit::DataBlockI * | create ()
| Creates new controller.
virtual Edit::DataBlockI * | create (Edit::EditableI *pOriginal)
| Creates new controller (used internally), see Edit::EditableI::create().
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::int32 | get_key_count ()
| Returns the number of keys inside the controller.
virtual KeyC * | get_key (PajaTypes::int32 i32Index)
| Returns pointer to a key pointed by the argument.
virtual void | del_key (PajaTypes::int32 i32Index)
| Deletes a key pointed by the argument.
virtual KeyC * | get_key_at_time (PajaTypes::int32 i32Time)
| Returns a key at specified time, else NULL.
virtual KeyC * | add_key_at_time (PajaTypes::int32 i32Time)
| Creates a new key at specified time and returns it.
virtual void | set_start_ort (PajaTypes::uint32 ui32Ort)
| Sets the start (time before the first key) out of range type.
virtual void | set_end_ort (PajaTypes::uint32 ui32Ort)
| Sets the end (time after last key) out of range type.
virtual PajaTypes::uint32 | get_start_ort ()
| Returns the start out fo range type.
virtual PajaTypes::uint32 | get_end_ort ()
| Returns the end out fo range type.
virtual void | sort_keys ()
| Sorts keys by time.
virtual void | prepare ()
| Prepares controller for interpolation.
virtual void | get_value (PajaTypes::float32 *pValues, PajaTypes::int32 i32Time)
| Returns the interpolated value of the controller at specified time.
virtual void | get_value (PajaTypes::int32 &i32Val, PajaTypes::int32 i32Time)
| Returns the interpolated value of the controller at specified time as a integer value.
virtual void | get_value (PajaTypes::float32 &f32Val, PajaTypes::int32 i32Time)
| Returns the interpolated value of the controller at specified time as a floating point values.
virtual void | get_value (PajaTypes::Vector2C &rVal, PajaTypes::int32 i32Time)
| Returns the interpolated value of the controller at specified time as a 3D vector.
virtual void | get_value (PajaTypes::Vector3C &rVal, PajaTypes::int32 i32Time)
| Returns the interpolated value of the controller at specified time as a 3D vector.
virtual void | get_value (PajaTypes::ColorC &rVal, PajaTypes::int32 i32Time)
| Returns the interpolated value of the controller at specified time as a color.
virtual void | get_value (Import::FileHandleC *&pHandle, PajaTypes::int32 &i32FileTime, PajaTypes::int32 i32Time)
| Returns the value of the controller at specified time as a file and file time.
virtual PajaTypes::int32 | get_min_time ()
| Returns the time of the first key.
virtual PajaTypes::int32 | get_max_time ()
| Returns the time of the last key.
virtual PajaTypes::uint32 | get_type ()
| Returns the type of the controller.
virtual void | set_type (PajaTypes::uint32 ui32Type)
| Sets the type of the controller.
virtual PajaTypes::uint32 | get_num_channels ()
| Returns number of channels this cintroller controls.
virtual PajaTypes::uint32 | save (FileIO::SaveC *pSave)
| Save editable to a Demopaja output stream.
virtual PajaTypes::uint32 | load (FileIO::LoadC *pLoad)
| Load editable from a Demopaja input stream.
## Static Public Member Functions
ControllerC * | create_new (ControllerTypeE eType)
| Creates new controller.
## Protected Member Functions
| ControllerC (ControllerTypeE eType)
| Default constructor.
| ControllerC (Edit::EditableI *pOriginal)
| Default constructor with reference to the original.
| ~ControllerC ()
| Default destructor.

## Detailed Description

Value controller class.

Controller class is used to control the animated parameter values in Demopaja. For user and coder the use of controllers are invisible. The parameter takes care of using the controller. In some cases it may be useful to use the controller directly.

Controller provides methods to add and delete keys, interpolate between set of keys,

This class is implemented by the system.

See also:
  KeyC

## Constructor & Destructor Documentation

ControllerC | ( | ControllerTypeE | eType | ) | `[protected]`

| Default constructor.

ControllerC | ( | Edit::EditableI * | pOriginal | ) | `[protected]`

| Default constructor with reference to the original.

~ControllerC | ( |  | ) | `[protected]`

| Default destructor.

## Member Function Documentation

virtual KeyC* add_key_at_time | ( | PajaTypes::int32 | i32Time | ) | `[virtual]`

| Creates a new key at specified time and returns it.

virtual void copy | ( | Edit::EditableI * | pEditable | ) | `[virtual]`

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

virtual Edit::DataBlockI* create | ( | Edit::EditableI * | pOriginal | ) | `[virtual]`

| Creates new controller (used internally), see Edit::EditableI::create(). Implements EditableI.

virtual Edit::DataBlockI* create | ( |  | ) | `[virtual]`

| Creates new controller. Use set_type() to set number of channels and the type of the controller. Implements EditableI.

ControllerC* create_new | ( | ControllerTypeE | eType | ) | `[static]`

  | Creates new controller. Parameters:
  eType | Type of controller to create.
This method creates new controller. The type defines the number of channels to use.

virtual void del_key | ( | PajaTypes::int32 | i32Index | ) | `[virtual]`

| Deletes a key pointed by the argument.

virtual PajaTypes::uint32 get_end_ort | ( |  | ) | `[virtual]`

| Returns the end out fo range type.

virtual KeyC* get_key | ( | PajaTypes::int32 | i32Index | ) | `[virtual]`

| Returns pointer to a key pointed by the argument.

virtual KeyC* get_key_at_time | ( | PajaTypes::int32 | i32Time | ) | `[virtual]`

| Returns a key at specified time, else NULL.

virtual PajaTypes::int32 get_key_count | ( |  | ) | `[virtual]`

| Returns the number of keys inside the controller.

virtual PajaTypes::int32 get_max_time | ( |  | ) | `[virtual]`

| Returns the time of the last key.

virtual PajaTypes::int32 get_min_time | ( |  | ) | `[virtual]`

| Returns the time of the first key.

virtual PajaTypes::uint32 get_num_channels | ( |  | ) | `[virtual]`

| Returns number of channels this cintroller controls. The channel count depends on the controller type. See also: ControllerTypeE

virtual PajaTypes::uint32 get_start_ort | ( |  | ) | `[virtual]`

| Returns the start out fo range type.

virtual PajaTypes::uint32 get_type | ( |  | ) | `[virtual]`

| Returns the type of the controller.

virtual void get_value | ( | Import::FileHandleC *& | pHandle,
|  | PajaTypes::int32 & | i32FileTime,
|  | PajaTypes::int32 | i32Time
| ) | `[virtual]`

| Returns the value of the controller at specified time as a file and file time. This methos calculates the time to pass to the importables eval_state() method based on the frame offset and time scale set in the key.

virtual void get_value | ( | PajaTypes::ColorC & | rVal,
|  | PajaTypes::int32 | i32Time
| ) | `[virtual]`

| Returns the interpolated value of the controller at specified time as a color.

virtual void get_value | ( | PajaTypes::Vector3C & | rVal,
|  | PajaTypes::int32 | i32Time
| ) | `[virtual]`

| Returns the interpolated value of the controller at specified time as a 3D vector.

virtual void get_value | ( | PajaTypes::Vector2C & | rVal,
|  | PajaTypes::int32 | i32Time
| ) | `[virtual]`

| Returns the interpolated value of the controller at specified time as a 3D vector.

virtual void get_value | ( | PajaTypes::float32 & | f32Val,
|  | PajaTypes::int32 | i32Time
| ) | `[virtual]`

| Returns the interpolated value of the controller at specified time as a floating point values.

virtual void get_value | ( | PajaTypes::int32 & | i32Val,
|  | PajaTypes::int32 | i32Time
| ) | `[virtual]`

| Returns the interpolated value of the controller at specified time as a integer value.

virtual void get_value | ( | PajaTypes::float32 * | pValues,
|  | PajaTypes::int32 | i32Time
| ) | `[virtual]`

| Returns the interpolated value of the controller at specified time. This method calculates the interpolated value based in the keys inside the controller. If no keys are present the return value will be zero for all channels. Maximum of KEY_MAXCHANNELS (currently 4) values are stored in the array pointed by the pValues parmeter. For easier access should one of the other get_value() methods be used.

virtual PajaTypes::uint32 load | ( | FileIO::LoadC * | pLoad | ) | `[virtual]`

| Load editable from a Demopaja input stream. Implements EditableI.

virtual void prepare | ( |  | ) | `[virtual]`

| Prepares controller for interpolation. This method has to be called after a new key is added to the controller, or the result of other methods may be incorrect. If the controller contains smooth keys the tangents are calculated by this method, else it does nothing.

virtual void restore | ( | Edit::EditableI * | pEditable | ) | `[virtual]`

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

virtual PajaTypes::uint32 save | ( | FileIO::SaveC * | pSave | ) | `[virtual]`

| Save editable to a Demopaja output stream. Implements EditableI.

virtual void set_end_ort | ( | PajaTypes::uint32 | ui32Ort | ) | `[virtual]`

| Sets the end (time after last key) out of range type.

virtual void set_start_ort | ( | PajaTypes::uint32 | ui32Ort | ) | `[virtual]`

| Sets the start (time before the first key) out of range type.

virtual void set_type | ( | PajaTypes::uint32 | ui32Type | ) | `[virtual]`

| Sets the type of the controller. This method should only be called for a controller which does not have any keys. It doesn't convert the keys and will lead in serious trouble if misused.

virtual void sort_keys | ( |  | ) | `[virtual]`

| Sorts keys by time. This method has to be called after a new key is added to the controller, or the result of other methods may be incorrect.