]> git.donarmstrong.com Git - lilypond.git/blob - lily/time-signature-performer.cc
release: 1.1.0
[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--1998 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 IMPLEMENT_IS_TYPE_B1(Time_signature_performer,Performer);
14 ADD_THIS_TRANSLATOR(Time_signature_performer);
15
16 Time_signature_performer::Time_signature_performer()
17 {
18   time_signature_req_l_ = 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_requests()
36 {
37   if (time_signature_req_l_)
38     play (new Audio_time_signature (time_signature_req_l_));
39   time_signature_req_l_ = 0;
40 }
41
42 bool
43 Time_signature_performer::do_try_request (Request* req_l)
44 {
45   if (time_signature_req_l_)
46     return false;
47
48   if (dynamic_cast <Command_req *> (req_l))
49     time_signature_req_l_ = dynamic_cast <Time_signature_change_req *> (req_l);
50
51   if (time_signature_req_l_)
52     return true;
53
54   return false;
55 }
56