]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/define-music-types.scm
* stepmake/aclocal.m4 (STEPMAKE_PANGO_FT2): Define HAVE_PANGO16 too.
[lilypond.git] / scm / define-music-types.scm
index 655b3ba215b40765004ad09f3b4328c0da209c9e..6d8a2c8ea9bfb0caedfdde95a7f0ec3dd6e2112a 100644 (file)
@@ -2,7 +2,7 @@
 ;;;;
 ;;;;  source file of the GNU LilyPond music typesetter
 ;;;; 
-;;;; (c)  1998--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+;;;; (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 ;;;;                Jan Nieuwenhuizen <janneke@gnu.org>
 
 ;; TODO: should link back into user manual.
@@ -230,7 +230,7 @@ Syntax: @var{note}\\cr
 
 Syntax: @code{\\key } @var{name} @var{scale}.")
 
-       (internal-class-name . "Key_change_ev")
+       (internal-class-name . "Event")
        (types . (general-music key-change-event event))
        ))
     
@@ -352,7 +352,7 @@ SYNTAX
      . (
        (description .  "Combine two parts on a staff, either merged or
 as separate voices.")
-       (internal-class-name . "Simultaneous_music")
+       (internal-class-name . "Music")
        (length-callback . ,Music_sequence::maximum_length_callback)
        (start-callback . ,Music_sequence::minimum_start_callback)
        (types . (general-music part-combine-music))
@@ -406,7 +406,8 @@ goes down).")
     
     (RelativeOctaveCheck
      . ((description . "Check if a pitch is in the correct octave.")
-       (internal-class-name . "Relative_octave_check")
+       (internal-class-name . "Music")
+       (to-relative-callback . ,Relative_octave_check::relative_callback)
        (types . (general-music relative-octave-check))
        ))
     
@@ -451,7 +452,7 @@ previously added property from a graphical object definition
 
 Syntax \\sequential @{..@} or simply @{..@} .")
 
-       (internal-class-name . "Sequential_music")
+       (internal-class-name . "Music")
        (length-callback . ,Music_sequence::cumulative_length_callback)
        (start-callback . ,Music_sequence::first_start_callback)
        (iterator-ctor . ,Sequential_music_iterator::constructor)
@@ -464,7 +465,7 @@ Syntax \\sequential @{..@} or simply @{..@} .")
 to group start-mmrest, skip, stop-mmrest sequence. 
 
 Syntax @code{R2.*5} for 5 measures in 3/4 time.")
-       (internal-class-name . "Sequential_music")
+       (internal-class-name . "Music")
        (length-callback . ,Music_sequence::cumulative_length_callback)
        (start-callback . ,Music_sequence::first_start_callback)
        (iterator-ctor . ,Sequential_music_iterator::constructor)
@@ -499,10 +500,11 @@ SYNTAX
 
 @code{ \\simultaneous @{ .. @}} or < .. >.")
 
-       (internal-class-name . "Simultaneous_music")
+       (internal-class-name . "Music")
        (iterator-ctor . ,Simultaneous_music_iterator::constructor)
        (start-callback . ,Music_sequence::minimum_start_callback)
        (length-callback . ,Music_sequence::maximum_length_callback)
+       (to-relative-callback . ,Music_sequence::simultaneous_relative_callback)
        
        (types . (general-music simultaneous-music))
        ))
