00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
#ifndef OPENCAL_TIMETRACK_H
00012
#define OPENCAL_TIMETRACK_H
00013
00014
00015
#include <OpenCAL/global.h>
00016
00017
00018
namespace OpenCAL
00019 {
00020
00021
class KeyFrameSystem;
00022
00029 class OPENCAL_API TimeTrack
00030 {
00031
protected:
00032
00033
KeyFrameSystem *m_keyFrameSystem;
00034
float m_currentTime, m_length;
00035
bool m_loop, m_stopped;
00036
00037
public:
00038
00039 TimeTrack(
KeyFrameSystem *keyFrameSystem);
00040
virtual ~TimeTrack();
00041
00042
00043
KeyFrameSystem *getKeyFrameSystem() {
return m_keyFrameSystem; }
00044
float getCurrentTime()
const {
return m_currentTime; }
00045
float getLength()
const {
return m_length; }
00046
bool isLooping()
const {
return m_loop; }
00047
bool isStopped()
const {
return m_stopped; }
00048
00049
00050
void setLoop(
bool loop) { m_loop = loop; }
00051
00052
00053
void step(
float deltaSeconds);
00054
void rewind();
00055
void setTime(
float time);
00056
00057
00058
void pause() { m_stopped =
true; }
00059
void unpause() { m_stopped =
false; }
00060
00061
virtual void apply() = 0;
00062
00063
protected:
00064
00065
float applySpeed()
const;
00066 };
00067 }
00068
00069
#endif // OPENCAL_TIMETRACK_H