]> git.donarmstrong.com Git - lilypond.git/blob - lily/key-performer.cc
release: 1.1.1
[lilypond.git] / lily / key-performer.cc
1 /*
2   key-performer.cc -- implement Key_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 "key-performer.hh"
10 #include "command-request.hh"
11 #include "audio-item.hh"
12
13
14
15 IMPLEMENT_IS_TYPE_B1(Key_performer,Performer);
16 ADD_THIS_TRANSLATOR(Key_performer);
17
18 Key_performer::Key_performer()
19 {
20   key_req_l_ = 0;
21 }
22
23 Key_performer::~Key_performer()
24 {
25 }
26
27 void 
28 Key_performer::do_print() const
29 {
30 #ifndef NPRINT
31   if (key_req_l_)
32     key_req_l_->print();
33 #endif
34 }
35
36 void
37 Key_performer::do_process_requests()
38 {
39   if (key_req_l_)
40     play (new Audio_key (key_req_l_));
41   key_req_l_ = 0;
42 }
43
44 bool
45 Key_performer::do_try_request (Request* req_l)
46 {
47   if (Key_change_req *kc = dynamic_cast <Key_change_req *> (req_l))
48     {
49       if (key_req_l_)
50         warning ("FIXME. Key change merge");
51
52       key_req_l_ = kc;
53       return true;
54     }
55
56   return false;
57 }
58