lilypond-1.3.28
[lilypond.git] / lily / grace-performer-group.cc
blob45c47ca37f38aaf007657235e1263d967ddfe0e0
1 /*
2 grace-performer-group.cc -- implement Grace_performer_group
4 source file of the GNU LilyPond music playter
6 (c) 1999 Jan Nieuwenhuizen <janneke@gnu.org>
8 */
9 #include "grace-performer-group.hh"
10 #include "lily-guile.hh"
12 #include "audio-element.hh"
14 ADD_THIS_TRANSLATOR (Grace_performer_group);
16 void
17 Grace_performer_group::start ()
21 We're really finished with this context. Get rid of everything.
23 void
24 Grace_performer_group::finish ()
26 calling_self_b_ = true;
27 removal_processing (); // ugr. We'd want to have this done by our parents.g
28 for (int i=0; i < announce_to_top_.size (); i++)
30 Performer::announce_element (announce_to_top_[i]);
33 for (int i=0; i < play_us_.size (); i++)
35 Performer::play_element (play_us_[i]);
37 play_us_.clear ();
38 calling_self_b_ = false;
41 void
42 Grace_performer_group::do_removal_processing ()
44 Performer_group_performer::do_removal_processing ();
47 void
48 Grace_performer_group::announce_element (Audio_element_info info)
50 announce_info_arr_.push (info);
51 // do not propagate to top
52 announce_to_top_.push (info);
54 //inf.elem_l_->set_elt_property ("grace", SCM_BOOL_T);
55 info.elem_l_->grace_b_ = true;
58 void
59 Grace_performer_group::play_element (Audio_element*e)
61 play_us_.push (e);
65 Grace_performer_group::Grace_performer_group()
67 calling_self_b_ = false;
70 void
71 Grace_performer_group::process ()
73 calling_self_b_ = true;
74 process_requests ();
75 do_announces();
76 pre_move_processing();
77 check_removal();
78 calling_self_b_ = false;
82 void
83 Grace_performer_group::each (Method_pointer method)
85 if (calling_self_b_)
86 Performer_group_performer::each (method);
90 void
91 Grace_performer_group::each (Const_method_pointer method) const
93 if (calling_self_b_)
94 Performer_group_performer::each (method);
98 don't let the commands trickle up.
100 bool
101 Grace_performer_group::do_try_music (Music *m)
103 return try_music_on_nongroup_children (m);