2 time-signature-performer.cc -- implement Time_signature_performer
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2001 Jan Nieuwenhuizen <janneke@gnu.org>
9 #include "audio-item.hh"
10 #include "lily-proto.hh"
11 #include "performer.hh"
14 class Time_signature_performer : public Performer
17 VIRTUAL_COPY_CONS(Translator);
19 Time_signature_performer();
20 ~Time_signature_performer();
24 virtual void stop_translation_timestep ();
25 virtual void create_audio_elements ();
29 Time_signature_change_req* time_signature_req_l_;
30 Audio_time_signature* audio_p_;
34 Time_signature_performer::Time_signature_performer ()
36 prev_fraction_ = SCM_BOOL_F;
40 Time_signature_performer::~Time_signature_performer ()
46 Time_signature_performer::create_audio_elements ()
48 SCM fr = get_property ("timeSignatureFraction");
50 && scm_equal_p (fr, prev_fraction_) != SCM_BOOL_T)
53 int b = gh_scm2int (gh_car (fr));
54 int o = gh_scm2int (gh_cdr (fr));
56 audio_p_ = new Audio_time_signature (b,o);
57 Audio_element_info info (audio_p_, 0);
58 announce_element (info);
59 time_signature_req_l_ = 0;
64 Time_signature_performer::stop_translation_timestep ()
68 play_element (audio_p_);
72 ADD_THIS_TRANSLATOR (Time_signature_performer);