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()
58 Voice_element::Voice_element(Voice_element
const&src
)
60 defined_ch_C_
= src
.defined_ch_C_
;
63 for (iter_top(src
.reqs
, i
); i
.ok(); i
++)
68 Voice_element::find_plet_start_b(char c
, Moment
& moment_r
)
71 moment_r
+= duration_
;
72 for ( PCursor
<Request
*> i( reqs
.top() ); i
.ok(); i
++ ) {
73 if (i
->beam() && i
->beam()->spantype
== Span_req::START
)
80 Voice_element::set_default_group(String s
)
82 for (iter_top(reqs
, i
); i
.ok(); i
++)
85 Group_change_req
*greq
= new Group_change_req
;
86 greq
->newgroup_str_
= s
;
91 Voice_element::set_plet_backwards(Moment
& now_moment_r
,
92 Moment until_moment
, int num_i
, int den_i
)
94 now_moment_r
+= duration_
;
95 if ( now_moment_r
> until_moment
)
97 for ( PCursor
<Request
*> i( reqs
.top() ); i
.ok(); i
++ ) {
98 if (i
->beam() && i
->beam()->spantype
== Span_req::START
)
99 i
->beam()->nplet
= den_i
;
101 i
->rhythmic()->duration_
.plet_
.type_i_
= den_i
;
102 i
->rhythmic()->duration_
.plet_
.iso_i_
= num_i
;