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.
17 #include "chord-tremolo-iterator.hh"
18 #include "repeated-music.hh"
21 Chord_tremolo_iterator::construct_children ()
23 Repeated_music * rep = dynamic_cast<Repeated_music*> (get_music ());
24 factor_ = Moment (Rational (1, 1));
25 child_iter_ = unsmob_iterator (get_iterator (rep->body ()));
28 Chord_tremolo_iterator::Chord_tremolo_iterator ()
35 Chord_tremolo_iterator::do_quit ()
42 Chord_tremolo_iterator::derived_mark () const
45 scm_gc_mark (child_iter_->self_scm ());
49 Chord_tremolo_iterator::derived_substitute (Context *f, Context *t)
52 child_iter_->substitute_outlet (f,t);
56 Chord_tremolo_iterator::process (Moment m)
60 Music_iterator *yeah = try_music (get_music ());
62 set_translator (yeah->get_outlet ());
64 get_music ()->origin ()->warning (_ ("no one to print a tremolos"));
67 child_iter_->process (factor_ * m);
71 Chord_tremolo_iterator::pending_moment () const
73 return child_iter_->pending_moment () / factor_;
77 Chord_tremolo_iterator::ok () const
79 return child_iter_ && child_iter_->ok ();
83 Chord_tremolo_iterator::try_music_in_children (Music *m) const
85 return child_iter_->try_music (m);
88 IMPLEMENT_CTOR_CALLBACK (Chord_tremolo_iterator);