@@ -566,15 +568,17 @@ Syntax @code{\\times @var{fraction} @var{music}}, e.g.
     (TransposedMusic
      . (
        (description .  "Music that has been transposed.")
-       (internal-class-name . "Transposed_music")
+       (internal-class-name . "Music_wrapper")
+       (to-relative-callback . ,Relative_octave_music::no_relative_callback)
        (types . (music-wrapper-music general-music transposed-music))
        ))
 
     (UntransposableMusic
      . (
        (description .  "Music that can not be transposed.")
-
-       (internal-class-name . "Untransposable_music")
+       (to-relative-callback . ,Relative_octave_music::no_relative_callback)
+       (untransposable . #t)
+       (internal-class-name . "Music_wrapper")
        (types . (music-wrapper-music general-music untransposable-music)) 
        ))
 
@@ -582,27 +586,28 @@ Syntax @code{\\times @var{fraction} @var{music}}, e.g.
      . (
        (description .  "Music that can not be converted from relative to absolute notation.
 For example, transposed music.")
-       (internal-class-name . "Un_relativable_music")
+       (to-relative-callback . ,Relative_octave_music::no_relative_callback)
+       (internal-class-name . "Music_wrapper")
        (types . (music-wrapper-music general-music unrelativable-music))
        ))
 
     (RelativeOctaveMusic
      . (
        (description .  "Music that was entered in relative octave notation.")
-
-       (internal-class-name . "Relative_octave_music")
+       (to-relative-callback . ,Relative_octave_music::relative_callback)
+       (internal-class-name . "Music_wrapper")
        (types . (music-wrapper-music general-music relative-octave-music))
        ))
     
     (EventChord
      . (
        (description .  "Internally used to group a set of events.")
-       (internal-class-name . "Event_chord")
+       (internal-class-name . "Music")
        (iterator-ctor . ,Event_chord_iterator::constructor)
        (length-callback . ,Music_sequence::maximum_length_callback)
+       (to-relative-callback . ,Music_sequence::event_chord_relative_callback)
        (types . (general-music event-chord simultaneous-music))
-       )
-     )
+       ))
     
     (ScriptEvent
      . (
@@ -715,7 +720,7 @@ Syntax: @code{\\\\}")
     (VoltaRepeatedMusic
      . (
        (iterator-ctor . ,Volta_repeat_iterator::constructor)
-       (internal-class-name . "Repeated_music")
+       (internal-class-name . "Music")
        (description . "")
        (start-callback .  ,Repeated_music::first_start)
        (length-callback . ,Repeated_music::volta_music_length)
@@ -727,13 +732,13 @@ Syntax: @code{\\\\}")
        (iterator-ctor . ,Unfolded_repeat_iterator::constructor)
        (description .  "")
        (start-callback .  ,Repeated_music::first_start)
-       (internal-class-name . "Repeated_music")
+       (internal-class-name . "Music")
        (types . (general-music repeated-music unfolded-repeated-music))
        (length-callback . ,Repeated_music::unfolded_music_length)
        ))
     (PercentRepeatedMusic
      . (
-       (internal-class-name . "Repeated_music")
+       (internal-class-name . "Music")
        (description .  "Repeats encoded by percents.")
        (iterator-ctor . ,Percent_repeat_iterator::constructor)
        (start-callback .  ,Repeated_music::first_start)
@@ -745,7 +750,7 @@ Syntax: @code{\\\\}")
      . (
        (iterator-ctor . ,Chord_tremolo_iterator::constructor)
        (description .  "Repeated notes denoted by tremolo beams.")
-       (internal-class-name . "Repeated_music")
+       (internal-class-name . "Music")
        (start-callback .  ,Repeated_music::first_start)
 
        ;; the length of the repeat is handled by shifting the note logs
@@ -756,7 +761,7 @@ Syntax: @code{\\\\}")
     
     (FoldedRepeatedMusic
      . (
-       (internal-class-name . "Repeated_music")
+       (internal-class-name . "Music")
        (description .  "Repeats with alternatives placed in parallel. ")
        (iterator-ctor  . ,Folded_repeat_iterator::constructor)
        (start-callback .  ,Repeated_music::minimum_start)
@@ -785,7 +790,7 @@ Syntax: @code{\\\\}")
          (cons (car x) lst)))
       music-descriptions))
 
-(define-public (make-music name . music-properties)
+(define-safe-public (make-music name . music-properties)
   "Create a music object of given name, and set its properties
 according to `music-properties', a list of alterning property symbols
 and values. E.g:
@@ -794,10 +799,10 @@ and values. E.g:
              'grob-property 'thickness
              'grob-value (* 2 1.5))"
   (if (not (symbol? name))
-      (error (format "Not a symbol: ~a" name)))
+      (ly:error (_ "symbol expected: ~S") name))
   (let ((props (hashq-ref music-name-to-property-table name '())))
     (if (not (pair? props))
-       (error "Can not find music object" name))
+       (ly:error (_ "can't find music object: ~S") name))
     (let ((m (ly:make-bare-music (cdr (assoc 'internal-class-name props)) props)))
       (define (set-props mus-props)
        (if (and (not (null? mus-props))
@@ -817,7 +822,8 @@ and values. E.g:
         (music-name (if (pair? handle)
                         (cdr handle)
                         (begin
-                          (ly:warn "Unknown repeat type `~S'\nSee music-types.scm for supported repeats" name)
+                          (ly:warning (_ "unknown repeat type `~S'") name)
+                          (ly:warning (_ "See music-types.scm for supported repeats"))
                           'VoltaRepeatedMusic))))
     (make-music music-name)))