2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 2015 Daniel Eble <dan@faithful.be>
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 "change-sequence-iterator.hh"
24 Change_sequence_iterator::Change_sequence_iterator () :
30 Change_sequence_iterator::construct_children ()
32 Music_wrapper_iterator::construct_children ();
34 change_list_ = get_music ()->get_property ("context-change-list");
38 Change_sequence_iterator::process (Moment m)
40 // Find the ID of the output context to use now. The loop is a bit of
41 // paranoia; we shouldn't expect multiple changes between moments in this
43 SCM context_id = SCM_EOL;
44 for (; scm_is_pair (change_list_); change_list_ = scm_cdr (change_list_))
46 SCM mom_scm = scm_caar (change_list_);
47 Moment *mom = unsmob<Moment> (mom_scm);
53 context_id = scm_cdar (change_list_);
57 string s = "expected moment in change list: ";
58 s += ly_scm2string (mom_scm);
59 programming_error (s);
63 if (!scm_is_null (context_id))
64 change_to (ly_symbol2string (context_id));
66 Music_wrapper_iterator::process (m);