X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fdynamic-engraver.cc;h=51161d15017c7d43498d8773ee85053b514f3401;hb=c44e624300d9877c1790830902a10fd3868dd6d3;hp=2104235387883f64c54380d22a63c7d9b1a797eb;hpb=5a9b380cf51c1898688fdcad673ddf76bea79b33;p=lilypond.git diff --git a/lily/dynamic-engraver.cc b/lily/dynamic-engraver.cc index 2104235387..51161d1501 100644 --- a/lily/dynamic-engraver.cc +++ b/lily/dynamic-engraver.cc @@ -24,6 +24,7 @@ #include "stream-event.hh" #include "warn.hh" #include "spanner.hh" +#include "text-interface.hh" #include "translator.icc" @@ -175,6 +176,17 @@ Dynamic_engraver::process_music () } finished_cresc_ = cresc_; + + /* backwards compatibility with hairpinToBarline */ + if (finished_cresc_->get_property ("to-barline") == SCM_EOL) + { + bool use_bar = to_boolean (get_property ("hairpinToBarline")) + && scm_is_string (get_property ("whichBar")); + + finished_cresc_->set_property ("to-barline", scm_from_bool (use_bar)); + } + + announce_end_grob (finished_cresc_, SCM_EOL); cresc_ = 0; current_cresc_ev_ = 0; } @@ -252,16 +264,22 @@ Dynamic_engraver::process_music () context ()->set_property ((start_type + "Spanner").c_str (), SCM_EOL); s = get_property ((start_type + "Text").c_str ()); - /* - FIXME: use get_markup () to check type. - */ - if (scm_is_string (s) || scm_is_pair (s)) + if (Text_interface::is_markup (s)) { - cresc_->set_property ("edge-text", - scm_cons (s, scm_from_locale_string (""))); + cresc_->set_property ("text", s); context ()->set_property ((start_type + "Text").c_str (), SCM_EOL); } + + if (script_) + { + set_nested_property (cresc_, + scm_list_3 (ly_symbol2scm ("bound-details"), + ly_symbol2scm ("left"), + ly_symbol2scm ("attach-dir") + ), + scm_from_int (RIGHT)); + } } if (script_) @@ -328,18 +346,11 @@ Dynamic_engraver::typeset_all () { if (finished_cresc_) { - bool use_bar = to_boolean (get_property ("hairpinToBarline")) - && scm_is_string (get_property ("whichBar")) - && !script_ev_; - - - if (!finished_cresc_->get_bound (RIGHT) - || use_bar) + if (!finished_cresc_->get_bound (RIGHT)) { - Grob *column_bound = unsmob_grob (use_bar - ? get_property ("currentCommandColumn") - : get_property ("currentMusicalColumn")); - + + Grob *column_bound = unsmob_grob (get_property ("currentMusicalColumn")); + finished_cresc_->set_bound (RIGHT, script_ ? script_ : column_bound); @@ -382,7 +393,6 @@ Dynamic_engraver::typeset_all () finished_line_spanner_->set_bound (RIGHT, ci); finished_line_spanner_->set_bound (LEFT, ci); } - finished_line_spanner_ = 0; } } @@ -429,15 +439,21 @@ ADD_ACKNOWLEDGER (Dynamic_engraver, note_column); ADD_TRANSLATOR (Dynamic_engraver, /* doc */ - "This engraver creates hairpins, dynamic texts, and their vertical\n" - "alignments. The symbols are collected onto a DynamicLineSpanner grob\n" - "which takes care of vertical positioning. ", + "Create hairpins, dynamic texts, and their vertical" + " alignments. The symbols are collected onto a" + " @code{DynamicLineSpanner} grob which takes care of vertical" + " positioning.", /* create */ "DynamicLineSpanner " + "DynamicTextSpanner " "DynamicText " "Hairpin " "TextSpanner ", - /* read */ "", - /* write */ ""); + /* read */ + "", + + /* write */ + "" + );