2 tempo-performer.cc -- implement Tempo_performer
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
9 #include "command-request.hh"
10 #include "audio-item.hh"
11 #include "performer.hh"
13 class Tempo_performer : public Performer
16 VIRTUAL_COPY_CONS(Translator);
23 virtual bool try_music (Music* req_l);
24 virtual void stop_translation_timestep ();
25 virtual void create_grobs ();
28 Tempo_req* tempo_req_l_;
29 Audio_tempo* audio_p_;
32 ADD_THIS_TRANSLATOR (Tempo_performer);
34 Tempo_performer::Tempo_performer ()
40 Tempo_performer::~Tempo_performer ()
46 Tempo_performer::create_grobs ()
51 SCM met = tempo_req_l_->get_mus_property ("metronome-count");
52 audio_p_ = new Audio_tempo (tempo_req_l_->dur_.length_mom () /
54 * Moment(gh_scm2int (met)));
56 Audio_element_info info (audio_p_, tempo_req_l_);
57 announce_element (info);
63 Tempo_performer::stop_translation_timestep ()
67 play_element (audio_p_);
73 Tempo_performer::try_music (Music* req_l)
79 dynamic_cast <Tempo_req *> (req_l))