2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 2000--2009 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"
25 Simple_music_iterator::Simple_music_iterator ()
28 last_processed_mom_ = -1;
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
45 Simple_music_iterator::pending_moment ()const
47 if (last_processed_mom_ < Moment (0))
50 return music_get_length ();
54 Simple_music_iterator::process (Moment m)
57 don't do report_event (), since it would make the function useless for
61 last_processed_mom_ = m;
64 IMPLEMENT_CTOR_CALLBACK (Simple_music_iterator);