lilypond-1.3.28
[lilypond.git] / lily / key-performer.cc
blobd026cf590de28b1154b8605d79f8222ed652d540
1 /*
2 key-performer.cc -- implement Key_performer
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2000 Jan Nieuwenhuizen <janneke@gnu.org>
7 */
9 #include "key-performer.hh"
10 #include "command-request.hh"
11 #include "audio-item.hh"
16 ADD_THIS_TRANSLATOR (Key_performer);
18 Key_performer::Key_performer ()
20 key_req_l_ = 0;
21 audio_p_ = 0;
24 Key_performer::~Key_performer ()
28 void
29 Key_performer::do_print () const
31 #ifndef NPRINT
32 if (key_req_l_)
33 key_req_l_->print ();
34 #endif
37 void
38 Key_performer::do_process_requests ()
40 if (key_req_l_)
42 audio_p_ = new Audio_key (key_req_l_->key_);
43 Audio_element_info info (audio_p_, key_req_l_);
44 announce_element (info);
45 key_req_l_ = 0;
49 void
50 Key_performer::do_pre_move_processing ()
52 if (audio_p_)
54 play_element (audio_p_);
55 audio_p_ = 0;
59 bool
60 Key_performer::do_try_music (Music* req_l)
62 if (Key_change_req *kc = dynamic_cast <Key_change_req *> (req_l))
64 if (key_req_l_)
65 warning (_ ("FIXME: key change merge"));
67 key_req_l_ = kc;
68 return true;
71 return false;