]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 4718/1: In-chord tie in cue causes segfault
authorDavid Kastrup <dak@gnu.org>
Sat, 27 Feb 2016 10:41:08 +0000 (11:41 +0100)
committerDavid Kastrup <dak@gnu.org>
Fri, 4 Mar 2016 11:36:35 +0000 (12:36 +0100)
This extends transposition functionality from Music expressions to
Prob in general since Stream_event also needs transposition in the
context of quoted music.  While at top level, Stream_event is
processed using the container-agnostic transpose_mutable, this does
not extend to the actual contents, and at least a Stream_event's
articulation list does not consist of Music expressions but again of
Stream_event elements.

lily/include/music.hh
lily/include/prob.hh
lily/music-sequence.cc
lily/music.cc

index b25ead9de5b4cc02f684d49a1209ea62a26be3dd..bf9cf2d7ea0a47d46633460aa912f45624ba8f51 100644 (file)
@@ -48,9 +48,6 @@ public:
   Moment start_mom () const;
   void print () const;
 
-  /// Transpose, with the interval central C to #p#
-  void transpose (Pitch p);
-
   /// Scale the music in time by #factor#.
   void compress (Moment factor);
 
index 7a06e4773705cc301e4add6dc0b93dca1fc5104d..cb850555fb414983ff0024c502fd66a0da920336 100644 (file)
@@ -20,6 +20,7 @@
 #ifndef PROPERTY_OBJECT_HH
 #define PROPERTY_OBJECT_HH
 
+#include "pitch.hh"
 #include "stencil.hh"
 #include "virtual-methods.hh"
 
@@ -61,6 +62,12 @@ public:
   SCM internal_get_property (SCM sym) const;
   void instrumented_set_property (SCM, SCM, const char *, int, const char *);
   void internal_set_property (SCM sym, SCM val);
+
+  // Needed in both Music and Stream_event
+  // For technical reasons defined in lily/music.cc
+  //
+  /// Transpose, with the interval central C to #p#
+  void transpose (Pitch p);
 };
 
 
index d280953714b820c25513cd4e54ddf89b84b2ba80..049300442bf0acad42e7a575080f7f93a7618c90 100644 (file)
@@ -30,7 +30,7 @@ void
 transpose_music_list (SCM lst, Pitch rq)
 {
   for (SCM s = lst; scm_is_pair (s); s = scm_cdr (s))
-    unsmob<Music> (scm_car (s))->transpose (rq);
+    unsmob<Prob> (scm_car (s))->transpose (rq);
 }
 
 Moment
index 60d33436b98bf1ea17cc2bad6475a222e8b60c45..5e646f5b9583ea7af1112b6119e886c587506210 100644 (file)
@@ -220,7 +220,7 @@ transpose_mutable (SCM alist, Pitch delta)
         }
       else if (scm_is_eq (prop, ly_symbol2scm ("element")))
         {
-          if (Music *m = unsmob<Music> (val))
+          if (Prob *m = unsmob<Prob> (val))
             m->transpose (delta);
         }
       else if (scm_is_eq (prop, ly_symbol2scm ("elements"))
@@ -236,7 +236,7 @@ transpose_mutable (SCM alist, Pitch delta)
 }
 
 void
-Music::transpose (Pitch delta)
+Prob::transpose (Pitch delta)
 {
   if (to_boolean (get_property ("untransposable")))
     return;