* lily/paper-book.cc: remove copyright & tagline. Remove
[lilypond.git] / lily / time-signature-performer.cc
blob3d3e26d3273a93a44685fa820245295bf5a3a76e
1 /*
2 time-signature-performer.cc -- implement Time_signature_performer
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2004 Jan Nieuwenhuizen <janneke@gnu.org>
7 */
9 #include "audio-item.hh"
10 #include "lily-proto.hh"
11 #include "performer.hh"
14 class Time_signature_performer : public Performer
16 public:
17 TRANSLATOR_DECLARATIONS (Time_signature_performer);
18 ~Time_signature_performer ();
20 protected:
22 virtual void stop_translation_timestep ();
23 virtual void create_audio_elements ();
25 SCM prev_fraction_;
26 private:
28 Audio_time_signature* audio_;
32 Time_signature_performer::Time_signature_performer ()
34 prev_fraction_ = SCM_BOOL_F;
35 audio_ = 0;
38 Time_signature_performer::~Time_signature_performer ()
43 void
44 Time_signature_performer::create_audio_elements ()
46 SCM fr = get_property ("timeSignatureFraction");
47 if (ly_c_pair_p (fr) && !ly_c_equal_p (fr, prev_fraction_))
49 prev_fraction_ = fr;
50 int b = ly_scm2int (ly_car (fr));
51 int o = ly_scm2int (ly_cdr (fr));
53 audio_ = new Audio_time_signature (b,o);
54 Audio_element_info info (audio_, 0);
55 announce_element (info);
60 void
61 Time_signature_performer::stop_translation_timestep ()
63 if (audio_)
65 play_element (audio_);
66 audio_ = 0;
70 ENTER_DESCRIPTION (Time_signature_performer,"","","","","","");