From: Han-Wen Nienhuys Date: Sat, 28 Sep 2002 21:02:25 +0000 (+0000) Subject: * lily/context-specced-music-iterator.cc (class X-Git-Tag: release/1.7.2~26 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=d3bfb37a84872d98f245ca416e4b6c1d9a147b71;p=lilypond.git * lily/context-specced-music-iterator.cc (class Context_specced_music_iterator): new file. Obsoletes the Context_specced_music type. * scm/music-types.scm (make-repeated-music): put different kinds of repeated music into music-type table. --- diff --git a/ChangeLog b/ChangeLog index 6837226ed3..6d555e3249 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2002-09-28 Han-Wen Nienhuys + * lily/context-specced-music-iterator.cc (class + Context_specced_music_iterator): new file. Obsoletes the + Context_specced_music type. + + * scm/music-types.scm (make-repeated-music): put different kinds + of repeated music into music-type table. + + * VERSION: 1.7.1 released. + * scm/to-xml.scm: new file. * input/test/to-xml.ly (fooBar): demo of what is possible with the diff --git a/lily/command-request.cc b/lily/command-request.cc deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lily/context-specced-music.cc b/lily/context-specced-music.cc deleted file mode 100644 index 333b74770e..0000000000 --- a/lily/context-specced-music.cc +++ /dev/null @@ -1,16 +0,0 @@ -/* - context-specced-music.cc -- implement Context_specced_music - - source file of the GNU LilyPond music typesetter - - (c) 1999--2002 Han-Wen Nienhuys - - */ -#include "context-specced-music.hh" - - -Context_specced_music::Context_specced_music () -{ -} - -ADD_MUSIC (Context_specced_music); diff --git a/lily/include/context-specced-music.hh b/lily/include/context-specced-music.hh deleted file mode 100644 index e1ca431fcf..0000000000 --- a/lily/include/context-specced-music.hh +++ /dev/null @@ -1,23 +0,0 @@ -/* - context-specced-music.hh -- declare Context_specced_music - - source file of the GNU LilyPond music typesetter - - (c) 1999--2002 Han-Wen Nienhuys - - */ - -#ifndef CONTEXT_SPECCED_MUSIC_HH -#define CONTEXT_SPECCED_MUSIC_HH - -#include "music-wrapper.hh" - -class Context_specced_music : public Music_wrapper -{ -public: - Context_specced_music (); - Context_specced_music (SCM); - VIRTUAL_COPY_CONS (Music); -}; -#endif /* CONTEXT_SPECCED_MUSIC_HH */ - diff --git a/lily/include/key-item.hh b/lily/include/key-item.hh deleted file mode 100644 index 65296f8106..0000000000 --- a/lily/include/key-item.hh +++ /dev/null @@ -1,2 +0,0 @@ - -#error diff --git a/lily/include/line-of-score.hh b/lily/include/line-of-score.hh deleted file mode 100644 index 65296f8106..0000000000 --- a/lily/include/line-of-score.hh +++ /dev/null @@ -1,2 +0,0 @@ - -#error diff --git a/lily/include/tuplet-spanner.hh b/lily/include/tuplet-spanner.hh deleted file mode 100644 index 65296f8106..0000000000 --- a/lily/include/tuplet-spanner.hh +++ /dev/null @@ -1,2 +0,0 @@ - -#error diff --git a/lily/music-iterator.cc b/lily/music-iterator.cc index a6d2a721a4..51aba71a78 100644 --- a/lily/music-iterator.cc +++ b/lily/music-iterator.cc @@ -15,7 +15,6 @@ #include "music-wrapper.hh" #include "music-wrapper-iterator.hh" #include "simple-music-iterator.hh" -#include "context-specced-music.hh" #include "ly-smobs.icc" @@ -131,25 +130,6 @@ Music_iterator::init_translator (Music *m, Translator_group *report) { music_ = m; assert (m); - if (Context_specced_music * csm =dynamic_cast (m)) - { - SCM ct = csm->get_mus_property ("context-type"); - String c_type; - if (gh_string_p (ct)) - c_type = ly_scm2string (ct); - - String c_id; - SCM ci = csm->get_mus_property ("context-id"); - if (gh_string_p (ci)) - c_id = ly_scm2string (ci); - - Translator_group* a - =report->find_create_translator (c_type, c_id); - - set_translator (a); - - } - if (! report_to ()) set_translator (report); } diff --git a/lily/musical-request.cc b/lily/musical-request.cc deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lily/parser.yy b/lily/parser.yy index 03ad891732..68dae70124 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -729,8 +729,15 @@ Repeated_music: _("More alternatives than repeats. Junking excess alternatives.")); alts = ly_truncate_list (times, alts); } - - Music *r = MY_MAKE_MUSIC("RepeatedMusic"); + + + static SCM proc; + if (!proc) + proc = scm_c_eval_string ("make-repeated-music"); + + SCM mus = scm_call_1 (proc, $2); + scm_gc_protect_object (mus); // UGH. + Music *r =unsmob_music (mus); if (beg) { r-> set_mus_property ("element", beg->self_scm ()); @@ -739,9 +746,6 @@ Repeated_music: r->set_mus_property ("repeat-count", gh_int2scm (times >? 1)); r-> set_mus_property ("elements",alts); - SCM func = scm_primitive_eval (ly_symbol2scm ("repeat-name-to-ctor")); - SCM result = gh_call1 (func, $2); - if (gh_equal_p ($2, scm_makfrom0str ("tremolo"))) { /* @@ -754,9 +758,6 @@ Repeated_music: else gh_call3 (func, r->self_scm (), gh_int2scm(-intlog2 ($3)), gh_int2scm(0)); } - - set_music_properties (r, result); - r->set_spot (*$4->origin ()); $$ = r; diff --git a/scm/music-functions.scm b/scm/music-functions.scm index 8c0476ce1d..4132342c2b 100644 --- a/scm/music-functions.scm +++ b/scm/music-functions.scm @@ -52,37 +52,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; repeats. -(define-public (repeat-name-to-ctor name) - (let* - ((supported-reps - `(("volta" . ((iterator-ctor . ,Volta_repeat_iterator::constructor) - (start-moment-function . ,Repeated_music::first_start) - (length . ,Repeated_music::volta_music_length))) - - ("unfold" . ((iterator-ctor . ,Unfolded_repeat_iterator::constructor) - (start-moment-function . ,Repeated_music::first_start) - (length . ,Repeated_music::unfolded_music_length))) - ("fold" . ((iterator-ctor . ,Folded_repeat_iterator::constructor) - (start-moment-function . ,Repeated_music::minimum_start) - (length . ,Repeated_music::folded_music_length))) - ("percent" . ((iterator-ctor . ,Percent_repeat_iterator::constructor) - (start-moment-function . ,Repeated_music::first_start) - (length . ,Repeated_music::unfolded_music_length))) - ("tremolo" . ((iterator-ctor . ,Chord_tremolo_iterator::constructor) - (start-moment-function . ,Repeated_music::first_start) - - ;; the length of the repeat is handled by shifting the note logs - (length . ,Repeated_music::folded_music_length))))) - - (handle (assoc name supported-reps))) - - (if (pair? handle) - (cdr handle) - (begin - (ly-warn - (string-append "Unknown repeat type `" name "'\nSee scm/c++.scm for supported repeats")) - '(type . 'repeated-music))))) - (define-public (unfold-repeats music) " This function replaces all repeats with unfold repeats. It was diff --git a/scm/music-types.scm b/scm/music-types.scm index e3a6c5a717..ef08c59fd4 100644 --- a/scm/music-types.scm +++ b/scm/music-types.scm @@ -35,8 +35,7 @@ )) (BarCheck . ( - (description . "") - + (description . "") (internal-class-name . "Music") (types . (general-music bar-check)) (iterator-ctor . ,Bar_check_iterator::constructor) @@ -79,8 +78,8 @@ (ContextSpeccedMusic . ( (description . "") - - (internal-class-name . "Context_specced_music") + (iterator-ctor . ,Context_specced_music_iterator::constructor) + (internal-class-name . "Music_wrapper") (types . (context-specification general-music music-wrapper-music)) )) (CrescendoEvent @@ -251,7 +250,6 @@ . ( (description . "") - (internal-class-name . "Repeated_music") (type . repeated-music) (types . (general-music repeated-music)) )) @@ -453,8 +451,58 @@ (internal-class-name . "Music") (types . (separator general-music)) )) - - )) + + (VoltaRepeatedMusic + . ( + (iterator-ctor . ,Volta_repeat_iterator::constructor) + (internal-class-name . "Repeated_music") + (description . "") + (start-moment-function . ,Repeated_music::first_start) + (length . ,Repeated_music::volta_music_length) + (types . (general-music repeated-music volta-repeated-music)) + )) + + (UnfoldedRepeatedMusic + . ( + (iterator-ctor . ,Unfolded_repeat_iterator::constructor) + (description . "") + (start-moment-function . ,Repeated_music::first_start) + (internal-class-name . "Repeated_music") + (types . (general-music repeated-music unfolded-repeated-music)) + (length . ,Repeated_music::unfolded_music_length) + )) + (PercentRepeatedMusic + . ( + (internal-class-name . "Repeated_music") + (description . "") + (iterator-ctor . ,Percent_repeat_iterator::constructor) + (start-moment-function . ,Repeated_music::first_start) + (length . ,Repeated_music::unfolded_music_length) + (types . (general-music repeated-music percent-repeated-music)) + )) + + (TremoloRepeteadMusic + . ( + (iterator-ctor . ,Chord_tremolo_iterator::constructor) + (description . "") + (internal-class-name . "Repeated_music") + (start-moment-function . ,Repeated_music::first_start) + + ;; the length of the repeat is handled by shifting the note logs + (length . ,Repeated_music::folded_music_length) + (types . (general-music repeated-music tremolo-repeated-music)) + + )) + (FoldedRepeatedMusic + . ( + (internal-class-name . "Repeated_music") + (description . "") + (iterator-ctor . ,Folded_repeat_iterator::constructor) + (start-moment-function . ,Repeated_music::minimum_start) + (length . ,Repeated_music::folded_music_length) + (types . (general-music repeated-music folded-repeated-music)) + )) + )) (set! music-descriptions (sort music-descriptions alist