2 note-performer.cc -- implement Note_performer
4 source file of the GNU LilyPond music typesetter
6 (c) 1996--2000 Jan Nieuwenhuizen <janneke@gnu.org>
9 #include "note-performer.hh"
10 #include "musical-request.hh"
11 #include "audio-item.hh"
12 #include "audio-column.hh"
13 #include "global-translator.hh"
17 ADD_THIS_TRANSLATOR (Note_performer);
19 Note_performer::Note_performer ()
26 Note_performer::deprecated_process_music ()
28 if (note_req_l_arr_.size ())
30 int transposing_i = 0;
32 SCM prop = get_property ("transposing");
33 if (gh_number_p(prop))
34 transposing_i = gh_scm2int (prop);
36 while (note_req_l_arr_.size ())
38 Note_req* n = note_req_l_arr_.pop ();
39 Pitch pit = * unsmob_pitch (n->get_mus_property ("pitch"));
40 Audio_note* p = new Audio_note (pit, n->length_mom (), transposing_i);
41 Audio_element_info info (p, n);
42 announce_element (info);
49 Note_performer::process_acknowledged ()
54 Note_performer::global_translator_l ()
57 Global_translator *global_l =0;
60 t = t->daddy_trans_l_ ;
61 global_l = dynamic_cast<Global_translator*> (t);
70 Note_performer::do_pre_move_processing ()
73 // why don't grace notes show up here?
74 // --> grace notes effectively do not get delayed
75 Global_translator* global_l = global_translator_l ();
76 for (int i=0; i < note_p_arr_.size (); i++)
78 Audio_note* n = note_p_arr_[i];
79 if (Moment m= n->delayed_until_mom_)
81 global_l->add_moment_to_process (m);
82 delayed_p_arr_.push (n);
89 Moment now = now_mom ();
90 for (int i=0; i < note_p_arr_.size (); i++)
92 play_element (note_p_arr_[i]);
95 note_req_l_arr_.clear ();
96 for (int i=0; i < delayed_p_arr_.size (); i++)
98 Audio_note* n = delayed_p_arr_[i];
99 if (n->delayed_until_mom_ <= now)
102 delayed_p_arr_[i] = 0;
103 delayed_p_arr_.del (i);
110 Note_performer::do_try_music (Music* req_l)
112 if (Note_req *nr = dynamic_cast <Note_req *> (req_l))
114 note_req_l_arr_.push (nr);