From: David Kastrup Date: Sat, 27 Feb 2016 10:41:08 +0000 (+0100) Subject: Issue 4718/1: In-chord tie in cue causes segfault X-Git-Tag: release/2.19.38-1~17^2~11 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=3d54e4a6f45ccfb3847290cd0bdbefe4d21d7924;p=lilypond.git Issue 4718/1: In-chord tie in cue causes segfault 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. --- diff --git a/lily/include/music.hh b/lily/include/music.hh index b25ead9de5..bf9cf2d7ea 100644 --- a/lily/include/music.hh +++ b/lily/include/music.hh @@ -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); diff --git a/lily/include/prob.hh b/lily/include/prob.hh index 7a06e47737..cb850555fb 100644 --- a/lily/include/prob.hh +++ b/lily/include/prob.hh @@ -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); }; diff --git a/lily/music-sequence.cc b/lily/music-sequence.cc index d280953714..049300442b 100644 --- a/lily/music-sequence.cc +++ b/lily/music-sequence.cc @@ -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 (scm_car (s))->transpose (rq); + unsmob (scm_car (s))->transpose (rq); } Moment diff --git a/lily/music.cc b/lily/music.cc index 60d33436b9..5e646f5b95 100644 --- a/lily/music.cc +++ b/lily/music.cc @@ -220,7 +220,7 @@ transpose_mutable (SCM alist, Pitch delta) } else if (scm_is_eq (prop, ly_symbol2scm ("element"))) { - if (Music *m = unsmob (val)) + if (Prob *m = unsmob (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;