2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 1999--2012 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 #ifndef REPEATED_MUSIC_HH
21 #define REPEATED_MUSIC_HH
28 A repeat, when played has the form of BODY A BODY B BODY C.
30 In this examples, the list {A B C} is put in ALTERNATIVES_P_. BODY
31 is put in REPEAT_BODY_P_. Either the body or the alternative may
34 There are three modes of representing this music:
40 is called "folded". Mostly used for lyrics.
45 is called volta. This is common notation
49 is called unfolded. Useful for MIDI.
51 If the number of repeats is smaller than the number of alternatives, then
52 the excess alternatives are ignored for all timing purposes.
54 If the number of repeats is bigger than the number of alternatives, then
55 the first alternative is assumed to be repeated.
60 static Music *body (Music *);
61 static SCM alternatives (Music *);
63 /* How often do we repeat? */
64 static int repeat_count (Music *);
65 DECLARE_SCHEME_CALLBACK (relative_callback, (SCM, SCM));
67 static Moment body_get_length (Music *);
68 static Moment alternatives_get_length (Music *, bool fold);
69 static Moment alternatives_volta_get_length (Music *);
71 DECLARE_SCHEME_CALLBACK (unfolded_music_length, (SCM));
72 DECLARE_SCHEME_CALLBACK (volta_music_length, (SCM));
73 DECLARE_SCHEME_CALLBACK (folded_music_length, (SCM));
74 DECLARE_SCHEME_CALLBACK (minimum_start, (SCM));
75 DECLARE_SCHEME_CALLBACK (first_start, (SCM));
78 #endif /* REPEATED_MUSIC_HH */