*** empty log message ***
[lilypond.git] / lily / simple-music-iterator.cc
blob6b1dedb55ab05b0af04c7cd06869b57c81771fd4
1 /*
2 simple-music-iterator.cc -- implement Simple_music_iterator
4 source file of the GNU LilyPond music typesetter
6 (c) 2000--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
8 */
10 #include "simple-music-iterator.hh"
11 #include "music.hh"
12 #include "input.hh"
14 Simple_music_iterator::Simple_music_iterator ()
15 : Music_iterator ()
17 last_processed_mom_ = -1;
20 bool
21 Simple_music_iterator::ok ()const
23 return last_processed_mom_ < music_get_length ();
27 TODO: remove last_processed_mom_, and the complete shit. We should
28 only process a simple-music once, and that is at its start.
30 Engravers can detect and event the end-moments to be processed as
31 well.
34 Moment
35 Simple_music_iterator::pending_moment ()const
37 if (last_processed_mom_ < Moment (0))
38 return Moment (0);
39 else
40 return music_get_length ();
44 void
45 Simple_music_iterator::process (Moment m)
48 don't do try_music (), since it would make the function useless for
49 base classes
52 last_processed_mom_ = m;
55 IMPLEMENT_CTOR_CALLBACK (Simple_music_iterator);