2 voice-elt.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 "musical-request.hh"
15 #include "command-request.hh"
19 Voice_element::transpose(Melodic_req const&d)const
21 for (iter_top(reqs,i); i.ok(); i++) {
27 Voice_element::print() const
30 mtor << "voice_element { dur :"<< duration_ <<"\n";
31 for (iter_top(reqs,rc); rc.ok(); rc++) {
39 Voice_element::add(Request*r)
42 assert (!duration_ || duration_ == r->duration());
43 duration_ = r->duration();
51 Voice_element::Voice_element()
57 Voice_element::Voice_element(Voice_element const&src)
62 for (iter_top(src.reqs, i); i.ok(); i++)
67 Voice_element::find_plet_start_b(char c, Moment& moment_r)// b unused?
70 moment_r += duration_;
71 for ( PCursor<Request*> i( reqs.top() ); i.ok(); i++ ) {
72 if (i->beam() && i->beam()->spantype == Span_req::START )
79 Voice_element::set_default_group(String s)
81 for (iter_top(reqs, i); i.ok(); i++)
82 if (i->command() &&i->command()->groupchange())
84 Group_change_req *greq = new Group_change_req;
85 greq->newgroup_str_ = s;
90 Voice_element::set_plet_backwards(Moment& now_moment_r,
91 Moment until_moment, int num_i, int den_i)
93 now_moment_r += duration_;
94 if ( now_moment_r > until_moment )
96 for ( PCursor<Request*> i( reqs.top() ); i.ok(); i++ ) {
97 if (i->beam() && i->beam()->spantype == Span_req::START )
98 i->beam()->nplet = den_i;
100 i->rhythmic()->duration_.plet_.type_i_ = den_i;
101 i->rhythmic()->duration_.plet_.iso_i_ = num_i;