2 time-signature-performer.cc -- implement Time_signature_performer
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2007 Jan Nieuwenhuizen <janneke@gnu.org>
9 #include "audio-item.hh"
10 #include "performer.hh"
11 #include "protected-scm.hh"
13 class Time_signature_performer : public Performer
16 TRANSLATOR_DECLARATIONS (Time_signature_performer);
17 ~Time_signature_performer ();
21 void stop_translation_timestep ();
22 void process_music ();
23 virtual void derived_mark () const;
27 Audio_time_signature *audio_;
31 Time_signature_performer::derived_mark () const
33 scm_gc_mark (prev_fraction_);
36 Time_signature_performer::Time_signature_performer ()
38 prev_fraction_ = SCM_BOOL_F;
42 Time_signature_performer::~Time_signature_performer ()
47 Time_signature_performer::process_music ()
49 SCM fr = get_property ("timeSignatureFraction");
50 if (scm_is_pair (fr) && !ly_is_equal (fr, prev_fraction_))
53 int b = scm_to_int (scm_car (fr));
54 int o = scm_to_int (scm_cdr (fr));
56 audio_ = new Audio_time_signature (b, o);
57 Audio_element_info info (audio_, 0);
58 announce_element (info);
63 Time_signature_performer::stop_translation_timestep ()
71 #include "translator.icc"
73 ADD_TRANSLATOR (Time_signature_performer,