]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/grace-fixup.hh
03e8129ed985c8977c5287fc547fce106ceb1810
[lilypond.git] / lily / include / grace-fixup.hh
1 /*
2   This file is part of LilyPond, the GNU music typesetter.
3
4   Copyright (C) 2004--2012 Han-Wen Nienhuys <hanwen@xs4all.nl>
5
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.
10
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.
15
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/>.
18 */
19
20 #ifndef GRACE_FIXUP_HH
21 #define GRACE_FIXUP_HH
22
23 #include "moment.hh"
24
25 /*
26   This is a lookahead list for grace notes.
27
28   {  ... X \grace Y  Z ... }
29
30   normally, the ending of X is the start of Z. In case of a grace
31   note, we take off a little at the end of X. What is stored: START
32   (start point of X), LENGTH (length of X), GRACE_START (start_music
33   of Y), and the next fixup element.
34
35   This is also done for nested musics, i.e.
36
37   voiceA = \notes { \grace b16 c'2 }
38   voiceB = \notes { c'2 \voiceA }
39
40   the iterator for voiceB will contain a fixup entry with (START = 0/1,
41   LENGTH =2/1, GRACE_START =(0G-1/16) )
42
43   Graces at the start of a sequential music iterator are handled
44   by initting here_mom_ with Music::start_music (); no fixups are needed.
45 */
46 struct Grace_fixup
47 {
48   Moment start_;
49   Moment length_;
50
51   Rational grace_start_;
52
53   Grace_fixup *next_;
54 };
55
56 #endif /* GRACE_FIXUP_HH */
57