]> git.donarmstrong.com Git - lilypond.git/blob - lily/time-signature-performer.cc
release: 1.3.93
[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
26 void
27 Time_signature_performer::do_process_music ()
28 {
29   if (time_signature_req_l_)
30     {
31       audio_p_ = new Audio_time_signature (time_signature_req_l_->beats_i_, time_signature_req_l_->one_beat_i_);
32       Audio_element_info info (audio_p_, time_signature_req_l_);
33       announce_element (info);
34       time_signature_req_l_ = 0;
35     }
36 }
37
38 void
39 Time_signature_performer::do_pre_move_processing ()
40 {
41   if (audio_p_)
42     {
43       play_element (audio_p_);
44       audio_p_ = 0;
45     }
46 }
47
48 bool
49 Time_signature_performer::do_try_music (Music* req_l)
50 {
51   if (time_signature_req_l_)
52     return false;
53
54   if (Time_signature_change_req *t =
55       dynamic_cast <Time_signature_change_req *> (req_l))
56     {
57       time_signature_req_l_ = t;
58       return true;
59     }
60
61   return false;
62 }
63