From 02c7d07616fd310070e32b262959bc50f2cbd404 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Fri, 14 Jan 2005 14:51:41 +0000 Subject: [PATCH] * lily/sequential-music.cc: remove file. * lily/include/music.hh (class Music): replace Music::start_mom() by start-callback property * lily/time-scaled-music.cc: remove file. * lily/include/music.hh (class Music): include SCM init argument. (class Music): replace Music::get_length() virtual by length-callback property everywhere. --- lily/event.cc | 22 ---------------------- lily/include/music.hh | 1 + lily/lily-guile.cc | 19 +++++++++++++++++++ lily/music.cc | 2 +- scm/define-music-properties.scm | 14 ++++++-------- 5 files changed, 27 insertions(+), 31 deletions(-) diff --git a/lily/event.cc b/lily/event.cc index d25ec1a149..d4beba4c13 100644 --- a/lily/event.cc +++ b/lily/event.cc @@ -24,11 +24,6 @@ Event::length_callback (SCM m) return mom.smobbed_copy(); } -void -Event::compress (Moment m) -{ -} - Pitch Event::to_relative_octave (Pitch last) @@ -83,21 +78,4 @@ Key_change_ev::transpose (Pitch p) Event::transpose (p); } -bool -alist_equal_p (SCM a, SCM b) -{ - for (SCM s = a; - scm_is_pair (s); s = scm_cdr (s)) - { - SCM key = scm_caar (s); - SCM val = scm_cdar (s); - SCM l = scm_assoc (key, b); - - if (l == SCM_BOOL_F - || !ly_c_equal_p ( scm_cdr (l), val)) - - return false; - } - return true; -} ADD_MUSIC (Key_change_ev); diff --git a/lily/include/music.hh b/lily/include/music.hh index b0ddf77f3f..664b8be6b4 100644 --- a/lily/include/music.hh +++ b/lily/include/music.hh @@ -49,6 +49,7 @@ public: Moment get_length () const; Moment start_mom () const; void print () const; + /// Transpose, with the interval central C to #p# virtual void transpose (Pitch p); diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index 3b21744973..5c3c3a134e 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -703,3 +703,22 @@ alist_to_hashq (SCM alist) } return tab; } + + +bool +alist_equal_p (SCM a, SCM b) +{ + for (SCM s = a; + scm_is_pair (s); s = scm_cdr (s)) + { + SCM key = scm_caar (s); + SCM val = scm_cdar (s); + SCM l = scm_assoc (key, b); + + if (l == SCM_BOOL_F + || !ly_c_equal_p ( scm_cdr (l), val)) + + return false; + } + return true; +} diff --git a/lily/music.cc b/lily/music.cc index ea8e3d8d19..4ebfc6a13c 100644 --- a/lily/music.cc +++ b/lily/music.cc @@ -173,7 +173,7 @@ Music::compress (Moment factor) compress_music_list (get_property ("elements"), factor); Duration *d = unsmob_duration (get_property ("duration")); if (d) - set_property ("duration", d ->compressed (m.main_part_).smobbed_copy ()); + set_property ("duration", d ->compressed (factor.main_part_).smobbed_copy ()); } void diff --git a/scm/define-music-properties.scm b/scm/define-music-properties.scm index 8b730ef2ab..a441f45eb1 100644 --- a/scm/define-music-properties.scm +++ b/scm/define-music-properties.scm @@ -48,11 +48,8 @@ descend in the context tree.") (digit ,integer? "digit for fingering") (direction ,ly:dir? "Print this up or down?") (drum-type ,symbol? "Which percussion instrument to play this note on.") - (tags ,list? "List of symbols that for denoting extra details, e.g. @code{\\tag #'part ...} could tag a piece of music as only being active in a part.") - - (text-type ,symbol? "Particular type of text script (e.g. finger, dynamic).") (tempo-unit ,ly:duration? "The unit for the metronome count.") (tonic ,ly:pitch? "Base of the scale") @@ -91,10 +88,7 @@ For chord inversions, this is negative.") (quoted-context-type ,symbol? "The name of the context to direct quotes to, eg., @code{Voice}.") (quoted-context-id ,string? "The id of the context to direct quotes to, eg., @code{cue}.") - (type ,symbol? "The type of this music object. Determines iteration in some cases.") - (types ,list? "The types of this music -object; determines by what engraver this music expression is -processed.") + (to-relative-callback ,procedure? "How to transform a piece of music to relative pitches") (repeat-count ,integer? "do a @code{\repeat} how ofen?") (span-direction ,ly:dir? "Does this start or stop a spanner?") (split-list ,list? "splitting moments for part combiner.") @@ -103,8 +97,12 @@ starting grace notes.") (string-number ,integer? "The number of the string in a String_number_req") (symbol ,symbol? "Grob name to perform an override/revert on.") (text ,markup? "markup expression to be printed") - ;; markup? + (transpose-callback ,procedure? "How to transpose a piece of +music") (tremolo-type ,integer? "") + (type ,symbol? "The type of this music object. Determines iteration in some cases.") + (types ,list? "The types of this music object; determines by what +engraver this music expression is processed.") (value ,scheme? "Assignment value for a translation property") (what ,symbol? "What to change for auto-change. FIXME, naming") -- 2.39.5