2 head-grav.cc -- part of GNU LilyPond
4 (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 #include "note-head.hh"
8 #include "heads-engraver.hh"
9 #include "paper-def.hh"
10 #include "musical-request.hh"
12 #include "dot-column.hh"
14 Note_heads_engraver::Note_heads_engraver()
19 Note_heads_engraver::do_try_music (Music
*m
)
21 if (Note_req
* n
=dynamic_cast <Note_req
*> (m
))
23 note_req_l_arr_
.push (n
);
26 if (Tonic_req
* t
= dynamic_cast<Tonic_req
*> (m
))
34 Note_heads_engraver::do_process_requests()
36 if (note_p_arr_
.size ())
39 String noteheadstyle
= get_property ("noteHeadStyle", 0);
40 for (int i
=0; i
< note_req_l_arr_
.size (); i
++)
42 Note_head
*note_p
= new Note_head
;
43 Note_req
* note_req_l
= note_req_l_arr_
[i
];
44 note_p
->balltype_i_
= note_req_l
->duration_
.durlog_i_
;
45 note_p
->dots_i_
= note_req_l
->duration_
.dots_i_
;
50 announce_element (Score_element_info (d
,0));
54 // note_p->steps_i_ = note_req_l->pitch_.steps ();
55 note_p
->position_i_
= note_req_l
->pitch_
.steps ();
58 if (noteheadstyle
== "transparent")
59 note_p
->set_elt_property (transparent_scm_sym
, SCM_BOOL_T
);
61 note_p
->set_elt_property (style_scm_sym
,
62 gh_str02scm (noteheadstyle
.ch_C()));
65 Score_element_info
itinf (note_p
,note_req_l
);
66 announce_element (itinf
);
67 note_p_arr_
.push (note_p
);
72 Note_heads_engraver::do_pre_move_processing()
74 for (int i
=0; i
< note_p_arr_
.size (); i
++)
76 typeset_element (note_p_arr_
[i
]);
79 for (int i
=0; i
< dot_p_arr_
.size (); i
++)
81 typeset_element (dot_p_arr_
[i
]);
85 note_req_l_arr_
.clear ();
89 Note_heads_engraver::do_post_move_processing()
96 ADD_THIS_TRANSLATOR(Note_heads_engraver
);