]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/define-music-types.scm
Merge branch 'lilypond/translation' of ssh://git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / scm / define-music-types.scm
index f54342781c664918a0fed287b90e043248d7be08..0ed92520443c7d10f5fafa5fae77856644c6529c 100644 (file)
@@ -1,9 +1,20 @@
-;;;; define-music-types.scm --
+;;;; This file is part of LilyPond, the GNU music typesetter.
 ;;;;
-;;;;  source file of the GNU LilyPond music typesetter
-;;;;
-;;;; (c) 1998--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
+;;;; Copyright (C) 1998--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
 ;;;;                Jan Nieuwenhuizen <janneke@gnu.org>
+;;;;
+;;;; 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 <http://www.gnu.org/licenses/>.
 
 ;; TODO: should link back into user manual.
 
@@ -120,6 +131,13 @@ Syntax: @var{note}@code{\\breathe}")
        (types . (general-music event breathing-event))
        ))
 
+    (ClusterNoteEvent
+     . ((description . "A note that is part of a cluster.")
+       ;; not a note-event, to ensure that Note_heads_engraver doesn't eat it.
+       (types . (general-music cluster-note-event melodic-event
+                 rhythmic-event event))
+       ))
+
     (ContextChange
      . ((description . "Change staves in Piano staff.
 
@@ -128,13 +146,6 @@ Syntax: @code{\\change Staff = @var{new-id}}")
        (types . (general-music translator-change-instruction))
        ))
 
-    (ClusterNoteEvent
-     . ((description . "A note that is part of a cluster.")
-       ;; not a note-event, to ensure that Note_engraver doesn't eat it.
-       (types . (general-music cluster-note-event melodic-event
-                 rhythmic-event event))
-       ))
-
     (ContextSpeccedMusic
      . ((description . "Interpret the argument music within a
 specific context.")
@@ -166,11 +177,6 @@ An alternative syntax is @var{note}@code{\\decr} @dots{}
                  event))
        ))
 
-    (ExtenderEvent
-     . ((description . "Extend lyrics.")
-       (types . (general-music extender-event event))
-       ))
-
     (Event
      . ((description . "Atomic music event.")
        (types . (general-music event))
@@ -185,6 +191,11 @@ An alternative syntax is @var{note}@code{\\decr} @dots{}
        (types . (general-music event-chord simultaneous-music))
        ))
 
+    (ExtenderEvent
+     . ((description . "Extend lyrics.")
+       (types . (general-music extender-event event))
+       ))
+
     (FingeringEvent
      . ((description . "Specify what finger to use for this note.")
        (types . (general-music fingering-event event))
@@ -405,9 +416,13 @@ Syntax: @code{\\unset @var{context}.@var{prop}}")
        (types . (music-wrapper-music general-music relative-octave-music))
        ))
 
-    (RepeatTieEvent
-     . ((description . "Ties for starting a second volta bracket.")
-       (types . (general-music event repeat-tie-event))
+    (RepeatedChord
+     . ((description . "A chord repetition")
+       (to-relative-callback . ,ly:music-sequence::repeated-chord-relative-callback)
+       (iterator-ctor . ,ly:music-wrapper-iterator::constructor)
+       (start-callback . ,ly:music-wrapper::start-callback)
+       (length-callback . ,ly:music-wrapper::length-callback)
+       (types . (general-music music-wrapper-music))
        ))
 
     (RepeatedMusic
@@ -415,6 +430,11 @@ Syntax: @code{\\unset @var{context}.@var{prop}}")
        (types . (general-music repeated-music))
        ))
 
+    (RepeatTieEvent
+     . ((description . "Ties for starting a second volta bracket.")
+       (types . (general-music event repeat-tie-event))
+       ))
+
     (RestEvent
      . ((description . "A Rest.
 
@@ -690,14 +710,14 @@ and values. E.g:
       m)))
 
 (define-public (make-repeated-music name)
-  (let* ((handle (assoc name '(("volta" . VoltaRepeatedMusic)
-                              ("unfold" . UnfoldedRepeatedMusic)
-                              ("percent" . PercentRepeatedMusic)
-                              ("tremolo" . TremoloRepeatedMusic))))
-        (music-name (if (pair? handle)
-                        (cdr handle)
-                        (begin
-                          (ly:warning (_ "unknown repeat type `~S'") name)
-                          (ly:warning (_ "See define-music-types.scm for supported repeats"))
-                          'VoltaRepeatedMusic))))
-    (make-music music-name)))
+  (let* ((repeated-music (assoc-get name '(("volta" . VoltaRepeatedMusic)
+                                          ("unfold" . UnfoldedRepeatedMusic)
+                                          ("percent" . PercentRepeatedMusic)
+                                          ("tremolo" . TremoloRepeatedMusic))))
+        (repeated-music-name (if repeated-music
+                                 repeated-music
+                                 (begin
+                                   (ly:warning (_ "unknown repeat type `~S'") name)
+                                   (ly:warning (_ "See define-music-types.scm for supported repeats"))
+                                   'VoltaRepeatedMusic))))
+    (make-music repeated-music-name)))