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

# TimeContextC Class Reference

Time context class. More...

`#include <TimeContextC.h>`

List of all members.

## Public Member Functions
| TimeContextC (PajaTypes::int32 i32BeatsPerMin, PajaTypes::int32 i32QNotesPerBeat, PajaTypes::int32 i32EditAccuracy)
| Default constructor (used internally).
virtual | ~TimeContextC ()
| Default destructor (used internally).
virtual PajaTypes::float64 | convert_fps_to_time (PajaTypes::float64 f64Time, PajaTypes::float64 f64FPS)
| Converts time in FPS timecode to Demopaja timecode.
virtual PajaTypes::float64 | convert_time_to_fps (PajaTypes::float64 f64FpsTime, PajaTypes::float64 f64FPS)
| Converts time in Demopaja timecode to FPS timecode.
virtual PajaTypes::int32 | get_beats_per_min () const
| Returns beats per minute (BPM).
virtual PajaTypes::int32 | get_qnotes_per_beat () const
| Returns quarter notes per beat.
virtual PajaTypes::int32 | get_edit_accuracy () const
| Returns edit accuracy.
virtual PajaTypes::int32 | get_frame_size_in_ticks () const
| Returns the size of one frame in ticks.
virtual PajaTypes::uint32 | get_frame_id () const
| Returns unique ID for a frame.
virtual void | set_frame_id (PajaTypes::uint32 ui32ID)
| Sets the frame ID, used internally.
virtual void | set_time_settings (PajaTypes::int32 i32BeatsPerMin, PajaTypes::int32 i32QNotesPerBeat, PajaTypes::int32 i32EditAccuracy)
| Sets the time settings, used internally.

## Detailed Description

Time context class.

Time context is helper class which provides the timing information to the effect plugin class. There are also couple of methods which helps converting timing information provided in FPS form to the Demopaja time and back.

This class is implemented by the system.

## Constructor & Destructor Documentation

TimeContextC | ( | PajaTypes::int32 | i32BeatsPerMin,
|  | PajaTypes::int32 | i32QNotesPerBeat,
|  | PajaTypes::int32 | i32EditAccuracy
| ) |

| Default constructor (used internally).

virtual ~TimeContextC | ( |  | ) | `[virtual]`

| Default destructor (used internally).

## Member Function Documentation

virtual PajaTypes::float64 convert_fps_to_time | ( | PajaTypes::float64 | f64Time,
|  | PajaTypes::float64 | f64FPS
| ) | `[virtual]`

  | Converts time in FPS timecode to Demopaja timecode. Parameters:
  f64Time | Time in FPS (frames per second) timecode
  f64FPS | Frames per second.
Example: The animation in a file is defined as 30 FPS and the first frame is 10 and last frame is 520, and you should convert the time in Demopaja system.
                int32   i32FPS = 30;
                int32   i32FirstFrame = 10;
                int32   i32LastFrame = 520;
                int32   i32Length = i32LastFrame - i32FirstFrame;
                // Convert the time. (FPS -> Demopaja)
                float64 f64Time = pTimeContext->convert_fps_to_time( i32Length, i32FPS );

virtual PajaTypes::float64 convert_time_to_fps | ( | PajaTypes::float64 | f64FpsTime,
|  | PajaTypes::float64 | f64FPS
| ) | `[virtual]`

  | Converts time in Demopaja timecode to FPS timecode. Parameters:
  f64Time | Time in Demopaja timecode
  f64FPS | Frames per second.
Example: Your animation is defined as 30 FPS, 160 ticks per frame, and you want to get the frame number at current time (i32Time in the example):
                int32   i32FPS = 30;
                int32   i32TicksPerFrame = 160;
                // Convert the time. (Demopaja -> FPS)
                m_i32Frame = (int32)(pTimeContext->convert_time_to_fps( i32Time, i32FPS ) * (float64)i32TicksPerFrame);
                // Adjust the animation to start at the first frame.
                m_i32Frame += i32FirstFrame * i32TicksPerFrame;

virtual PajaTypes::int32 get_beats_per_min | ( |  | ) | const`[virtual]`

| Returns beats per minute (BPM).

virtual PajaTypes::int32 get_edit_accuracy | ( |  | ) | const`[virtual]`

| Returns edit accuracy.

virtual PajaTypes::uint32 get_frame_id | ( |  | ) | const`[virtual]`

| Returns unique ID for a frame. Each time a frame is rendered the ID is incremented. The frame ID can be used to determine if a frame is rerendered, even the evaluation time has not changed.

virtual PajaTypes::int32 get_frame_size_in_ticks | ( |  | ) | const`[virtual]`

| Returns the size of one frame in ticks.

virtual PajaTypes::int32 get_qnotes_per_beat | ( |  | ) | const`[virtual]`

| Returns quarter notes per beat.

virtual void set_frame_id | ( | PajaTypes::uint32 | ui32ID | ) | `[virtual]`

| Sets the frame ID, used internally.

virtual void set_time_settings | ( | PajaTypes::int32 | i32BeatsPerMin,
|  | PajaTypes::int32 | i32QNotesPerBeat,
|  | PajaTypes::int32 | i32EditAccuracy
| ) | `[virtual]`

| Sets the time settings, used internally.