2 time-signature-performer.cc -- implement Time_signature_performer
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2002 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 TRANSLATOR_DECLARATIONS(Time_signature_performer);
18 ~Time_signature_performer ();
22 virtual void stop_translation_timestep ();
23 virtual void create_audio_elements ();
28 Audio_time_signature* audio_;
32 Time_signature_performer::Time_signature_performer ()
34 prev_fraction_ = SCM_BOOL_F;
38 Time_signature_performer::~Time_signature_performer ()
44 Time_signature_performer::create_audio_elements ()
46 SCM fr = get_property ("timeSignatureFraction");
47 if (gh_pair_p (fr) && !gh_equal_p (fr, prev_fraction_))
50 int b = gh_scm2int (ly_car (fr));
51 int o = gh_scm2int (ly_cdr (fr));
53 audio_ = new Audio_time_signature (b,o);
54 Audio_element_info info (audio_, 0);
55 announce_element (info);
61 Time_signature_performer::stop_translation_timestep ()
65 play_element (audio_);
70 ENTER_DESCRIPTION(Time_signature_performer,"","","","","","");