From: hanwen Date: Thu, 25 Sep 2003 09:05:46 +0000 (+0000) Subject: * lily/script-engraver.cc (make_script_from_event): don't crash on X-Git-Tag: release/2.1.3~68 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=fff687666874f471f1b3d085882673ec1191fbb4;p=lilypond.git * lily/script-engraver.cc (make_script_from_event): don't crash on non-string articulation-type. * lily/new-fingering-engraver.cc (add_script): don't crash on 0 scripts (acknowledge_grob): warn about text script events. --- diff --git a/ChangeLog b/ChangeLog index 9b44584e0c..29cd7463e7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2003-09-25 Han-Wen Nienhuys + + * lily/script-engraver.cc (make_script_from_event): don't crash on + non-string articulation-type. + + * lily/new-fingering-engraver.cc (add_script): don't crash on + 0 scripts + (acknowledge_grob): warn about text script events. + 2003-09-24 Heikki Junes * buildscript/lilypond.words: fix path for drums.scm. diff --git a/lily/new-fingering-engraver.cc b/lily/new-fingering-engraver.cc index 10f5a7d6b2..a468aea0a1 100644 --- a/lily/new-fingering-engraver.cc +++ b/lily/new-fingering-engraver.cc @@ -79,6 +79,10 @@ New_fingering_engraver::acknowledge_grob (Grob_info inf) { add_fingering (inf.grob_ , m, note_ev); } + else if (m->is_mus_type ("text-script-event")) + { + m->origin ()->warning ("Can not add text scripts to individual note heads"); + } else if (m->is_mus_type ("script-event")) { add_script (inf.grob_, m, note_ev); @@ -94,7 +98,7 @@ New_fingering_engraver::acknowledge_grob (Grob_info inf) } extern Grob *make_script_from_event (SCM * descr, Translator_group*tg, Music * event, - int index); + int index); void New_fingering_engraver::add_script (Grob * head, Music * event, @@ -102,15 +106,18 @@ New_fingering_engraver::add_script (Grob * head, { Finger_tuple ft ; - ft.script_ =make_script_from_event (&ft.description_, daddy_trans_, event, 0); - - articulations_.push (ft); - announce_grob (ft.script_, event->self_scm ()); + Grob * g= make_script_from_event (&ft.description_, daddy_trans_, event, 0); + if (g) + { + ft.script_ =g ; + + articulations_.push (ft); + announce_grob (g, event->self_scm ()); - ft.script_->set_parent (head, X_AXIS); -} - + ft.script_->set_parent (head, X_AXIS); + } +} void diff --git a/lily/script-engraver.cc b/lily/script-engraver.cc index 4a55c1e634..3defd89c8d 100644 --- a/lily/script-engraver.cc +++ b/lily/script-engraver.cc @@ -82,12 +82,14 @@ Grob *make_script_from_event (SCM * descr, Translator_group*tg, Music * event, int index) { SCM alist = tg->get_property ("scriptDefinitions"); - SCM art = scm_assoc (event->get_mus_property ("articulation-type"), alist); + SCM art_type= event->get_mus_property ("articulation-type"); + SCM art = scm_assoc (art_type, alist); if (art == SCM_BOOL_F) { - String a = ly_scm2string (event->get_mus_property ("articulation-type")); - event->origin ()->warning (_f ("Don't know how to interpret articulation `%s'", a.to_str0 ())); + event->origin ()->warning (_("Don't know how to interpret articulation:")); + event->origin ()->warning (_("Scheme encoding: ")); + scm_write (art_type, scm_current_error_port ()); return 0 ; } diff --git a/lily/spacing-spanner.cc b/lily/spacing-spanner.cc index 996d2caf80..83902679d2 100644 --- a/lily/spacing-spanner.cc +++ b/lily/spacing-spanner.cc @@ -873,6 +873,27 @@ Spacing_spanner::note_spacing (Grob*me, Grob *lc, Grob *rc, when toying with mmrests, it is possible to have musical column on the left and non-musical on the right, spanning several measures. + + In 2.0.1, this still fucks up in an interesting way: + + +\score { +{ \property Score.skipBars = ##t + \context Staff = clarinet + { + \notes { + \time 3/4 \mark "72" +<< s1*0^"all" R4*3*11 >> + \mark "73" + R4*3*11 \mark "74" + d2 r4 + + + }}} + \paper { raggedright = ##t } +} + + */ Moment *dt = unsmob_moment (rc->get_grob_property ("measure-length"));