lilypond-1.3.12
[lilypond.git] / lily / time-signature-performer.cc
blob9a326de1d1f4d91ddf78b8247903834e9c2b672e
1 /*
2 time-signature-performer.cc -- implement Time_signature_performer
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
7 */
9 #include "time-signature-performer.hh"
10 #include "command-request.hh"
11 #include "audio-item.hh"
13 ADD_THIS_TRANSLATOR (Time_signature_performer);
15 Time_signature_performer::Time_signature_performer ()
17 time_signature_req_l_ = 0;
18 audio_p_ = 0;
21 Time_signature_performer::~Time_signature_performer ()
25 void
26 Time_signature_performer::do_print () const
28 #ifndef NPRINT
29 if (time_signature_req_l_)
30 time_signature_req_l_->print ();
31 #endif
34 void
35 Time_signature_performer::do_process_requests ()
37 if (time_signature_req_l_)
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;
46 void
47 Time_signature_performer::do_pre_move_processing ()
49 if (audio_p_)
51 play_element (audio_p_);
52 audio_p_ = 0;
56 bool
57 Time_signature_performer::do_try_music (Music* req_l)
59 if (time_signature_req_l_)
60 return false;
62 if (Time_signature_change_req *t =
63 dynamic_cast <Time_signature_change_req *> (req_l))
65 time_signature_req_l_ = t;
66 return true;
69 return false;