void Demo::add_stage(const std::string &name, Stage &stage)
{
things[name] = &stage;
- stage.add_things(things, name+".");
+ string prefix = name+".";
+ stage.add_things(things, prefix);
+ stage.define_actions(sequencer, prefix);
}
void Demo::set_fixed_framerate(float fps)
register_action_type<Stage::SetCamera>("set_camera");
}
+void Sequencer::define_action(const string &name, Action &act)
+{
+ named_actions[name] = &act;
+}
+
void Sequencer::set_beats_per_minute(float bpm)
{
secs_per_beat = Time::min/bpm;
template<typename T>
void register_action_type(const std::string &);
+ void define_action(const std::string &, Action &);
void set_beats_per_minute(float);
float get_beats_per_minute() const { return Msp::Time::min/secs_per_beat; }
~Stage();
virtual void add_things(Demo::ThingMap &, const std::string &);
+ virtual void define_actions(Sequencer &, const std::string &) { }
void set_camera(const Msp::GL::Camera &);
Msp::GL::Camera &get_camera() { return camera; }