2 chord-tremolo-iterator.cc -- implement Chord_tremolo_iterator
4 source file of the GNU LilyPond music typesetter
6 (c) 2000--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
12 this is culled from various other iterators, but sharing code by subclassing proved to be too difficult.
16 #include "chord-tremolo-iterator.hh"
17 #include "repeated-music.hh"
20 Chord_tremolo_iterator::construct_children ()
22 Repeated_music
* rep
= dynamic_cast<Repeated_music
*> (music_l_
);
23 factor_
= Moment (1, rep
->repeat_count ());
24 child_iter_p_
= get_iterator_p (rep
->body ());
27 Chord_tremolo_iterator::Chord_tremolo_iterator ()
33 Chord_tremolo_iterator::Chord_tremolo_iterator (Chord_tremolo_iterator
const &src
)
34 : Music_iterator (src
)
36 child_iter_p_
= src
.child_iter_p_
? src
.child_iter_p_
->clone () : 0;
40 Chord_tremolo_iterator::process (Moment m
)
44 Music_iterator
*yeah
= try_music (music_l_
);
46 set_translator (yeah
->report_to_l ());
48 music_l_
->origin ()->warning (_ ("no one to print a tremolos"));
51 child_iter_p_
->process (factor_
* m
);
56 Chord_tremolo_iterator::pending_moment () const
58 return child_iter_p_
->pending_moment () / factor_
;
62 Chord_tremolo_iterator::ok () const
64 return child_iter_p_
&& child_iter_p_
->ok ();
67 Chord_tremolo_iterator::~Chord_tremolo_iterator ()
73 Chord_tremolo_iterator::try_music_in_children (Music
*m
) const
75 return child_iter_p_
->try_music (m
);
80 IMPLEMENT_CTOR_CALLBACK (Chord_tremolo_iterator
);