]> git.donarmstrong.com Git - lilypond.git/commitdiff
(get_state): cleanup
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 1 Oct 2002 22:24:16 +0000 (22:24 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 1 Oct 2002 22:24:16 +0000 (22:24 +0000)
(get_music_info): cleanup.

ChangeLog
lily/paper-outputter.cc
lily/part-combine-music-iterator.cc
scm/backend-documentation-lib.scm
scm/translator-property-description.scm

index 79fd140ed7196c5cc85d8c9d7bcc5f88767a3029..96d453bc1ca410f1588e936eda3dc398aca4368e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-10-02  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
+
+       * lily/part-combine-music-iterator.cc (get_state): cleanup
+       (get_music_info): cleanup.
+
 2002-10-01  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
 
        * scm/backend-documentation-lib.scm (interface-doc-string):
index 76c21ce2ae2d89cef8d85b62ad42417166df1b48..1ecba007553c43b3e79a25519cdc8f7d2b16d8a4 100644 (file)
@@ -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);
index 89e20c52cd81a584febf531e5c223fad6bb4a2af..d71f53e268cce99d3768319d31831fc7887437ac 100644 (file)
@@ -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 ();
            }
          
index f5d730e2698847e1d872a5f0bf5e0b12dbc94aaa..c12296f34e607f66ec4d93889d2d4155de5daa1d 100644 (file)
@@ -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))
index bc49a7cbdd54d6d8437b4b9a7e04edaca2f585e3..75547fe6ef98d1ff255d04d2e27156bcc2c324e4 100644 (file)
@@ -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