Use `transform'.
[lilypond.git] / lily / time-signature-performer.cc
blob3e57a2c02c6b35114a5e3fad606da53e5dc89a3d
1 /*
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>
7 */
9 #include "audio-item.hh"
10 #include "performer.hh"
11 #include "protected-scm.hh"
13 class Time_signature_performer : public Performer
15 public:
16 TRANSLATOR_DECLARATIONS (Time_signature_performer);
17 ~Time_signature_performer ();
19 protected:
21 void stop_translation_timestep ();
22 void process_music ();
23 virtual void derived_mark () const;
24 SCM prev_fraction_;
25 private:
27 Audio_time_signature *audio_;
30 void
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;
39 audio_ = 0;
42 Time_signature_performer::~Time_signature_performer ()
46 void
47 Time_signature_performer::process_music ()
49 SCM fr = get_property ("timeSignatureFraction");
50 if (scm_is_pair (fr) && !ly_is_equal (fr, prev_fraction_))
52 prev_fraction_ = fr;
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);
62 void
63 Time_signature_performer::stop_translation_timestep ()
65 if (audio_)
67 audio_ = 0;
71 #include "translator.icc"
73 ADD_TRANSLATOR (Time_signature_performer, "", "", "", "");