Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(239)

Delta Between Two Patch Sets: scm/lily.scm

Issue 5626052: Gets vertical skylines from grob stencils (Closed)
Left Patch Set: Better skylines for clefs Created 13 years, 1 month ago
Right Patch Set: Run astyle on c++ files Created 12 years, 6 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
LEFTRIGHT
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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 (coverage:enable)) 282 (coverage:enable))
283 283
284 (define-public parser #f) 284 (define-public parser #f)
285 285
286 (define music-string-to-path-backends 286 (define music-string-to-path-backends
287 '(svg)) 287 '(svg))
288 288
289 (if (memq (ly:get-option 'backend) music-string-to-path-backends) 289 (if (memq (ly:get-option 'backend) music-string-to-path-backends)
290 (ly:set-option 'music-strings-to-paths #t)) 290 (ly:set-option 'music-strings-to-paths #t))
291 291
292
293 (define-public (ly:load x) 292 (define-public (ly:load x)
294 (let* ((file-name (%search-load-path x))) 293 (let* ((file-name (%search-load-path x)))
295 (ly:debug "[~A" file-name) 294 (ly:debug "[~A" file-name)
296 (if (not file-name) 295 (if (not file-name)
297 (ly:error (_ "cannot find: ~A") x)) 296 (ly:error (_ "cannot find: ~A") x))
298 (primitive-load-path file-name) ;; to support Guile V2 autocompile 297 (primitive-load-path file-name) ;; to support Guile V2 autocompile
299 ;; TODO: Any chance to use ly:debug here? Need to extend it to prevent 298 ;; TODO: Any chance to use ly:debug here? Need to extend it to prevent
300 ;; a newline in this case 299 ;; a newline in this case
301 (if (ly:get-option 'verbose) 300 (if (ly:get-option 'verbose)
302 (ly:progress "]\n")))) 301 (ly:progress "]\n"))))
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 ;; - Main body of files to be loaded 375 ;; - Main body of files to be loaded
377 (define init-scheme-files-body 376 (define init-scheme-files-body
378 '("file-cache.scm" 377 '("file-cache.scm"
379 "define-event-classes.scm" 378 "define-event-classes.scm"
380 "define-music-callbacks.scm" 379 "define-music-callbacks.scm"
381 "define-music-types.scm" 380 "define-music-types.scm"
382 "define-note-names.scm" 381 "define-note-names.scm"
383 "c++.scm" 382 "c++.scm"
384 "chord-entry.scm" 383 "chord-entry.scm"
385 "stencil.scm" 384 "stencil.scm"
386 "stencil-integral.scm"
387 "define-markup-commands.scm" 385 "define-markup-commands.scm"
388 "markup.scm" 386 "markup.scm"
389 "modal-transforms.scm" 387 "modal-transforms.scm"
390 "chord-generic-names.scm" 388 "chord-generic-names.scm"
391 "chord-ignatzek-names.scm" 389 "chord-ignatzek-names.scm"
392 "music-functions.scm" 390 "music-functions.scm"
393 "part-combiner.scm" 391 "part-combiner.scm"
394 "autochange.scm" 392 "autochange.scm"
395 "define-music-properties.scm" 393 "define-music-properties.scm"
396 "time-signature-settings.scm" 394 "time-signature-settings.scm"
397 "auto-beam.scm" 395 "auto-beam.scm"
398 "chord-name.scm" 396 "chord-name.scm"
399 "bezier-tools.scm" 397 "bezier-tools.scm"
400 "ly-syntax-constructors.scm" 398 "ly-syntax-constructors.scm"
401 399
402 "define-context-properties.scm" 400 "define-context-properties.scm"
403 "translation-functions.scm" 401 "translation-functions.scm"
404 "script.scm" 402 "script.scm"
405 "midi.scm" 403 "midi.scm"
406 "layout-beam.scm" 404 "layout-beam.scm"
407 "parser-clef.scm" 405 "parser-clef.scm"
408 "layout-slur.scm" 406 "layout-slur.scm"
409 "font.scm" 407 "font.scm"
410 "encoding.scm" 408 "encoding.scm"
411 409
410 "bar-line.scm"
412 "flag-styles.scm" 411 "flag-styles.scm"
413 "fret-diagrams.scm" 412 "fret-diagrams.scm"
414 "tablature.scm" 413 "tablature.scm"
415 "harp-pedals.scm" 414 "harp-pedals.scm"
416 "define-woodwind-diagrams.scm" 415 "define-woodwind-diagrams.scm"
417 "display-woodwind-diagrams.scm" 416 "display-woodwind-diagrams.scm"
418 "predefined-fretboards.scm" 417 "predefined-fretboards.scm"
419 "define-grob-properties.scm" 418 "define-grob-properties.scm"
420 "define-grobs.scm" 419 "define-grobs.scm"
421 "define-grob-interfaces.scm" 420 "define-grob-interfaces.scm"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 (,number-or-string? . "number or string") 503 (,number-or-string? . "number or string")
505 (,number-pair? . "pair of numbers") 504 (,number-pair? . "pair of numbers")
506 (,rhythmic-location? . "rhythmic location") 505 (,rhythmic-location? . "rhythmic location")
507 (,scheme? . "any type") 506 (,scheme? . "any type")
508 (,string-or-pair? . "string or pair") 507 (,string-or-pair? . "string or pair")
509 (,string-or-symbol? . "string or symbol") 508 (,string-or-symbol? . "string or symbol")
510 (,void? . "void") 509 (,void? . "void")
511 )) 510 ))
512 511
513 (define-public lilypond-exported-predicates 512 (define-public lilypond-exported-predicates
514 `((,ly:box? . "box") 513 `((,ly:book? . "book")
514 (,ly:box? . "box")
515 (,ly:context? . "context") 515 (,ly:context? . "context")
516 (,ly:context-def? . "context definition")
516 (,ly:context-mod? . "context modification") 517 (,ly:context-mod? . "context modification")
517 (,ly:dimension? . "dimension, in staff space") 518 (,ly:dimension? . "dimension, in staff space")
518 (,ly:dir? . "direction") 519 (,ly:dir? . "direction")
519 (,ly:dispatcher? . "dispatcher") 520 (,ly:dispatcher? . "dispatcher")
520 (,ly:duration? . "duration") 521 (,ly:duration? . "duration")
521 (,ly:event? . "post event") 522 (,ly:event? . "post event")
522 (,ly:font-metric? . "font metric") 523 (,ly:font-metric? . "font metric")
523 (,ly:grob? . "graphical (layout) object") 524 (,ly:grob? . "graphical (layout) object")
524 (,ly:grob-array? . "array of grobs") 525 (,ly:grob-array? . "array of grobs")
525 (,ly:input-location? . "input location") 526 (,ly:input-location? . "input location")
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 589
589 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 590 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
590 ;; debug memory leaks 591 ;; debug memory leaks
591 592
592 (define gc-dumping 593 (define gc-dumping
593 #f) 594 #f)
594 595
595 (define gc-protect-stat-count 596 (define gc-protect-stat-count
596 0) 597 0)
597 598
599 ;; Undead objects that should be ignored after the first time round
600 (define gc-zombies
601 (make-weak-key-hash-table 0))
602
598 (define-public (dump-live-object-stats outfile) 603 (define-public (dump-live-object-stats outfile)
599 (for-each (lambda (x) 604 (for-each (lambda (x)
600 (format outfile "~a: ~a\n" (car x) (cdr x))) 605 (format outfile "~a: ~a\n" (car x) (cdr x)))
601 (sort (gc-live-object-stats) 606 (sort (gc-live-object-stats)
602 (lambda (x y) 607 (lambda (x y)
603 (string<? (car x) (car y)))))) 608 (string<? (car x) (car y))))))
604 609
605 (define-public (dump-gc-protects) 610 (define-public (dump-gc-protects)
606 (set! gc-protect-stat-count (1+ gc-protect-stat-count)) 611 (set! gc-protect-stat-count (1+ gc-protect-stat-count))
607 (let* ((protects (sort (hash-table->alist (ly:protects)) 612 (let* ((protects (sort (hash-table->alist (ly:protects))
(...skipping 26 matching lines...) Expand all
634 (if (defined? 'gc-live-object-stats) 639 (if (defined? 'gc-live-object-stats)
635 (let* ((stats #f)) 640 (let* ((stats #f))
636 (ly:progress "Live object statistics: GC'ing\n") 641 (ly:progress "Live object statistics: GC'ing\n")
637 (ly:reset-all-fonts) 642 (ly:reset-all-fonts)
638 (gc) 643 (gc)
639 (gc) 644 (gc)
640 (ly:progress "Asserting dead objects\n") 645 (ly:progress "Asserting dead objects\n")
641 (ly:set-option 'debug-gc-assert-parsed-dead #t) 646 (ly:set-option 'debug-gc-assert-parsed-dead #t)
642 (gc) 647 (gc)
643 (ly:set-option 'debug-gc-assert-parsed-dead #f) 648 (ly:set-option 'debug-gc-assert-parsed-dead #f)
649 (for-each
650 (lambda (x)
651 (if (not (hashq-ref gc-zombies x))
652 (begin
653 (ly:programming-error "Parsed object should be dead: ~a" x)
654 (hashq-set! gc-zombies x #t))))
655 (ly:parsed-undead-list!))
644 (set! stats (gc-live-object-stats)) 656 (set! stats (gc-live-object-stats))
645 (ly:progress "Dumping live object statistics.\n") 657 (ly:progress "Dumping live object statistics.\n")
646 (dump-live-object-stats outfile))) 658 (dump-live-object-stats outfile)))
647 (newline outfile) 659 (newline outfile)
648 (let* ((stats (gc-stats))) 660 (let* ((stats (gc-stats)))
649 (for-each (lambda (sym) 661 (for-each (lambda (sym)
650 (format outfile "~a ~a ~a\n" 662 (format outfile "~a ~a ~a\n"
651 gc-protect-stat-count 663 gc-protect-stat-count
652 sym 664 sym
653 (assoc-get sym stats "?"))) 665 (assoc-get sym stats "?")))
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
824 (dump-profile x start-measurements (profile-measurements))) 836 (dump-profile x start-measurements (profile-measurements)))
825 (if (ly:get-option 'trace-memory-frequency) 837 (if (ly:get-option 'trace-memory-frequency)
826 (begin (mtrace:stop-trace) 838 (begin (mtrace:stop-trace)
827 (mtrace:dump-results base))) 839 (mtrace:dump-results base)))
828 (for-each (lambda (s) 840 (for-each (lambda (s)
829 (ly:set-option (car s) (cdr s))) 841 (ly:set-option (car s) (cdr s)))
830 all-settings) 842 all-settings)
831 (ly:set-option 'debug-gc-assert-parsed-dead #t) 843 (ly:set-option 'debug-gc-assert-parsed-dead #t)
832 (gc) 844 (gc)
833 (ly:set-option 'debug-gc-assert-parsed-dead #f) 845 (ly:set-option 'debug-gc-assert-parsed-dead #f)
846 (for-each
847 (lambda (x)
848 (ly:programming-error "Parsed object should be dead: ~a" x))
849 (ly:parsed-undead-list!))
834 (if (ly:get-option 'debug-gc) 850 (if (ly:get-option 'debug-gc)
835 (dump-gc-protects) 851 (dump-gc-protects)
836 (ly:reset-all-fonts)) 852 (ly:reset-all-fonts))
837 (flush-all-ports))) 853 (flush-all-ports)))
838 files) 854 files)
839 855
840 ;; Ensure a notice re failed files is written to aggregate logfile. 856 ;; Ensure a notice re failed files is written to aggregate logfile.
841 (if ping-log 857 (if ping-log
842 (format ping-log "Failed files: ~a\n" failed)) 858 (format ping-log "Failed files: ~a\n" failed))
843 (if (ly:get-option 'dump-profile) 859 (if (ly:get-option 'dump-profile)
844 (dump-profile "lily-run-total" '(0 0) (profile-measurements))) 860 (dump-profile "lily-run-total" '(0 0) (profile-measurements)))
845 failed)) 861 failed))
862
863 (define-public lilypond-declarations '())
846 864
847 (define (lilypond-file handler file-name) 865 (define (lilypond-file handler file-name)
848 (catch 'ly-file-failed 866 (catch 'ly-file-failed
849 (lambda () (ly:parse-file file-name)) 867 (lambda () (ly:parse-file file-name))
850 (lambda (x . args) (handler x file-name)))) 868 (lambda (x . args) (handler x file-name))))
851 869
852 (use-modules (scm editor)) 870 (use-modules (scm editor))
853 871
854 (define-public (gui-main files) 872 (define-public (gui-main files)
855 (if (null? files) 873 (if (null? files)
(...skipping 17 matching lines...) Expand all
873 (ly:exit 0 #f))))) 891 (ly:exit 0 #f)))))
874 892
875 (define (gui-no-files-handler) 893 (define (gui-no-files-handler)
876 (let* ((ly (string-append (ly:effective-prefix) "/ly/")) 894 (let* ((ly (string-append (ly:effective-prefix) "/ly/"))
877 ;; FIXME: soft-code, localize 895 ;; FIXME: soft-code, localize
878 (welcome-ly (string-append ly "Welcome_to_LilyPond.ly")) 896 (welcome-ly (string-append ly "Welcome_to_LilyPond.ly"))
879 (cmd (get-editor-command welcome-ly 0 0 0))) 897 (cmd (get-editor-command welcome-ly 0 0 0)))
880 (ly:message (_ "Invoking `~a'...\n") cmd) 898 (ly:message (_ "Invoking `~a'...\n") cmd)
881 (system cmd) 899 (system cmd)
882 (ly:exit 1 #f))) 900 (ly:exit 1 #f)))
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b