]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/repeated-music.hh
Run `make grand-replace'.
[lilypond.git] / lily / include / repeated-music.hh
1 /*
2   repeated-music.hh -- declare Repeated_music
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1999--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
8
9 #ifndef REPEATED_MUSIC_HH
10 #define REPEATED_MUSIC_HH
11
12 #include "music.hh"
13
14 /**
15    Musical repeats.
16
17    A repeat, when played has the form of BODY A BODY B BODY C.
18
19    In this examples, the list {A B C} is put in ALTERNATIVES_P_.  BODY
20    is put in REPEAT_BODY_P_.  Either the body or the alternative may
21    be omitted.
22
23    There are three modes of representing this  music:
24
25    BODY A
26    B
27    C
28
29    is called "folded". Mostly used for lyrics.
30
31
32    BODY A B C
33
34    is called volta.  This is common notation
35
36    BODY A BODY B BODY C
37
38    is called unfolded.  Useful for MIDI.
39
40    If the number of repeats is smaller than the number of alternatives, then
41    the excess alternatives are ignored for all timing purposes.
42
43    If the number of repeats is bigger than the number of alternatives, then
44    the first alternative is assumed to be repeated.
45 */
46 class Repeated_music
47 {
48 public:
49   static Music *body (Music *);
50   static SCM alternatives (Music *);
51
52   /* How often do we repeat? */
53   static int repeat_count (Music *);
54   DECLARE_SCHEME_CALLBACK (relative_callback, (SCM, SCM));
55
56   static Moment body_get_length (Music *);
57   static Moment alternatives_get_length (Music *, bool fold);
58   static Moment alternatives_volta_get_length (Music *);
59
60   DECLARE_SCHEME_CALLBACK (unfolded_music_length, (SCM));
61   DECLARE_SCHEME_CALLBACK (volta_music_length, (SCM));
62   DECLARE_SCHEME_CALLBACK (folded_music_length, (SCM));
63   DECLARE_SCHEME_CALLBACK (minimum_start, (SCM));
64   DECLARE_SCHEME_CALLBACK (first_start, (SCM));
65 };
66
67 #endif /* REPEATED_MUSIC_HH */