2 auto-plet-engraver.cc -- implement Auto_plet_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #include "auto-plet-engraver.hh"
11 #include "command-request.hh"
12 #include "plet-spanner.hh"
13 #include "note-column.hh"
16 Tuplet_engraver::do_try_request (Request
*r
)
18 if (Bracket_req
* b
= dynamic_cast <Bracket_req
*> (r
))
20 bracket_req_arr_
.push (b
);
27 Tuplet_engraver::do_process_requests ()
30 Link_array
<Plet_spanner
> start_arr
;
32 for (int i
=0; i
< bracket_req_arr_
.size (); i
++)
34 if (bracket_req_arr_
[i
]->spantype
== Span_req::STOP
)
36 if (bracket_req_arr_
[i
]->spantype
== Span_req::START
)
38 Plet_spanner
* glep
= new Plet_spanner ();
39 start_arr
.push (glep
);
40 // lots of stuff does info->elem_l_->is_type ()
41 // announce_element (Score_element_info (glep, bracket_req_arr_[i]));
47 Plet_spanner
* glep
= started_span_p_arr_
.pop ();
48 stop_now_span_p_arr_
.push (glep
);
51 for (int i
=0; i
< start_arr
.size (); i
++)
52 started_span_p_arr_
.push (start_arr
.pop ());
56 Tuplet_engraver::acknowledge_element (Score_element_info i
)
58 if (Note_column
*nc
= dynamic_cast<Note_column
*> (i
.elem_l_
))
61 for (int j
=0; j
<started_span_p_arr_
.size (); j
++)
62 // started_span_p_arr_[j]->add_column (nc);
68 Tuplet_engraver::do_pre_move_processing ()
74 Tuplet_engraver::typeset_all ()
76 for (int i
=0; i
< stop_now_span_p_arr_
.size (); i
++)
78 typeset_element (stop_now_span_p_arr_
[i
]);
81 stop_now_span_p_arr_
.clear ();
85 Tuplet_engraver::do_removal_processing ()
88 for (int i
=0; i
< started_span_p_arr_
.size (); i
++)
90 typeset_element (started_span_p_arr_
[i
]);
94 ADD_THIS_TRANSLATOR(Tuplet_engraver
);
95 IMPLEMENT_IS_TYPE_B1(Tuplet_engraver
, Engraver
);
97 Tuplet_engraver::Tuplet_engraver()
103 Tuplet_engraver::do_post_move_processing ()
105 bracket_req_arr_
.clear ();