LEFT | RIGHT |
1 ;;;; This file is part of LilyPond, the GNU music typesetter. | 1 ;;;; This file is part of LilyPond, the GNU music typesetter. |
2 ;;;; | 2 ;;;; |
3 ;;;; Copyright (C) 1998--2012 Jan Nieuwenhuizen <janneke@gnu.org> | 3 ;;;; Copyright (C) 1998--2012 Jan Nieuwenhuizen <janneke@gnu.org> |
4 ;;;; Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 ;;;; Han-Wen Nienhuys <hanwen@xs4all.nl> |
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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 (define-public (rhythmic-location<? a b) | 309 (define-public (rhythmic-location<? a b) |
310 (cond | 310 (cond |
311 ((< (car a) (car b)) #t) | 311 ((< (car a) (car b)) #t) |
312 ((> (car a) (car b)) #f) | 312 ((> (car a) (car b)) #f) |
313 (else | 313 (else |
314 (ly:moment<? (cdr a) (cdr b))))) | 314 (ly:moment<? (cdr a) (cdr b))))) |
315 | 315 |
316 (define-public (rhythmic-location<=? a b) | 316 (define-public (rhythmic-location<=? a b) |
317 (not (rhythmic-location<? b a))) | 317 (not (rhythmic-location<? b a))) |
318 (define-public (rhythmic-location>=? a b) | 318 (define-public (rhythmic-location>=? a b) |
319 (rhythmic-location<? a b)) | 319 (not (rhythmic-location<? a b))) |
320 (define-public (rhythmic-location>? a b) | 320 (define-public (rhythmic-location>? a b) |
321 (rhythmic-location<? b a)) | 321 (rhythmic-location<? b a)) |
322 | 322 |
323 (define-public (rhythmic-location=? a b) | 323 (define-public (rhythmic-location=? a b) |
324 (and (rhythmic-location<=? a b) | 324 (and (rhythmic-location<=? a b) |
325 (rhythmic-location<=? b a))) | 325 (rhythmic-location<=? b a))) |
326 | 326 |
327 (define-public (rhythmic-location->file-string a) | 327 (define-public (rhythmic-location->file-string a) |
328 (ly:format "~a.~a.~a" | 328 (ly:format "~a.~a.~a" |
329 (car a) | 329 (car a) |
(...skipping 21 matching lines...) Expand all Loading... |
351 (ly:grob-property parent 'break-visibility all-invisible))) | 351 (ly:grob-property parent 'break-visibility all-invisible))) |
352 (define-public (inherit-y-parent-visibility grob) | 352 (define-public (inherit-y-parent-visibility grob) |
353 (let ((parent (ly:grob-parent grob X))) | 353 (let ((parent (ly:grob-parent grob X))) |
354 (ly:grob-property parent 'break-visibility))) | 354 (ly:grob-property parent 'break-visibility))) |
355 | 355 |
356 | 356 |
357 (define-public spanbar-begin-of-line-invisible #(#t #f #f)) | 357 (define-public spanbar-begin-of-line-invisible #(#t #f #f)) |
358 | 358 |
359 | 359 |
360 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 360 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
361 ;; Bar lines. | 361 ;; neighbor-interface routines |
362 | 362 |
363 ;; | |
364 ;; How should a bar line behave at a break? | |
365 (define bar-glyph-alist | |
366 '((":|:" . (":|" . "|:")) | |
367 (":|.|:" . (":|" . "|:")) | |
368 (":|.:" . (":|" . "|:")) | |
369 ("||:" . ("||" . "|:")) | |
370 ("dashed" . ("dashed" . '())) | |
371 ("|" . ("|" . ())) | |
372 ("||:" . ("||" . "|:")) | |
373 ("|s" . (() . "|")) | |
374 ("|:" . ("|" . "|:")) | |
375 ("|." . ("|." . ())) | |
376 | |
377 ;; hmm... should we end with a bar line here? | |
378 (".|" . ("|" . ".|")) | |
379 (":|" . (":|" . ())) | |
380 ("||" . ("||" . ())) | |
381 (".|." . (".|." . ())) | |
382 ("|.|" . ("|.|" . ())) | |
383 ("" . ("" . "")) | |
384 (":" . (":" . "")) | |
385 ("." . ("." . ())) | |
386 ("'" . ("'" . ())) | |
387 ("empty" . (() . ())) | |
388 ("brace" . (() . "brace")) | |
389 ("bracket" . (() . "bracket")) | |
390 | |
391 ;; segno bar lines | |
392 ("S" . ("||" . "S")) | |
393 ("|S" . ("|" . "S")) | |
394 ("S|" . ("S" . ())) | |
395 (":|S" . (":|" . "S")) | |
396 (":|S." . (":|S" . ())) | |
397 ("S|:" . ("S" . "|:")) | |
398 (".S|:" . ("|" . "S|:")) | |
399 (":|S|:" . (":|" . "S|:")) | |
400 (":|S.|:" . (":|S" . "|:")) | |
401 | |
402 ;; ancient bar lines | |
403 ("kievan" . ("kievan" . "")))) | |
404 | |
405 (define-public (bar-line::calc-glyph-name grob) | |
406 (let* ((glyph (ly:grob-property grob 'glyph)) | |
407 » (dir (ly:item-break-dir grob)) | |
408 » (result (assoc-get glyph bar-glyph-alist)) | |
409 » (glyph-name (if (= dir CENTER) | |
410 » » » glyph | |
411 » » (if (and result | |
412 » » » » (string? (index-cell result dir))) | |
413 » » » (index-cell result dir) | |
414 » » » #f)))) | |
415 glyph-name)) | |
416 | |
417 (define-public (bar-line::calc-break-visibility grob) | |
418 (let* ((glyph (ly:grob-property grob 'glyph)) | |
419 » (result (assoc-get glyph bar-glyph-alist))) | |
420 | |
421 (if result | |
422 » (vector (string? (car result)) #t (string? (cdr result))) | |
423 » all-invisible))) | |
424 | 363 |
425 (define-public (shift-right-at-line-begin g) | 364 (define-public (shift-right-at-line-begin g) |
426 "Shift an item to the right, but only at the start of the line." | 365 "Shift an item to the right, but only at the start of the line." |
427 (if (and (ly:item? g) | 366 (if (and (ly:item? g) |
428 (equal? (ly:item-break-dir g) RIGHT)) | 367 (equal? (ly:item-break-dir g) RIGHT)) |
429 (ly:grob-translate-axis! g 3.5 X))) | 368 (ly:grob-translate-axis! g 3.5 X))) |
430 | 369 |
431 (define-public (pure-from-neighbor-interface::extra-spacing-height-at-beginning-
of-line grob) | 370 (define-public (pure-from-neighbor-interface::extra-spacing-height-at-beginning-
of-line grob) |
432 (if (= 1 (ly:item-break-dir grob)) | 371 (if (= 1 (ly:item-break-dir grob)) |
433 (pure-from-neighbor-interface::extra-spacing-height grob) | 372 (pure-from-neighbor-interface::extra-spacing-height grob) |
434 (cons -0.1 0.1))) | 373 (cons -0.1 0.1))) |
435 | 374 |
436 (define-public (pure-from-neighbor-interface::extra-spacing-height grob) | 375 (define-public (pure-from-neighbor-interface::extra-spacing-height grob) |
437 (let* ((height (ly:grob::stencil-height grob)) | 376 (let* ((height (ly:grob-pure-height grob grob 0 10000000)) |
438 (from-neighbors (interval-union | 377 (from-neighbors (interval-union |
439 height | 378 height |
440 (ly:axis-group-interface::pure-height | 379 (ly:axis-group-interface::pure-height |
441 grob | 380 grob |
442 0 | 381 0 |
443 10000000)))) | 382 10000000)))) |
444 (coord-operation - from-neighbors height))) | 383 (coord-operation - from-neighbors height))) |
445 | 384 |
446 (define-public (pure-from-neighbor-interface::account-for-span-bar grob) | 385 (define-public (pure-from-neighbor-interface::account-for-span-bar grob) |
447 (let* ((esh (pure-from-neighbor-interface::extra-spacing-height grob)) | 386 (let* ((esh (pure-from-neighbor-interface::extra-spacing-height grob)) |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
897 (if (string? text) | 836 (if (string? text) |
898 text | 837 text |
899 (vector-ref (ly:grob-property grob 'digit-names) | 838 (vector-ref (ly:grob-property grob 'digit-names) |
900 (1- (max (min 5 digit) 1)))))) | 839 (1- (max (min 5 digit) 1)))))) |
901 | 840 |
902 | 841 |
903 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 842 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
904 ;; dynamics | 843 ;; dynamics |
905 | 844 |
906 (define-public (hairpin::calc-grow-direction grob) | 845 (define-public (hairpin::calc-grow-direction grob) |
907 (if (eq? (ly:event-property (event-cause grob) 'class) 'decrescendo-event) | 846 (if (ly:in-event-class? (event-cause grob) 'decrescendo-event) |
908 START | 847 START |
909 STOP)) | 848 STOP)) |
910 | 849 |
911 (define-public (dynamic-text-spanner::before-line-breaking grob) | 850 (define-public (dynamic-text-spanner::before-line-breaking grob) |
912 "Monitor left bound of @code{DynamicTextSpanner} for absolute dynamics. | 851 "Monitor left bound of @code{DynamicTextSpanner} for absolute dynamics. |
913 If found, ensure @code{DynamicText} does not collide with spanner text by | 852 If found, ensure @code{DynamicText} does not collide with spanner text by |
914 changing @code{'attach-dir} and @code{'padding}. Reads the | 853 changing @code{'attach-dir} and @code{'padding}. Reads the |
915 @code{'right-padding} property of @code{DynamicText} to fine tune space | 854 @code{'right-padding} property of @code{DynamicText} to fine tune space |
916 between the two text elements." | 855 between the two text elements." |
917 (let ((left-bound (ly:spanner-bound grob LEFT))) | 856 (let ((left-bound (ly:spanner-bound grob LEFT))) |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1106 (list))))) | 1045 (list))))) |
1107 | 1046 |
1108 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 1047 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1109 ;; laissez-vibrer tie | 1048 ;; laissez-vibrer tie |
1110 ;; | 1049 ;; |
1111 ;; needed so we can make laissez-vibrer a pure print | 1050 ;; needed so we can make laissez-vibrer a pure print |
1112 ;; | 1051 ;; |
1113 (define-public (laissez-vibrer::print grob) | 1052 (define-public (laissez-vibrer::print grob) |
1114 (ly:tie::print grob)) | 1053 (ly:tie::print grob)) |
1115 | 1054 |
LEFT | RIGHT |