2 tempo-performer.cc -- implement Tempo_performer
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2003 Jan Nieuwenhuizen <janneke@gnu.org>
10 #include "audio-item.hh"
11 #include "performer.hh"
13 class Tempo_performer
: public Performer
16 TRANSLATOR_DECLARATIONS(Tempo_performer
);
21 virtual bool try_music (Music
* req
);
22 virtual void stop_translation_timestep ();
23 virtual void create_audio_elements ();
30 Tempo_performer::Tempo_performer ()
36 Tempo_performer::~Tempo_performer ()
42 Tempo_performer::create_audio_elements ()
47 SCM met
= tempo_req_
->get_mus_property ("metronome-count");
48 Duration
*d
= unsmob_duration (tempo_req_
->get_mus_property ("tempo-unit"));
50 Rational r
= (d
->get_length () / Moment (Rational (1, 4)) * Moment (gh_scm2int (met
))).main_part_
;
52 audio_
= new Audio_tempo (int (r
));
54 Audio_element_info
info (audio_
, tempo_req_
);
55 announce_element (info
);
61 Tempo_performer::stop_translation_timestep ()
65 play_element (audio_
);
71 Tempo_performer::try_music (Music
* req
)
83 ENTER_DESCRIPTION (Tempo_performer
, "","",