From 380a3c6e2c3e155f74c95507aed3a25ce796bd6e Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Tue, 1 Oct 2002 22:24:16 +0000 Subject: [PATCH] (get_state): cleanup (get_music_info): cleanup. --- ChangeLog | 5 +++++ lily/paper-outputter.cc | 5 ++++- lily/part-combine-music-iterator.cc | 28 ++++++++++--------------- scm/backend-documentation-lib.scm | 6 +++++- scm/translator-property-description.scm | 8 ++++++- 5 files changed, 32 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 79fd140ed7..96d453bc1c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-10-02 Han-Wen Nienhuys + + * lily/part-combine-music-iterator.cc (get_state): cleanup + (get_music_info): cleanup. + 2002-10-01 Han-Wen Nienhuys * scm/backend-documentation-lib.scm (interface-doc-string): diff --git a/lily/paper-outputter.cc b/lily/paper-outputter.cc index 76c21ce2ae..1ecba00755 100644 --- a/lily/paper-outputter.cc +++ b/lily/paper-outputter.cc @@ -39,7 +39,10 @@ Paper_outputter::Paper_outputter (String name) file_ = scm_open_file (scm_makfrom0str (name.to_str0 ()), scm_makfrom0str ("w")); - + + /* + ugh. + */ SCM exp = scm_list_n (ly_symbol2scm ("find-dumper"), scm_makfrom0str (output_format_global.to_str0 ()), SCM_UNDEFINED); diff --git a/lily/part-combine-music-iterator.cc b/lily/part-combine-music-iterator.cc index 89e20c52cd..d71f53e268 100644 --- a/lily/part-combine-music-iterator.cc +++ b/lily/part-combine-music-iterator.cc @@ -154,20 +154,16 @@ get_music_info (Moment m, Music_iterator* iter, SCM *pitches, SCM *durations) for (SCM i = iter->get_pending_events (m); gh_pair_p (i); i = ly_cdr (i)) { Music *m = unsmob_music (ly_car (i)); - if (m->is_mus_type ("melodic-event")) - *pitches = gh_cons (m->get_mus_property ("pitch"), *pitches); - if (m->is_mus_type ("rhythmic-event")) - { - SCM d = m->get_mus_property ("duration"); - if (d == SCM_EOL) - m->origin ()->warning ("Music has no duration\n"); - else - *durations = gh_cons (d, *durations); - } + SCM p = m->get_mus_property ("pitch"); + SCM d = m->get_mus_property ("duration"); + if (unsmob_pitch (p)) + *pitches = gh_cons (p, *pitches); + if (unsmob_duration (d)) + *durations = gh_cons (d, *durations); } } } - + int Part_combine_music_iterator::get_state (Moment) { @@ -234,10 +230,8 @@ Part_combine_music_iterator::get_state (Moment) if (first_pitches != SCM_EOL && second_pitches != SCM_EOL) { - scm_sort_list_x (first_pitches, - scm_primitive_eval (ly_symbol2scm ("Pitch::less_p"))); - scm_sort_list_x (second_pitches, - scm_primitive_eval (ly_symbol2scm ("Pitch::less_p"))); + scm_sort_list_x (first_pitches, Pitch::less_p_proc); + scm_sort_list_x (second_pitches, Pitch::less_p_proc); interval = gh_int2scm (unsmob_pitch (ly_car (first_pitches))->steps () - unsmob_pitch (ly_car (scm_last_pair (second_pitches)))->steps ()); @@ -246,14 +240,14 @@ Part_combine_music_iterator::get_state (Moment) if (first_durations != SCM_EOL) { scm_sort_list_x (first_durations, - scm_primitive_eval (ly_symbol2scm ("Duration::less_p"))); + Duration::less_p_proc); first_mom += unsmob_duration (ly_car (first_durations))->get_length (); } if (second_durations != SCM_EOL) { scm_sort_list_x (second_durations, - scm_primitive_eval (ly_symbol2scm ("Duration::less_p"))); + Duration::less_p_proc); second_mom += unsmob_duration (ly_car (second_durations))->get_length (); } diff --git a/scm/backend-documentation-lib.scm b/scm/backend-documentation-lib.scm index f5d730e269..c12296f34e 100644 --- a/scm/backend-documentation-lib.scm +++ b/scm/backend-documentation-lib.scm @@ -47,8 +47,9 @@ Interfaces: )) -(define iface->grob-table (make-vector 61 '())) +(define iface->grob-table (make-vector 61 '())) +;; extract ifaces, and put grob into the hash table. (map (lambda (x) (let* @@ -86,6 +87,9 @@ Interfaces: ))) (define (grob-doc description) + "Given a property alist DESCRIPTION, make a documentation +node." + (let* ( (metah (assoc 'meta description)) diff --git a/scm/translator-property-description.scm b/scm/translator-property-description.scm index bc49a7cbdd..75547fe6ef 100644 --- a/scm/translator-property-description.scm +++ b/scm/translator-property-description.scm @@ -152,7 +152,13 @@ a queue of (END-MOMENT . GROB) conses. This is for internal (C++) use only. Use at your own risk. This property contains the grobs for which END-MOMENT >= NOW. ") (translator-property-description 'centralCPosition number? "Place of the central C. Usually determined by looking at clefPosition and clefGlyph.") -(translator-property-description 'changeMoment moment-pair? "duration that voices are examined for differences, when part-combining. Usually unset or zero when combining threads into one voice, and 1 (or the duration of one measure) when combining voices into one staff.") +(translator-property-description + 'changeMoment moment-pair? + "duration that voices are examined for differences, when +part-combining. Usually unset or zero when combining threads into one +voice, and 1 (or the duration of one measure) when combining voices +into one staff.") + (translator-property-description 'chordChanges boolean? "Only show changes in chords scheme?") (translator-property-description 'clefGlyph string? "Name of the symbol within the music font") (translator-property-description 'clefOctavation integer? "Add -- 2.39.5