]> git.donarmstrong.com Git - lilypond.git/blob - lily/time-signature-performer.cc
aeed66b8068da901e47692ff22e45fbc0db73fdb
[lilypond.git] / lily / time-signature-performer.cc
1 /*
2   time-signature-performer.cc -- implement Time_signature_performer
3
4   source file of the GNU LilyPond music typesetter
5
6   (c)  1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
7 */
8
9 #include "time-signature-performer.hh"
10 #include "command-request.hh"
11 #include "audio-item.hh"
12
13 ADD_THIS_TRANSLATOR (Time_signature_performer);
14
15 Time_signature_performer::Time_signature_performer ()
16 {
17   time_signature_req_l_ = 0;
18   audio_p_ = 0;
19 }
20
21 Time_signature_performer::~Time_signature_performer ()
22 {
23 }
24
25 void 
26 Time_signature_performer::do_print () const
27 {
28 #ifndef NPRINT
29   if (time_signature_req_l_)
30     time_signature_req_l_->print ();
31 #endif
32 }
33
34 void
35 Time_signature_performer::do_process_music ()
36 {
37   if (time_signature_req_l_)
38     {
39       audio_p_ = new Audio_time_signature (time_signature_req_l_->beats_i_, time_signature_req_l_->one_beat_i_);
40       Audio_element_info info (audio_p_, time_signature_req_l_);
41       announce_element (info);
42       time_signature_req_l_ = 0;
43     }
44 }
45
46 void
47 Time_signature_performer::do_pre_move_processing ()
48 {
49   if (audio_p_)
50     {
51       play_element (audio_p_);
52       audio_p_ = 0;
53     }
54 }
55
56 bool
57 Time_signature_performer::do_try_music (Music* req_l)
58 {
59   if (time_signature_req_l_)
60     return false;
61
62   if (Time_signature_change_req *t =
63       dynamic_cast <Time_signature_change_req *> (req_l))
64     {
65       time_signature_req_l_ = t;
66       return true;
67     }
68
69   return false;
70 }
71