lilypond-1.3.67
[lilypond.git] / lily / grace-engraver-group.cc
blobf7b66a62c3f6bf30ae9f9ec5d0e77b83d0b774f3
1 /*
2 grace-engraver-group.cc -- implement Grace_engraver_group
4 source file of the GNU LilyPond music typesetter
6 (c) 1999--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
8 */
10 #include "grace-engraver-group.hh"
11 #include "lily-guile.hh"
12 #include "score-element.hh"
13 #include "musical-request.hh"
15 void
16 Grace_engraver_group::start ()
20 We're really finished with this context. Get rid of everything.
22 void
23 Grace_engraver_group::finish ()
25 calling_self_b_ = true;
26 removal_processing (); // ugr. We'd want to have this done by our parents.
27 for (int i=0; i < announce_to_top_.size (); i++)
29 Engraver::announce_element (announce_to_top_[i]);
32 for (int i=0; i < typeset_us_.size (); i++)
34 Engraver::typeset_element (typeset_us_[i]);
36 typeset_us_.clear ();
37 calling_self_b_ = false;
40 void
41 Grace_engraver_group::do_removal_processing ()
43 Engraver_group_engraver::do_removal_processing ();
46 void
47 Grace_engraver_group::announce_element (Score_element_info inf)
49 announce_info_arr_.push (inf);
50 // do not propagate to top
51 announce_to_top_.push (inf);
53 inf.elem_l_->set_elt_property ("grace", SCM_BOOL_T);
56 void
57 Grace_engraver_group::typeset_element (Score_element*e)
59 typeset_us_.push (e);
63 Grace_engraver_group::Grace_engraver_group()
65 calling_self_b_ = false;
68 void
69 Grace_engraver_group::process ()
71 calling_self_b_ = true;
72 process_music ();
73 do_announces();
74 pre_move_processing();
75 check_removal();
76 calling_self_b_ = false;
80 void
81 Grace_engraver_group::each (Method_pointer method)
83 if (calling_self_b_)
84 Engraver_group_engraver::each (method);
88 void
89 Grace_engraver_group::each (Const_method_pointer method) const
91 if (calling_self_b_)
92 Engraver_group_engraver::each (method);
94 ADD_THIS_TRANSLATOR(Grace_engraver_group);
98 don't let the commands trickle up.
100 bool
101 Grace_engraver_group::do_try_music (Music *m)
103 bool hebbes_b = try_music_on_nongroup_children (m);
105 if (!hebbes_b && pass_to_top_b (m))
107 hebbes_b = daddy_trans_l_->try_music (m);
110 return hebbes_b;
113 bool
114 Grace_engraver_group::pass_to_top_b (Music *m) const
116 if (Span_req * sp = dynamic_cast<Span_req*> (m))
118 if (sp->span_type_str_ == "slur")
119 // return true;
120 return false;
122 return false;