From 44da0becc0a2288abf9fd8c8cae324bf3443a33d Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Fri, 14 Jan 2005 17:18:24 +0000 Subject: [PATCH] * lily/include/music.hh (class Music): unvirtualize transpose(). * 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/include/music.hh | 12 ------------ lily/music.cc | 7 +++++++ lily/translator-group.cc | 5 ++--- lily/untransposable-music.cc | 10 ---------- scm/define-music-properties.scm | 4 +--- scm/define-music-types.scm | 2 +- 6 files changed, 11 insertions(+), 29 deletions(-) diff --git a/lily/include/music.hh b/lily/include/music.hh index 16536ccc2d..edca9632e8 100644 --- a/lily/include/music.hh +++ b/lily/include/music.hh @@ -15,19 +15,7 @@ #define is_mus_type(x) internal_is_music_type (ly_symbol2scm (x)) -/** Music is anything that has duration and supports both time compression and - transposition. - - In Lily, everything that can be thought to have a length and a pitch - (which has a duration which can be transposed) is considered "music", - - Music is hierarchical: - - @see Music_sequence - - TODO: make a equalp function for general music. - */ class Music { public: diff --git a/lily/music.cc b/lily/music.cc index 958eedc221..645b5d1846 100644 --- a/lily/music.cc +++ b/lily/music.cc @@ -17,6 +17,13 @@ #include "score.hh" #include "warn.hh" +/* + Music is anything that has duration and supports both time compression + and transposition. + + In Lily, everything that can be thought to have a length and a pitch + (which has a duration which can be transposed) is considered "music", +*/ bool Music::internal_is_music_type (SCM k) const { diff --git a/lily/translator-group.cc b/lily/translator-group.cc index d9a6a60930..27f0d336f2 100644 --- a/lily/translator-group.cc +++ b/lily/translator-group.cc @@ -108,7 +108,6 @@ recurse_over_translators (Context * c, Translator_method ptr, Direction dir) Translator_group * tg = dynamic_cast (c->implementation ()); - /* Top down: */ @@ -120,7 +119,7 @@ recurse_over_translators (Context * c, Translator_method ptr, Direction dir) (tg->*ptr) (); } - for (SCM s = c->children_contexts () ; scm_is_pair (s); + for (SCM s = c->children_contexts (); scm_is_pair (s); s = scm_cdr (s)) { recurse_over_translators (unsmob_context (scm_car (s)), ptr, dir); @@ -129,7 +128,7 @@ recurse_over_translators (Context * c, Translator_method ptr, Direction dir) if (dir == UP) { translator_each (tg->get_simple_trans_list (), - ptr); + ptr); (tg->*ptr) (); } diff --git a/lily/untransposable-music.cc b/lily/untransposable-music.cc index 02ef66debe..e791bde068 100644 --- a/lily/untransposable-music.cc +++ b/lily/untransposable-music.cc @@ -9,16 +9,6 @@ source file of the GNU LilyPond music typesetter #include "untransposable-music.hh" -/* - todo: This one, together with Un_relativable_music is ugh. - - fixthis. -*/ -void -Untransposable_music::transpose (Pitch) -{ -} - Pitch Untransposable_music::to_relative_octave (Pitch p) { diff --git a/scm/define-music-properties.scm b/scm/define-music-properties.scm index a441f45eb1..0dc5913765 100644 --- a/scm/define-music-properties.scm +++ b/scm/define-music-properties.scm @@ -97,8 +97,6 @@ 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") - (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 @@ -116,5 +114,5 @@ a string) for figured bass") (bracket-start ,boolean? "start a bracket here. TODO: use span requests?") (bracket-stop ,boolean? "stop a bracket here.") - + (untransposable ,boolean? "If set, this music is not transposed.") ))) diff --git a/scm/define-music-types.scm b/scm/define-music-types.scm index 5fac2678b5..96a4b37076 100644 --- a/scm/define-music-types.scm +++ b/scm/define-music-types.scm @@ -573,7 +573,7 @@ Syntax @code{\\times @var{fraction} @var{music}}, e.g. (UntransposableMusic . ( (description . "Music that can not be transposed.") - + (untransposable . #t) (internal-class-name . "Untransposable_music") (types . (music-wrapper-music general-music untransposable-music)) )) -- 2.39.2