]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/request-chord.cc
* VERSION (MY_PATCH_LEVEL): make 1.7.0
[lilypond.git] / lily / request-chord.cc
index 170d4996dfb3e989d48a0864fef425a11d37cfe7..3de20f4b4f92535ef6d651ae9ef8bb81e92c9905 100644 (file)
@@ -7,13 +7,13 @@ Request_chord::Request_chord (SCM s)
   : Simultaneous_music (s)
 {
   set_mus_property ("iterator-ctor",
-                   Request_chord_iterator::constructor_cxx_function);
+                   Request_chord_iterator::constructor_proc);
 }
 
 Request_chord::Request_chord ()
 {
   set_mus_property ("iterator-ctor",
-                   Request_chord_iterator::constructor_cxx_function);
+                   Request_chord_iterator::constructor_proc);
 }
 
 Pitch
@@ -22,15 +22,26 @@ Request_chord::to_relative_octave (Pitch last)
   for (SCM s = music_list (); gh_pair_p (s);  s = ly_cdr (s))
     {
       Music * mus = unsmob_music (ly_car (s));
-      if (Melodic_req *m= dynamic_cast <Melodic_req *> (mus))
+      Melodic_req *m= dynamic_cast <Melodic_req *> (mus);
+
+      /*
+       kLudge: rests have pitches now as well.
+       */
+      Rest_req *r = dynamic_cast<Rest_req*> (mus);
+      
+      if (r || m)
        {
-         Pitch pit = *unsmob_pitch (m->get_mus_property ("pitch"));
+         Pitch *old_pit = unsmob_pitch (mus->get_mus_property ("pitch"));
+         if (!old_pit)
+           continue;
          
-         pit.to_relative_octave (last);
-         m->set_mus_property ("pitch", pit.smobbed_copy ());
-                 
-         return pit;
+         Pitch new_pit = *old_pit;
+         new_pit.to_relative_octave (last);
+         mus->set_mus_property ("pitch", new_pit.smobbed_copy ());
+
+         return new_pit;
        }
+
     }
   return last;
 }