2 voiceelt.cc -- implement Voice_element
4 source file of the LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
13 #include "voice-element.hh"
14 #include "musicalrequest.hh"
15 #include "commandrequest.hh"
19 Voice_element::print() const
22 mtor << "voice_element { dur :"<< duration <<"\n";
23 for (iter_top(reqs,rc); rc.ok(); rc++) {
31 Voice_element::add(Request*r)
34 assert (!duration || duration == r->duration());
35 duration = r->duration();
43 Voice_element::Voice_element()
50 Voice_element::Voice_element(Voice_element const&src)
52 defined_ch_c_l_ = src.defined_ch_c_l_;
55 for (iter_top(src.reqs, i); i.ok(); i++)
60 Voice_element::find_plet_start_bo(char c, Moment& moment_r)
64 for ( PCursor<Request*> i( reqs.top() ); i.ok(); i++ ) {
65 if (i->beam() && i->beam()->spantype == Span_req::START )
72 Voice_element::set_default_group(String s)
74 for (iter_top(reqs, i); i.ok(); i++)
77 Group_change_req *greq = new Group_change_req;
78 greq->newgroup_str_ = s;
83 Voice_element::set_plet_backwards(Moment& now_moment_r,
84 Moment until_moment, int num_i, int den_i)
86 now_moment_r += duration;
87 if ( now_moment_r > until_moment )
89 for ( PCursor<Request*> i( reqs.top() ); i.ok(); i++ ) {
90 if (i->beam() && i->beam()->spantype == Span_req::START )
91 i->beam()->nplet = den_i;
93 i->rhythmic()->plet_factor = Moment(num_i, den_i);
95 i->stem()->plet_factor = Moment(num_i, den_i);