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) 2000--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>, Erik Sandberg <m
andolaerik@gmail.com> | 4 Copyright (C) 2000--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>, Erik Sandberg <m
andolaerik@gmail.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 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 } | 78 } |
79 | 79 |
80 if (stop_mom_.main_part_ == now_mom ().main_part_) | 80 if (stop_mom_.main_part_ == now_mom ().main_part_) |
81 { | 81 { |
82 if (percent_) | 82 if (percent_) |
83 typeset_perc (); | 83 typeset_perc (); |
84 percent_event_ = 0; | 84 percent_event_ = 0; |
85 } | 85 } |
86 } | 86 } |
87 | 87 |
88 IMPLEMENT_TRANSLATOR_LISTENER (Percent_repeat_engraver, percent); | |
89 void | 88 void |
90 Percent_repeat_engraver::listen_percent (Stream_event *ev) | 89 Percent_repeat_engraver::listen_percent (Stream_event *ev) |
91 { | 90 { |
92 if (!percent_event_) | 91 if (!percent_event_) |
93 { | 92 { |
94 Moment body_length = get_event_length (ev); | 93 Moment body_length = get_event_length (ev); |
95 start_mom_ = now_mom (); | 94 start_mom_ = now_mom (); |
96 stop_mom_ = now_mom () + body_length; | 95 stop_mom_ = now_mom () + body_length; |
97 get_global_context ()->add_moment_to_process (stop_mom_); | 96 get_global_context ()->add_moment_to_process (stop_mom_); |
98 percent_event_ = ev; | 97 percent_event_ = ev; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 if (percent_counter_) | 161 if (percent_counter_) |
163 percent_counter_->set_bound (RIGHT, col); | 162 percent_counter_->set_bound (RIGHT, col); |
164 percent_counter_ = 0; | 163 percent_counter_ = 0; |
165 } | 164 } |
166 | 165 |
167 void | 166 void |
168 Percent_repeat_engraver::stop_translation_timestep () | 167 Percent_repeat_engraver::stop_translation_timestep () |
169 { | 168 { |
170 } | 169 } |
171 | 170 |
| 171 void |
| 172 Percent_repeat_engraver::boot () |
| 173 { |
| 174 ADD_LISTENER (Percent_repeat_engraver, percent); |
| 175 } |
| 176 |
172 ADD_TRANSLATOR (Percent_repeat_engraver, | 177 ADD_TRANSLATOR (Percent_repeat_engraver, |
173 /* doc */ | 178 /* doc */ |
174 "Make whole measure repeats.", | 179 "Make whole measure repeats.", |
175 | 180 |
176 /* create */ | 181 /* create */ |
177 "PercentRepeat " | 182 "PercentRepeat " |
178 "PercentRepeatCounter ", | 183 "PercentRepeatCounter ", |
179 | 184 |
180 /* read */ | 185 /* read */ |
181 "countPercentRepeats " | 186 "countPercentRepeats " |
182 "currentCommandColumn " | 187 "currentCommandColumn " |
183 "repeatCountVisibility ", | 188 "repeatCountVisibility ", |
184 | 189 |
185 /* write */ | 190 /* write */ |
186 "" | 191 "" |
187 ); | 192 ); |
OLD | NEW |