2 time-signature-performer.cc -- implement Time_signature_performer
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2005 Jan Nieuwenhuizen <janneke@gnu.org>
9 #include "audio-item.hh"
10 #include "performer.hh"
12 class Time_signature_performer : public Performer
15 TRANSLATOR_DECLARATIONS (Time_signature_performer);
16 ~Time_signature_performer ();
20 virtual void stop_translation_timestep ();
21 virtual void create_audio_elements ();
26 Audio_time_signature* audio_;
30 Time_signature_performer::Time_signature_performer ()
32 prev_fraction_ = SCM_BOOL_F;
36 Time_signature_performer::~Time_signature_performer ()
42 Time_signature_performer::create_audio_elements ()
44 SCM fr = get_property ("timeSignatureFraction");
45 if (scm_is_pair (fr) && !ly_c_equal_p (fr, prev_fraction_))
48 int b = scm_to_int (scm_car (fr));
49 int o = scm_to_int (scm_cdr (fr));
51 audio_ = new Audio_time_signature (b, o);
52 Audio_element_info info (audio_, 0);
53 announce_element (info);
59 Time_signature_performer::stop_translation_timestep ()
63 play_element (audio_);
68 ADD_TRANSLATOR (Time_signature_performer, "", "", "", "", "", "");