]> git.donarmstrong.com Git - lilypond.git/blob - lily/simple-music-iterator.cc
* configure.in: Test for and accept lmodern if EC fonts not found.
[lilypond.git] / lily / simple-music-iterator.cc
1 /*   
2   simple-music-iterator.cc --  implement Simple_music_iterator
3   
4   source file of the GNU LilyPond music typesetter
5   
6   (c) 2000--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7   
8  */
9
10 #include "simple-music-iterator.hh"
11
12 #include "music.hh"
13 #include "input.hh"
14
15 Simple_music_iterator::Simple_music_iterator ()
16   : Music_iterator ()
17 {
18   last_processed_mom_ = -1;
19 }
20
21 bool
22 Simple_music_iterator::ok ()const
23 {
24   return last_processed_mom_ < music_get_length ();
25 }
26
27 /*
28   TODO: remove last_processed_mom_, and the complete shit.  We should
29   only process a simple-music once, and that is at its start.
30
31   Engravers can detect and event the end-moments to be processed as
32   well.
33
34 */
35 Moment
36 Simple_music_iterator::pending_moment ()const
37 {
38   if (last_processed_mom_ < Moment (0))
39     return Moment (0);
40   else
41     return music_get_length ();
42 }
43
44
45 void
46 Simple_music_iterator::process (Moment m)
47 {
48   /*
49   don't do try_music (), since it would make the function useless for
50   base classes
51   */
52
53   last_processed_mom_ = m;
54 }
55
56 IMPLEMENT_CTOR_CALLBACK (Simple_music_iterator);