X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fdocument-music.scm;h=bc9fa88ae1a01f1b7188fedda0972946e0feff61;hb=HEAD;hp=bd6a8ea7efe3e10ce39d71fcbb55a212f8cf4bee;hpb=2086beff8cd9949318c97a2a531edb8f04f45f8c;p=lilypond.git diff --git a/scm/document-music.scm b/scm/document-music.scm index bd6a8ea7ef..bc9fa88ae1 100644 --- a/scm/document-music.scm +++ b/scm/document-music.scm @@ -1,130 +1,148 @@ +;;;; This file is part of LilyPond, the GNU music typesetter. +;;;; +;;;; Copyright (C) 1998--2015 Han-Wen Nienhuys +;;;; Jan Nieuwenhuizen +;;;; +;;;; LilyPond is free software: you can redistribute it and/or modify +;;;; it under the terms of the GNU General Public License as published by +;;;; the Free Software Foundation, either version 3 of the License, or +;;;; (at your option) any later version. +;;;; +;;;; LilyPond is distributed in the hope that it will be useful, +;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;;; GNU General Public License for more details. +;;;; +;;;; You should have received a copy of the GNU General Public License +;;;; along with LilyPond. If not, see . (define (music-props-doc) (make #:name "Music properties" - #:desc "All music properties, including descriptions" + #:desc "All music properties, including descriptions." #:text - (let* ( - (ps (sort (map symbol->string all-music-properties) stringtexi 'music (string->symbol prop))) - ps)) - (texi (description-list->texi descs)) - ) - texi) - )) + (let* ((ps (sort (map symbol->string all-music-properties) ly:string-citexi 'music (string->symbol prop))) + ps)) + (texi (description-list->texi descs #f))) + texi))) -(define music-types->names (make-vector 61 '())) -(map (lambda (entry) - (let* - ( - (types (cdr (assoc 'types (cdr entry) ))) - ) - (map (lambda (type) - (hashq-set! music-types->names type - (cons (car entry) - (hashq-ref music-types->names type '()))) - - ) types) - - )) - music-descriptions) +(define music-types->names (make-hash-table 61)) - -(define (hash-table->alist t) - "Convert table t to list" - (apply append - (vector->list t) - )) +(for-each (lambda (entry) + (let* ((class (ly:camel-case->lisp-identifier (car entry))) + (classes (ly:make-event-class class))) + (if classes + (for-each + (lambda (cl) + (hashq-set! music-types->names cl + (cons (car entry) + (hashq-ref music-types->names cl '())))) + classes)))) + music-descriptions) (define (strip-description x) - (cons (symbol->string (car x)) - "")) + (cons (symbol->string (car x)) + "")) (define (music-type-doc entry) - (make - #:name (symbol->string (car entry)) - #:text - (string-append - "\nMusic event type @code{" - (symbol->string (car entry)) - "} is in Music objects of type " - (human-listify - (sort - (map (lambda (x) (ref-ify (symbol->string x))) - (cdr entry)) stringstring + (map ly:translator-name + (filter + (lambda (x) + (engraver-accepts-music-type? (car entry) x)) + all-engravers-list))))))) + (make + #:name (symbol->string (car entry)) + #:text + (string-append + "\nMusic event type @code{" + (symbol->string (car entry)) + "} is in music objects of type " + (human-listify + (map ref-ify (sort (map symbol->string (cdr entry)) + ly:string-ci #:name "Music classes" - #:children + #:children (map music-type-doc - (sort - (hash-table->alist music-types->names) alistalist music-types->names) ly:alist-cilisp-identifier namesym)) + (classes (ly:make-event-class class)) + (accept-list (if classes + (human-listify + (map ref-ify + (map symbol->string + (map ly:translator-name + (filter + (lambda (x) + (engraver-accepts-music-types? classes x)) + all-engravers-list))))) + "")) + (event-texi (if classes + (string-append + "\n\nEvent classes:\n" + (human-listify + (map ref-ify (sort (map symbol->string classes) + ly:string-cistring types))) - "\n\n" - "\n\nAccepted by: " - (human-listify - (map ref-ify - (map ly:translator-name - (filter-list - (lambda (x) (engraver-accepts-music-types? types x)) all-engravers-list)))) - "\n\nProperties: \n" + event-texi + "\n\nProperties:\n" (description-list->texi (map - (lambda (x) (document-property x 'music props)) - (map car props))) - - ) - )) + (lambda (x) (property->texi 'music x props)) + (sort (map car props) ly:symbol-ci #:name (symbol->string (car obj)) - #:text (music-doc-str obj) - )) + #:text (music-doc-str obj))) (define (music-expressions-doc) (make #:name "Music expressions" #:desc "Objects that represent music." #:children - (map music-object-doc music-descriptions) - )) - + (map music-object-doc music-descriptions))) + (define (music-doc-node) (make #:name "Music definitions" - #:desc "Definition of the Input data structures" + #:desc "Definition of the input data structures." #:children (list (music-expressions-doc) (music-types-doc) - (music-props-doc)) - )) - - - - + (music-props-doc))))