OLD | NEW |
1 /* | 1 /* |
2 This file is part of LilyPond, the GNU music typesetter. | 2 This file is part of LilyPond, the GNU music typesetter. |
3 | 3 |
4 Copyright (C) 2011 Mike Solomon <mike@apollinemike.com> | 4 Copyright (C) 2011 Mike Solomon <mike@apollinemike.com> |
5 | 5 |
6 LilyPond is free software: you can redistribute it and/or modify | 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 | 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 | 8 the Free Software Foundation, either version 3 of the License, or |
9 (at your option) any later version. | 9 (at your option) any later version. |
10 | 10 |
11 LilyPond is distributed in the hope that it will be useful, | 11 LilyPond is distributed in the hope that it will be useful, |
12 but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 GNU General Public License for more details. | 14 GNU General Public License for more details. |
15 | 15 |
16 You should have received a copy of the GNU General Public License | 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/>. | 17 along with LilyPond. If not, see <http://www.gnu.org/licenses/>. |
18 */ | 18 */ |
19 | 19 |
20 #include "engraver.hh" | 20 #include "engraver.hh" |
21 | 21 |
22 #include "stream-event.hh" | 22 #include "stream-event.hh" |
23 #include "item.hh" | 23 #include "item.hh" |
24 #include "pointer-group-interface.hh" | 24 #include "pointer-group-interface.hh" |
25 #include "spanner.hh" | 25 #include "spanner.hh" |
| 26 #include "system.hh" |
26 | 27 |
27 #include "translator.icc" | 28 #include "translator.icc" |
28 | 29 |
29 class Footnote_engraver : public Engraver | 30 class Footnote_engraver : public Engraver |
30 { | 31 { |
31 TRANSLATOR_DECLARATIONS (Footnote_engraver); | 32 TRANSLATOR_DECLARATIONS (Footnote_engraver); |
32 | 33 |
33 DECLARE_TRANSLATOR_LISTENER (footnote); | 34 DECLARE_TRANSLATOR_LISTENER (footnote); |
34 DECLARE_ACKNOWLEDGER (grob); | 35 DECLARE_ACKNOWLEDGER (grob); |
35 DECLARE_END_ACKNOWLEDGER (grob); | 36 DECLARE_END_ACKNOWLEDGER (grob); |
36 vector<Stream_event *> events_; | 37 vector<Stream_event *> events_; |
37 vector<Drul_array<Spanner *> > annotated_spanners_; | 38 vector<Drul_array<Spanner *> > annotated_spanners_; |
38 | 39 |
39 void stop_translation_timestep (); | 40 void stop_translation_timestep (); |
| 41 void finalize (); |
40 | 42 |
41 void footnotify (Grob *, Stream_event *); | 43 void footnotify (Grob *, Stream_event *); |
42 }; | 44 }; |
43 | 45 |
44 IMPLEMENT_TRANSLATOR_LISTENER (Footnote_engraver, footnote); | 46 IMPLEMENT_TRANSLATOR_LISTENER (Footnote_engraver, footnote); |
45 void | 47 void |
46 Footnote_engraver::listen_footnote (Stream_event *ev) | 48 Footnote_engraver::listen_footnote (Stream_event *ev) |
47 { | 49 { |
48 events_.push_back (ev); | 50 events_.push_back (ev); |
49 } | 51 } |
50 | 52 |
51 void | 53 void |
52 Footnote_engraver::stop_translation_timestep () | 54 Footnote_engraver::stop_translation_timestep () |
53 { | 55 { |
54 events_.clear (); | 56 events_.clear (); |
55 } | 57 } |
56 | 58 |
| 59 void |
| 60 Footnote_engraver::finalize () |
| 61 { |
| 62 annotated_spanners_.resize (0); |
| 63 } |
| 64 |
57 Footnote_engraver::Footnote_engraver () | 65 Footnote_engraver::Footnote_engraver () |
58 { | 66 { |
59 } | 67 } |
60 | 68 |
61 void | 69 void |
62 Footnote_engraver::footnotify (Grob *g, Stream_event *event) | 70 Footnote_engraver::footnotify (Grob *g, Stream_event *event) |
63 { | 71 { |
64 Spanner *s = dynamic_cast<Spanner *>(g); | 72 Spanner *s = dynamic_cast<Spanner *>(g); |
65 | 73 |
66 if (s) | 74 if (s) |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 /* create */ | 135 /* create */ |
128 "FootnoteItem " | 136 "FootnoteItem " |
129 "FootnoteSpanner ", | 137 "FootnoteSpanner ", |
130 | 138 |
131 /*read*/ | 139 /*read*/ |
132 "currentMusicalColumn ", | 140 "currentMusicalColumn ", |
133 | 141 |
134 /*write*/ | 142 /*write*/ |
135 "" | 143 "" |
136 ); | 144 ); |
OLD | NEW |