2 stem-grav.cc -- implement Stem_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
9 #include "stem-grav.hh"
10 #include "note-head.hh"
12 #include "musical-request.hh"
13 #include "duration-convert.hh"
16 Stem_engraver::Stem_engraver()
20 default_abbrev_i_
= 16;
25 Stem_engraver::do_creation_processing ()
27 Scalar prop
= get_property ("abbrev");
30 default_abbrev_i_
= prop
;
35 Stem_engraver::acknowledge_element(Score_elem_info i
)
37 if (i
.elem_l_
->is_type_b (Rhythmic_head::static_name()))
39 Rhythmic_head
*h
= (Rhythmic_head
*) i
.elem_l_
->item();
42 Rhythmic_req
* r
= i
.req_l_
->musical()->rhythmic();
44 int durlog_i
= r
->duration_
.durlog_i_
;
45 stem_p_
->flag_i_
= durlog_i
;
50 int t
= abbrev_req_l_
->type_i_
;
52 t
= default_abbrev_i_
;
54 default_abbrev_i_
= t
;
55 stem_p_
->abbrev_flag_i_
=intlog2 (t
) - (durlog_i
>? 2);
57 announce_element (Score_elem_info (stem_p_
, r
));
64 Stem_engraver::do_pre_move_processing()
68 Scalar prop
= get_property ("ydirection");
69 dir_
= prop
.isnum_b () ? int(prop
) : CENTER
;
73 typeset_element(stem_p_
);
80 Stem_engraver::do_try_request (Request
* r
)
82 Musical_req
* mus_l
= r
->musical ();
86 Abbreviation_req
* a
= mus_l
->abbrev ();
95 IMPLEMENT_IS_TYPE_B1(Stem_engraver
, Engraver
);
96 ADD_THIS_TRANSLATOR(Stem_engraver
);