18 #include "directbase.h"
19 #include "typedReferenceCount.h"
21 #include "config_interval.h"
22 #include "pStatCollector.h"
41 CInterval(
const string &name,
double duration,
bool open_ended);
45 INLINE
const string &get_name()
const;
46 INLINE
double get_duration()
const;
47 INLINE
bool get_open_ended()
const;
54 ET_reverse_initialize,
67 INLINE State get_state()
const;
68 INLINE
bool is_stopped()
const;
70 INLINE
void set_done_event(
const string &event);
71 INLINE
const string &get_done_event()
const;
74 INLINE
double get_t()
const;
76 INLINE
void set_auto_pause(
bool auto_pause);
77 INLINE
bool get_auto_pause()
const;
78 INLINE
void set_auto_finish(
bool auto_finish);
79 INLINE
bool get_auto_finish()
const;
81 INLINE
void set_wants_t_callback(
bool wants_t_callback);
82 INLINE
bool get_wants_t_callback()
const;
87 void start(
double start_t = 0.0,
double end_t = -1.0,
double play_rate = 1.0);
88 void loop(
double start_t = 0.0,
double end_t = -1.0,
double play_rate = 1.0);
91 void resume(
double start_t);
92 void resume_until(
double end_t);
94 void clear_to_initial();
95 bool is_playing()
const;
97 double get_play_rate()
const;
98 void set_play_rate(
double play_rate);
108 void priv_do_event(
double t, EventType event);
109 virtual void priv_initialize(
double t);
110 virtual void priv_instant();
111 virtual void priv_step(
double t);
112 virtual void priv_finalize();
113 virtual void priv_reverse_initialize(
double t);
114 virtual void priv_reverse_instant();
115 virtual void priv_reverse_finalize();
116 virtual void priv_interrupt();
118 virtual void output(ostream &out)
const;
119 virtual void write(ostream &out,
int indent_level)
const;
121 void setup_play(
double start_time,
double end_time,
double play_rate,
124 void setup_resume_until(
double end_t);
129 INLINE
bool check_t_callback();
132 void interval_done();
134 INLINE
void recompute()
const;
135 virtual void do_recompute();
136 INLINE
void check_stopped(
TypeHandle type,
const char *method_name)
const;
137 INLINE
void check_started(
TypeHandle type,
const char *method_name)
const;
148 bool _wants_t_callback;
149 double _last_t_callback;
157 bool _start_t_at_start;
180 static void init_type() {
181 TypedReferenceCount::init_type();
182 register_type(_type_handle,
"CInterval",
183 TypedReferenceCount::get_class_type());
186 return get_class_type();
188 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
196 INLINE ostream &operator << (ostream &out,
const CInterval &ival);
197 EXPCL_DIRECT ostream &operator << (ostream &out, CInterval::State state);
199 #include "cInterval.I"
The base class for timeline components.
A base class for things which need to inherit from both TypedObject and from ReferenceCount.
A lightweight class that represents a single element that may be timed and/or counted via stats...
This object holds a number of currently-playing intervals and is responsible for advancing them each ...
TypeHandle is the identifier used to differentiate C++ class types.