Fix type predicates/docstrings for two music properties.
[lilypond/mpolesky.git] / lily / simple-music-iterator.cc
blobee6f5811fb8f436fbabcda8ffde36da05618fd0c
1 /*
2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 2000--2010 Han-Wen Nienhuys <hanwen@xs4all.nl>
6 LilyPond is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 LilyPond is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
20 #include "simple-music-iterator.hh"
22 #include "music.hh"
23 #include "input.hh"
25 Simple_music_iterator::Simple_music_iterator ()
26 : Music_iterator ()
28 last_processed_mom_ = -1;
31 bool
32 Simple_music_iterator::ok ()const
34 return last_processed_mom_ < music_get_length ();
38 TODO: remove last_processed_mom_, and the complete shit. We should
39 only process a simple-music once, and that is at its start.
41 Engravers can detect and event the end-moments to be processed as
42 well.
44 Moment
45 Simple_music_iterator::pending_moment ()const
47 if (last_processed_mom_ < Moment (0))
48 return Moment (0);
49 else
50 return music_get_length ();
53 void
54 Simple_music_iterator::process (Moment m)
57 don't do report_event (), since it would make the function useless for
58 base classes
61 last_processed_mom_ = m;
64 IMPLEMENT_CTOR_CALLBACK (Simple_music_iterator);