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) 1996--2019 Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 Copyright (C) 1996--2020 Han-Wen Nienhuys <hanwen@xs4all.nl> |
5 Jan Nieuwenhuizen <janneke@gnu.org> | 5 Jan Nieuwenhuizen <janneke@gnu.org> |
6 | 6 |
7 LilyPond is free software: you can redistribute it and/or modify | 7 LilyPond is free software: you can redistribute it and/or modify |
8 it under the terms of the GNU General Public License as published by | 8 it under the terms of the GNU General Public License as published by |
9 the Free Software Foundation, either version 3 of the License, or | 9 the Free Software Foundation, either version 3 of the License, or |
10 (at your option) any later version. | 10 (at your option) any later version. |
11 | 11 |
12 LilyPond is distributed in the hope that it will be useful, | 12 LilyPond is distributed in the hope that it will be useful, |
13 but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
(...skipping 21 matching lines...) Expand all Loading... |
36 #include "staff-symbol-referencer.hh" | 36 #include "staff-symbol-referencer.hh" |
37 #include "stem.hh" | 37 #include "stem.hh" |
38 #include "text-interface.hh" | 38 #include "text-interface.hh" |
39 #include "tie.hh" | 39 #include "tie.hh" |
40 #include "warn.hh" | 40 #include "warn.hh" |
41 #include "slur-scoring.hh" | 41 #include "slur-scoring.hh" |
42 #include "separation-item.hh" | 42 #include "separation-item.hh" |
43 #include "unpure-pure-container.hh" | 43 #include "unpure-pure-container.hh" |
44 #include "international.hh" | 44 #include "international.hh" |
45 | 45 |
| 46 using std::string; |
| 47 using std::vector; |
| 48 |
46 MAKE_SCHEME_CALLBACK (Slur, calc_direction, 1) | 49 MAKE_SCHEME_CALLBACK (Slur, calc_direction, 1) |
47 SCM | 50 SCM |
48 Slur::calc_direction (SCM smob) | 51 Slur::calc_direction (SCM smob) |
49 { | 52 { |
50 Grob *me = unsmob<Grob> (smob); | 53 Grob *me = unsmob<Grob> (smob); |
51 extract_grob_set (me, "note-columns", encompasses); | 54 extract_grob_set (me, "note-columns", encompasses); |
52 | 55 |
53 if (encompasses.empty ()) | 56 if (encompasses.empty ()) |
54 { | 57 { |
55 me->suicide (); | 58 me->suicide (); |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 break; | 360 break; |
358 } | 361 } |
359 if (do_shift) | 362 if (do_shift) |
360 break; | 363 break; |
361 } | 364 } |
362 if (do_shift) | 365 if (do_shift) |
363 break; | 366 break; |
364 } | 367 } |
365 } | 368 } |
366 | 369 |
367 Real avoidance_offset = do_shift ? curve.minmax (X_AXIS, max (xext[LEFT], curv
e.control_[0][X_AXIS] + EPS), min (xext[RIGHT], curve.control_[3][X_AXIS] - EPS)
, dir) - yext[-dir] : 0.0; | 370 Real avoidance_offset = do_shift ? curve.minmax (X_AXIS, std::max (xext[LEFT],
curve.control_[0][X_AXIS] + EPS), std::min (xext[RIGHT], curve.control_[3][X_AX
IS] - EPS), dir) - yext[-dir] : 0.0; |
368 | 371 |
369 return scm_from_double (offset + avoidance_offset); | 372 return scm_from_double (offset + avoidance_offset); |
370 } | 373 } |
371 | 374 |
372 MAKE_SCHEME_CALLBACK (Slur, vertical_skylines, 1); | 375 MAKE_SCHEME_CALLBACK (Slur, vertical_skylines, 1); |
373 SCM | 376 SCM |
374 Slur::vertical_skylines (SCM smob) | 377 Slur::vertical_skylines (SCM smob) |
375 { | 378 { |
376 Grob *me = unsmob<Grob> (smob); | 379 Grob *me = unsmob<Grob> (smob); |
377 vector<Box> boxes; | 380 vector<Box> boxes; |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 | 488 |
486 Grob *common = common_refpoint_of_array (cols, me, Y_AXIS); | 489 Grob *common = common_refpoint_of_array (cols, me, Y_AXIS); |
487 common = common_refpoint_of_array (non_sep_extras, common, Y_AXIS); | 490 common = common_refpoint_of_array (non_sep_extras, common, Y_AXIS); |
488 | 491 |
489 return scm_from_bool (common != me->get_parent (Y_AXIS)); | 492 return scm_from_bool (common != me->get_parent (Y_AXIS)); |
490 } | 493 } |
491 | 494 |
492 ADD_INTERFACE (Slur, | 495 ADD_INTERFACE (Slur, |
493 "A slur." | 496 "A slur." |
494 "\n" | 497 "\n" |
495 "Slurs are formatted by a number of combination of left/right " | 498 "Slurs are formatted by trying a number of combinations of left/r
ight" |
496 "end-point, and then picking the slur with the lowest demerit sco
re. " | 499 " end point, and then picking the slur with the lowest demerit sc
ore." |
497 "The combinations are generated by going from the base attachment
s " | 500 " The combinations are generated by going from the base attachmen
ts" |
498 "(ie. note heads) in the direction in half space increments until
we " | 501 " (i.e., note heads) in the direction in half space increments un
til we" |
499 "have covered @code{region-size} staff spaces. " | 502 " have covered @code{region-size} staff spaces." |
500 "The following properties may be set in the @code{details}" | 503 " The following properties may be set in the @code{details}" |
501 " list.\n" | 504 " list.\n" |
502 "\n" | 505 "\n" |
503 "@table @code\n" | 506 "@table @code\n" |
504 "@item region-size\n" | 507 "@item region-size\n" |
505 "Size of region (in staff spaces) for determining" | 508 "Size of region (in staff spaces) for determining" |
506 " potential endpoints in the Y direction.\n" | 509 " potential endpoints in the Y direction.\n" |
507 "@item head-encompass-penalty\n" | 510 "@item head-encompass-penalty\n" |
508 "Demerit to apply when note heads collide with a slur.\n" | 511 "Demerit to apply when note heads collide with a slur.\n" |
509 "@item stem-encompass-penalty\n" | 512 "@item stem-encompass-penalty\n" |
510 "Demerit to apply when stems collide with a slur.\n" | 513 "Demerit to apply when stems collide with a slur.\n" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 "eccentricity " | 580 "eccentricity " |
578 "encompass-objects " | 581 "encompass-objects " |
579 "height-limit " | 582 "height-limit " |
580 "inspect-quants " | 583 "inspect-quants " |
581 "line-thickness " | 584 "line-thickness " |
582 "note-columns " | 585 "note-columns " |
583 "positions " | 586 "positions " |
584 "ratio " | 587 "ratio " |
585 "thickness " | 588 "thickness " |
586 ); | 589 ); |
587 | |
LEFT | RIGHT |