2 chord-tremolo-iterator.cc -- implement Chord_tremolo_iterator
4 source file of the GNU LilyPond music typesetter
6 (c) 2000--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
12 this is culled from various other iterators, but sharing code by
13 subclassing proved to be too difficult.
16 #include "chord-tremolo-iterator.hh"
19 #include "repeated-music.hh"
22 Chord_tremolo_iterator::construct_children ()
24 Repeated_music * rep = dynamic_cast<Repeated_music*> (get_music ());
25 factor_ = Moment (Rational (1, 1));
26 child_iter_ = unsmob_iterator (get_iterator (rep->body ()));
29 Chord_tremolo_iterator::Chord_tremolo_iterator ()
36 Chord_tremolo_iterator::do_quit ()
43 Chord_tremolo_iterator::derived_mark () const
46 scm_gc_mark (child_iter_->self_scm ());
50 Chord_tremolo_iterator::derived_substitute (Context *f, Context *t)
53 child_iter_->substitute_outlet (f,t);
57 Chord_tremolo_iterator::process (Moment m)
61 Music_iterator *yeah = try_music (get_music ());
63 set_context (yeah->get_outlet ());
65 get_music ()->origin ()->warning (_ ("no one to print a tremolos"));
68 child_iter_->process (factor_ * m);
72 Chord_tremolo_iterator::pending_moment () const
74 return child_iter_->pending_moment () / factor_;
78 Chord_tremolo_iterator::ok () const
80 return child_iter_ && child_iter_->ok ();
84 Chord_tremolo_iterator::try_music_in_children (Music *m) const
86 return child_iter_->try_music (m);
89 IMPLEMENT_CTOR_CALLBACK (Chord_tremolo_iterator);