LEFT | RIGHT |
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) 1998--2011 Jan Nieuwenhuizen <janneke@gnu.org> | 4 Copyright (C) 1998--2011 Jan Nieuwenhuizen <janneke@gnu.org> |
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 "multi-measure-rest.hh" | 20 #include "multi-measure-rest.hh" |
21 | 21 |
22 #include "font-interface.hh" | 22 #include "font-interface.hh" |
| 23 #include "international.hh" |
23 #include "lookup.hh" | 24 #include "lookup.hh" |
24 #include "misc.hh" | 25 #include "misc.hh" |
25 #include "moment.hh" | 26 #include "moment.hh" |
26 #include "output-def.hh" | 27 #include "output-def.hh" |
27 #include "paper-column.hh" // urg | 28 #include "paper-column.hh" // urg |
28 #include "percent-repeat-item.hh" | 29 #include "percent-repeat-item.hh" |
29 #include "rest.hh" | 30 #include "rest.hh" |
30 #include "separation-item.hh" | 31 #include "separation-item.hh" |
31 #include "spanner.hh" | 32 #include "spanner.hh" |
32 #include "staff-symbol-referencer.hh" | 33 #include "staff-symbol-referencer.hh" |
33 #include "system.hh" | 34 #include "system.hh" |
34 #include "text-interface.hh" | 35 #include "text-interface.hh" |
35 #include "warn.hh" | 36 #include "warn.hh" |
36 | 37 |
37 Interval | 38 Interval |
38 Multi_measure_rest::bar_width (Spanner *me) | 39 Multi_measure_rest::bar_width (Spanner *me) |
39 { | 40 { |
40 SCM spacing_pair = me->get_property ("spacing-pair"); | 41 SCM spacing_pair = me->get_property ("spacing-pair"); |
41 Interval iv; | 42 Interval iv; |
42 Direction d = LEFT; | 43 Direction d = LEFT; |
43 do | 44 do |
44 { | 45 { |
45 Item *col = me->get_bound (d)->get_column (); | 46 Item *col = me->get_bound (d)->get_column (); |
46 SCM align_sym | 47 SCM align_sym |
47 » = (scm_is_pair (spacing_pair) | 48 = (scm_is_pair (spacing_pair) |
48 » ? index_get_cell (spacing_pair, d) | 49 ? index_get_cell (spacing_pair, d) |
49 » : ly_symbol2scm ("staff-bar")); | 50 : ly_symbol2scm ("staff-bar")); |
50 Interval coldim = Paper_column::break_align_width (col, align_sym); | 51 Interval coldim = Paper_column::break_align_width (col, align_sym); |
51 | 52 |
52 iv[d] = coldim[-d]; | 53 iv[d] = coldim[-d]; |
53 } | 54 } |
54 while (flip (&d) != LEFT); | 55 while (flip (&d) != LEFT); |
55 | 56 |
56 return iv; | 57 return iv; |
57 } | 58 } |
58 | 59 |
59 MAKE_SCHEME_CALLBACK (Multi_measure_rest, percent, 1); | 60 MAKE_SCHEME_CALLBACK (Multi_measure_rest, percent, 1); |
60 SCM | 61 SCM |
61 Multi_measure_rest::percent (SCM smob) | 62 Multi_measure_rest::percent (SCM smob) |
62 { | 63 { |
63 Grob *me = unsmob_grob (smob); | 64 Grob *me = unsmob_grob (smob); |
64 Spanner *sp = dynamic_cast<Spanner *> (me); | 65 Spanner *sp = dynamic_cast<Spanner *> (me); |
65 | 66 |
66 Stencil r = Percent_repeat_item_interface::x_percent (me, 1); | 67 Stencil r = Percent_repeat_item_interface::x_percent (me, 1); |
67 r.translate_axis (-r.extent (X_AXIS).center (), X_AXIS); | 68 r.translate_axis (-r.extent (X_AXIS).center (), X_AXIS); |
68 | 69 |
69 // ugh copy & paste. | 70 // ugh copy & paste. |
70 | 71 |
71 Grob *common_x = sp->get_bound (LEFT)->common_refpoint (sp->get_bound (RIGHT), | 72 Grob *common_x = sp->get_bound (LEFT)->common_refpoint (sp->get_bound (RIGHT), |
72 » » » » » » » X_AXIS); | 73 X_AXIS); |
73 Interval sp_iv = bar_width (sp); | 74 Interval sp_iv = bar_width (sp); |
74 Real x_off = 0.0; | 75 Real x_off = 0.0; |
75 | 76 |
76 Real rx = sp->get_bound (LEFT)->relative_coordinate (common_x, X_AXIS); | 77 Real rx = sp->get_bound (LEFT)->relative_coordinate (common_x, X_AXIS); |
77 /* | 78 /* |
78 we gotta stay clear of sp_iv, so move a bit to the right if | 79 we gotta stay clear of sp_iv, so move a bit to the right if |
79 needed. | 80 needed. |
80 */ | 81 */ |
81 x_off += max (sp_iv[LEFT] - rx, 0.0); | 82 x_off += max (sp_iv[LEFT] - rx, 0.0); |
82 | 83 |
(...skipping 20 matching lines...) Expand all Loading... |
103 Real rx = sp->get_bound (LEFT)->relative_coordinate (0, X_AXIS); | 104 Real rx = sp->get_bound (LEFT)->relative_coordinate (0, X_AXIS); |
104 /* | 105 /* |
105 we gotta stay clear of sp_iv, so move a bit to the right if | 106 we gotta stay clear of sp_iv, so move a bit to the right if |
106 needed. | 107 needed. |
107 */ | 108 */ |
108 Real x_off = max (sp_iv[LEFT] - rx, 0.0); | 109 Real x_off = max (sp_iv[LEFT] - rx, 0.0); |
109 | 110 |
110 Stencil mol; | 111 Stencil mol; |
111 mol.add_stencil (symbol_stencil (me, space)); | 112 mol.add_stencil (symbol_stencil (me, space)); |
112 | 113 |
113 int measures = 0; | 114 int measure_count = 0; |
114 SCM m (me->get_property ("measure-count")); | 115 SCM m (me->get_property ("measure-count")); |
115 if (scm_is_number (m)) | 116 if (scm_is_number (m)) |
116 measures = scm_to_int (m); | 117 measure_count = scm_to_int (m); |
117 | 118 |
118 mol.translate_axis (x_off, X_AXIS); | 119 mol.translate_axis (x_off, X_AXIS); |
119 return mol.smobbed_copy (); | 120 return mol.smobbed_copy (); |
120 } | 121 } |
121 | 122 |
122 int | 123 int |
123 measure_duration_log (Grob *me) | 124 calc_closest_duration_log (Grob *me, double duration, bool force_round_up) |
124 { | 125 { |
125 SCM sml = me->get_property ("measure-length"); | 126 bool round_up = force_round_up |
126 bool round = to_boolean (me->get_property ("round-to-longer-rest")); | 127 || to_boolean (me->get_property ("round-up-to-longer-rest")); |
127 Rational ml = (unsmob_moment (sml)) ? unsmob_moment (sml)->main_part_ : Ration
al (1); | 128 int closest_usable_duration_log; |
128 | 129 |
129 double duration_log = -log2 (ml.Rational::to_double ()); | 130 // Out of range initial values. |
130 int measure_duration_log = static_cast <int> (ceil (duration_log)); | 131 if (round_up) |
131 if (round && duration_log - measure_duration_log < 0) | 132 closest_usable_duration_log = -15; // high value |
132 measure_duration_log--; | 133 else |
| 134 closest_usable_duration_log = 15; // low value |
| 135 int minimum_usable_duration_log = -15; |
| 136 int maximum_usable_duration_log = 15; |
133 | 137 |
134 SCM duration_logs_list = me->get_property ("usable-duration-logs"); | 138 SCM duration_logs_list = me->get_property ("usable-duration-logs"); |
135 int closest_list_elt = -15; // -15 is out of range. | 139 if (to_boolean (scm_null_p (duration_logs_list)) |
136 | 140 || !to_boolean (scm_list_p (duration_logs_list))) |
137 for (int i = 0; i < scm_to_int (scm_length (duration_logs_list)); i++) | 141 { |
138 { | 142 warning (_ ("usable-duration-logs must be a non-empty list. Falling back
to whole rests.")); |
139 int list_elt = scm_to_int (scm_list_ref (duration_logs_list, scm_from_int (i
))); | 143 closest_usable_duration_log = 0; |
140 int shortest_distance = abs (measure_duration_log - closest_list_elt); | 144 } |
141 int distance = abs (measure_duration_log - list_elt); | 145 else |
142 if (distance < shortest_distance) | 146 { |
143 closest_list_elt = list_elt; | 147 for (SCM s = duration_logs_list; scm_is_pair (s); s = scm_cdr (s)) |
144 } | 148 { |
145 | 149 int dur_log = scm_to_int (scm_car (s)); |
146 return closest_list_elt; | 150 if (dur_log > minimum_usable_duration_log) |
| 151 minimum_usable_duration_log = dur_log; |
| 152 if (dur_log < maximum_usable_duration_log) |
| 153 maximum_usable_duration_log = dur_log; |
| 154 double dur = pow (2.0, -dur_log); |
| 155 if (round_up) |
| 156 { |
| 157 if (duration <= dur && dur_log > closest_usable_duration_log) |
| 158 closest_usable_duration_log = dur_log; |
| 159 } |
| 160 else |
| 161 { |
| 162 if (duration >= dur && dur_log < closest_usable_duration_log) |
| 163 closest_usable_duration_log = dur_log; |
| 164 } |
| 165 } |
| 166 } |
| 167 |
| 168 if (closest_usable_duration_log == 15) |
| 169 closest_usable_duration_log = minimum_usable_duration_log; |
| 170 if (closest_usable_duration_log == -15) |
| 171 closest_usable_duration_log = maximum_usable_duration_log; |
| 172 |
| 173 return closest_usable_duration_log; |
| 174 } |
| 175 |
| 176 int |
| 177 calc_measure_duration_log (Grob *me) |
| 178 { |
| 179 SCM sml = dynamic_cast<Spanner *> (me)->get_bound (LEFT) |
| 180 ->get_property ("measure-length"); |
| 181 Rational ml = (unsmob_moment (sml)) ? unsmob_moment (sml)->main_part_ |
| 182 : Rational (1); |
| 183 double measure_duration = ml.Rational::to_double (); |
| 184 bool force_round_up = to_boolean ( |
| 185 scm_list_p ( |
| 186 scm_member ( |
| 187 scm_cons (scm_from_int64 (ml.numerator ()), |
| 188 scm_from_int64 (ml.denominator ())), |
| 189 me->get_property ("round-up-exceptions")))); |
| 190 return calc_closest_duration_log (me, measure_duration, force_round_up); |
147 } | 191 } |
148 | 192 |
149 Stencil | 193 Stencil |
150 Multi_measure_rest::symbol_stencil (Grob *me, Real space) | 194 Multi_measure_rest::symbol_stencil (Grob *me, Real space) |
151 { | 195 { |
152 int measures = 0; | 196 int measure_count = 0; |
153 SCM m (me->get_property ("measure-count")); | 197 SCM m (me->get_property ("measure-count")); |
154 if (scm_is_number (m)) | 198 if (scm_is_number (m)) |
155 measures = scm_to_int (m); | 199 measure_count = scm_to_int (m); |
156 if (measures <= 0) | 200 if (measure_count <= 0) |
157 return Stencil (); | 201 return Stencil (); |
158 | 202 |
159 SCM limit = me->get_property ("expand-limit"); | 203 SCM limit = me->get_property ("expand-limit"); |
160 if (measures > scm_to_int (limit)) | 204 if (measure_count > scm_to_int (limit)) |
161 { | 205 { |
162 Real padding = 0.15; | 206 Real padding = 0.15; |
163 Stencil s = big_rest (me, (1.0 - 2 * padding) * space); | 207 Stencil s = big_rest (me, (1.0 - 2 * padding) * space); |
164 s.translate_axis (padding * space, X_AXIS); | 208 s.translate_axis (padding * space, X_AXIS); |
165 return s; | 209 return s; |
166 } | 210 } |
167 | 211 |
168 Real staff_space = Staff_symbol_referencer::staff_space (me); | 212 Real staff_space = Staff_symbol_referencer::staff_space (me); |
169 | 213 |
170 Font_metric *musfont = Font_interface::get_default_font (me); | 214 Font_metric *musfont = Font_interface::get_default_font (me); |
171 int mdl = measure_duration_log (me); | 215 int mdl = calc_measure_duration_log (me); |
172 | 216 |
173 if (measures == 1) | 217 if (measure_count == 1) |
174 { | 218 { |
175 Stencil s = musfont->find_by_name (Rest::glyph_name (me, mdl, "", true)); | 219 Stencil s = musfont->find_by_name (Rest::glyph_name (me, mdl, "", true)); |
176 if (mdl == 0 && Staff_symbol_referencer::get_position (me) == 0.0) | 220 if (mdl == 0 && Staff_symbol_referencer::get_position (me) == 0.0) |
177 s.translate_axis (staff_space, Y_AXIS); | 221 s.translate_axis (staff_space, Y_AXIS); |
178 | 222 |
179 s.translate_axis ((space - s.extent (X_AXIS).length ()) / 2, X_AXIS); | 223 s.translate_axis ((space - s.extent (X_AXIS).length ()) / 2, X_AXIS); |
180 return s; | 224 return s; |
181 } | 225 } |
182 else | 226 else |
183 return church_rest (me, musfont, measures, space); | 227 return church_rest (me, musfont, measure_count, space); |
184 } | 228 } |
185 | 229 |
186 /* | 230 /* |
187 WIDTH can also be 0 to determine the minimum size of the object. | 231 WIDTH can also be 0 to determine the minimum size of the object. |
188 */ | 232 */ |
189 Stencil | 233 Stencil |
190 Multi_measure_rest::big_rest (Grob *me, Real width) | 234 Multi_measure_rest::big_rest (Grob *me, Real width) |
191 { | 235 { |
192 Real thick_thick = robust_scm2double (me->get_property ("thick-thickness"), 1.
0); | 236 Real thick_thick = robust_scm2double (me->get_property ("thick-thickness"), 1.
0); |
193 Real hair_thick = robust_scm2double (me->get_property ("hair-thickness"), .1); | 237 Real hair_thick = robust_scm2double (me->get_property ("hair-thickness"), .1); |
(...skipping 14 matching lines...) Expand all Loading... |
208 | 252 |
209 m.align_to (X_AXIS, LEFT); | 253 m.align_to (X_AXIS, LEFT); |
210 | 254 |
211 return m; | 255 return m; |
212 } | 256 } |
213 | 257 |
214 /* | 258 /* |
215 Kirchenpause (?) | 259 Kirchenpause (?) |
216 */ | 260 */ |
217 Stencil | 261 Stencil |
218 Multi_measure_rest::church_rest (Grob *me, Font_metric *musfont, int measures, | 262 Multi_measure_rest::church_rest (Grob *me, Font_metric *musfont, int measure_cou
nt, |
219 » » » » Real space) | 263 Real space) |
220 { | 264 { |
221 SCM mols = SCM_EOL; | 265 SCM mols = SCM_EOL; |
222 | 266 int symbol_count = 0; |
223 int l = measures; | |
224 int count = 0; | |
225 Real symbols_width = 0.0; | 267 Real symbols_width = 0.0; |
226 SCM duration_logs_list = me->get_property ("usable-duration-logs"); | 268 double total_duration = measure_count * pow (2.0, -calc_measure_duration_log (
me)); |
227 int longest_church_rest = 10; // 10 is out of range. | 269 |
228 for (int i = 0; i < scm_to_int (scm_length (duration_logs_list)); i++) | 270 while (total_duration > 0) |
229 { | 271 { |
230 longest_church_rest = min (longest_church_rest, | 272 int dl = calc_closest_duration_log (me, total_duration, false); |
231 scm_to_int (scm_list_ref (duration_logs_list, | 273 double duration = pow (2.0, -dl); |
232 scm_from_int (i)))); | 274 |
233 } | 275 total_duration -= duration; |
234 | 276 |
235 while (l) | 277 Stencil r = musfont->find_by_name (Rest::glyph_name (me, dl, "", true)); |
236 { | 278 if (dl == 0) |
237 int k; | 279 { |
238 int i = longest_church_rest - 1; | 280 Real staff_space = Staff_symbol_referencer::staff_space (me); |
239 int length; | 281 r.translate_axis (staff_space, Y_AXIS); |
240 int mdl = measure_duration_log (me); | 282 } |
241 | 283 symbols_width += r.extent (X_AXIS).length (); |
242 do | 284 mols = scm_cons (r.smobbed_copy (), mols); |
243 { | 285 symbol_count++; |
244 i++; | 286 } |
245 length = static_cast <int> (pow (2, -i)); | |
246 } | |
247 while (i <= 0 && | |
248 !(l >= length && mdl >= longest_church_rest - i)); | |
249 | |
250 l -= length; | |
251 k = mdl + i; | |
252 | |
253 Stencil r (musfont->find_by_name ("rests." + to_string (k))); | |
254 if (k == 0) | |
255 { | |
256 Real staff_space = Staff_symbol_referencer::staff_space (me); | |
257 r.translate_axis (staff_space, Y_AXIS); | |
258 } | |
259 symbols_width += r.extent (X_AXIS).length (); | |
260 mols = scm_cons (r.smobbed_copy (), mols); | |
261 count++; | |
262 } | |
263 | 287 |
264 /* Make outer padding this much bigger. */ | 288 /* Make outer padding this much bigger. */ |
265 Real outer_padding_factor = 1.5; | 289 Real outer_padding_factor = 1.5; |
266 Real inner_padding = (space - symbols_width) | 290 Real inner_padding = (space - symbols_width) |
267 / (2 * outer_padding_factor + (count - 1)); | 291 / (2 * outer_padding_factor + (symbol_count - 1)); |
268 if (inner_padding < 0) | 292 if (inner_padding < 0) |
269 inner_padding = 1.0; | 293 inner_padding = 1.0; |
270 | 294 |
271 Stencil mol; | 295 Stencil mol; |
272 for (SCM s = mols; scm_is_pair (s); s = scm_cdr (s)) | 296 for (SCM s = mols; scm_is_pair (s); s = scm_cdr (s)) |
273 mol.add_at_edge (X_AXIS, LEFT, *unsmob_stencil (scm_car (s)), | 297 mol.add_at_edge (X_AXIS, LEFT, *unsmob_stencil (scm_car (s)), |
274 » » inner_padding); | 298 inner_padding); |
275 mol.align_to (X_AXIS, LEFT); | 299 mol.align_to (X_AXIS, LEFT); |
276 mol.translate_axis (outer_padding_factor * inner_padding, X_AXIS); | 300 mol.translate_axis (outer_padding_factor * inner_padding, X_AXIS); |
277 | 301 |
278 return mol; | 302 return mol; |
279 } | 303 } |
280 | 304 |
281 void | 305 void |
282 Multi_measure_rest::add_column (Grob *me, Item *c) | 306 Multi_measure_rest::add_column (Grob *me, Item *c) |
283 { | 307 { |
284 add_bound_item (dynamic_cast<Spanner *> (me), c); | 308 add_bound_item (dynamic_cast<Spanner *> (me), c); |
285 } | 309 } |
286 | 310 |
287 void | 311 void |
288 Multi_measure_rest::calculate_spacing_rods (Grob *me, Real length) | 312 Multi_measure_rest::calculate_spacing_rods (Grob *me, Real length) |
289 { | 313 { |
290 Spanner *sp = dynamic_cast<Spanner *> (me); | 314 Spanner *sp = dynamic_cast<Spanner *> (me); |
291 if (! (sp->get_bound (LEFT) && sp->get_bound (RIGHT))) | 315 if (! (sp->get_bound (LEFT) && sp->get_bound (RIGHT))) |
292 { | 316 { |
293 programming_error ("Multi_measure_rest::get_rods (): I am not spanned!"); | 317 programming_error ("Multi_measure_rest::get_rods (): I am not spanned!"); |
294 return; | 318 return; |
295 } | 319 } |
296 | 320 |
297 Item *li = sp->get_bound (LEFT)->get_column (); | 321 Item *li = sp->get_bound (LEFT)->get_column (); |
298 Item *ri = sp->get_bound (RIGHT)->get_column (); | 322 Item *ri = sp->get_bound (RIGHT)->get_column (); |
299 Item *lb = li->find_prebroken_piece (RIGHT); | 323 Item *lb = li->find_prebroken_piece (RIGHT); |
300 Item *rb = ri->find_prebroken_piece (LEFT); | 324 Item *rb = ri->find_prebroken_piece (LEFT); |
301 | 325 |
302 Item *combinations[4][2] = {{li, ri}, | 326 Item *combinations[4][2] = {{li, ri}, |
303 » » » {lb, ri}, | 327 {lb, ri}, |
304 » » » {li, rb}, | 328 {li, rb}, |
305 » » » {lb, rb}}; | 329 {lb, rb} |
| 330 }; |
306 | 331 |
307 for (int i = 0; i < 4; i++) | 332 for (int i = 0; i < 4; i++) |
308 { | 333 { |
309 Item *li = combinations[i][0]; | 334 Item *li = combinations[i][0]; |
310 Item *ri = combinations[i][1]; | 335 Item *ri = combinations[i][1]; |
311 | 336 |
312 if (!li || !ri) | 337 if (!li || !ri) |
313 » continue; | 338 continue; |
314 | 339 |
315 Rod rod; | 340 Rod rod; |
316 rod.item_drul_[LEFT] = li; | 341 rod.item_drul_[LEFT] = li; |
317 rod.item_drul_[RIGHT] = ri; | 342 rod.item_drul_[RIGHT] = ri; |
318 | 343 |
319 rod.distance_ = Paper_column::minimum_distance (li, ri) | 344 rod.distance_ = Paper_column::minimum_distance (li, ri) |
320 » + length | 345 + length |
321 » + 2 * robust_scm2double (me->get_property ("bound-padding"), 1.0); | 346 + 2 * robust_scm2double (me->get_property ("bound-padding"
), 1.0); |
322 | 347 |
323 Real minlen = robust_scm2double (me->get_property ("minimum-length"), 0); | 348 Real minlen = robust_scm2double (me->get_property ("minimum-length"), 0); |
324 rod.distance_ = max (rod.distance_, minlen); | 349 rod.distance_ = max (rod.distance_, minlen); |
325 rod.add_to_cols (); | 350 rod.add_to_cols (); |
326 } | 351 } |
327 } | 352 } |
328 | 353 |
329 MAKE_SCHEME_CALLBACK (Multi_measure_rest, set_spacing_rods, 1); | 354 MAKE_SCHEME_CALLBACK (Multi_measure_rest, set_spacing_rods, 1); |
330 SCM | 355 SCM |
331 Multi_measure_rest::set_spacing_rods (SCM smob) | 356 Multi_measure_rest::set_spacing_rods (SCM smob) |
332 { | 357 { |
333 Grob *me = unsmob_grob (smob); | 358 Grob *me = unsmob_grob (smob); |
334 Real sym_width = symbol_stencil (me, 0.0).extent (X_AXIS).length (); | 359 Real sym_width = symbol_stencil (me, 0.0).extent (X_AXIS).length (); |
335 calculate_spacing_rods (me, sym_width); | 360 calculate_spacing_rods (me, sym_width); |
336 | 361 |
337 return SCM_UNSPECIFIED; | 362 return SCM_UNSPECIFIED; |
338 } | 363 } |
339 | 364 |
340 MAKE_SCHEME_CALLBACK (Multi_measure_rest, set_text_rods, 1); | 365 MAKE_SCHEME_CALLBACK (Multi_measure_rest, set_text_rods, 1); |
341 SCM | 366 SCM |
342 Multi_measure_rest::set_text_rods (SCM smob) | 367 Multi_measure_rest::set_text_rods (SCM smob) |
343 { | 368 { |
344 Grob *me = unsmob_grob (smob); | 369 Grob *me = unsmob_grob (smob); |
345 Stencil *stil = me->get_stencil (); | 370 Stencil *stil = me->get_stencil (); |
346 | 371 |
347 /* FIXME uncached */ | 372 /* FIXME uncached */ |
348 Real len = (stil && !stil->extent (X_AXIS).is_empty ()) | 373 Real len = (stil && !stil->extent (X_AXIS).is_empty ()) |
349 ? stil->extent (X_AXIS).length () | 374 ? stil->extent (X_AXIS).length () |
350 : 0.0; | 375 : 0.0; |
351 calculate_spacing_rods (me, len); | 376 calculate_spacing_rods (me, len); |
352 | 377 |
353 return SCM_UNSPECIFIED; | 378 return SCM_UNSPECIFIED; |
354 } | 379 } |
355 | 380 |
356 ADD_INTERFACE (Multi_measure_rest, | 381 ADD_INTERFACE (Multi_measure_rest, |
357 » "A rest that spans a whole number of measures.", | 382 "A rest that spans a whole number of measures.", |
358 | 383 |
359 » /* properties */ | 384 /* properties */ |
360 » "bound-padding " | 385 "bound-padding " |
361 » "expand-limit " | 386 "expand-limit " |
362 » "hair-thickness " | 387 "hair-thickness " |
363 » "measure-count " | 388 "measure-count " |
364 » "measure-length " | 389 "minimum-length " |
365 » "minimum-length " | 390 "round-up-exceptions " |
366 » "round-to-longer-rest " | 391 "round-up-to-longer-rest " |
367 » "spacing-pair " | 392 "spacing-pair " |
368 » "thick-thickness " | 393 "thick-thickness " |
369 » "usable-duration-logs " | 394 "usable-duration-logs " |
370 » ); | 395 ); |
LEFT | RIGHT |