* Documentation/user/refman.itely: remove superfluous -'s
[lilypond.git] / lily / include / repeated-music.hh
blob5b07584762da8d5ec64fe454486dc5472d2f97a5
1 /*
2 repeated-music.hh -- declare Repeated_music
4 source file of the GNU LilyPond music typesetter
6 (c) 1999--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
8 */
10 #ifndef RepEATED_MUSIC_HH
11 #define RepEATED_MUSIC_HH
13 #include "music.hh"
16 /**
17 Musical repeats.
19 A repeat, when played has the form of BODY A BODY B BODY C.
21 In this examples, the list {A B C} is put in ALTERNATIVES_P_. BODY
22 is put in REPEAT_BODY_P_. Either the body or the alternative may
23 be omitted.
25 There are three modes of representing this music:
27 BODY A
31 is called "folded". Mostly used for lyrics.
34 BODY A B C
36 is called volta. This is common notation
38 BODY A BODY B BODY C
40 is called unfolded. Useful for MIDI.
42 If the number of repeats is smaller than the number of alternatives, then
43 the excess alternatives are ignored for all timing purposes.
45 If the number of repeats is bigger than the number of alternatives, then
46 the first alternative is assumed to be repeated.
49 class Repeated_music : public Music
51 public:
52 Music * body () const;
53 SCM alternatives () const;
55 /// how often do we repeat?
56 int repeat_count ( ) const;
57 virtual Pitch to_relative_octave (Pitch);
59 Moment body_get_length () const;
60 Moment alternatives_get_length (bool fold) const;
61 Moment alternatives_volta_get_length () const;
63 DECLARE_SCHEME_CALLBACK (unfolded_music_length, (SCM));
64 DECLARE_SCHEME_CALLBACK (volta_music_length, (SCM));
65 DECLARE_SCHEME_CALLBACK (folded_music_length, (SCM));
66 DECLARE_SCHEME_CALLBACK (minimum_start, (SCM));
67 DECLARE_SCHEME_CALLBACK (first_start, (SCM));
69 VIRTUAL_COPY_CONS (Music);
70 Repeated_music ();
71 Repeated_music (SCM);
75 #endif /* RepEATED_MUSIC_HH */