\context Voice \relative c {
+ \override Score.PaperColumn #'layer = #1
+ \override Score.PaperColumn #'stencil = #ly:paper-column::print
+
%% make sure neutral is down.
\override Stem #'neutral-direction = #down
\time 16/4 c''4 c c, c' d, c' e, c' f, c' g c a c b c
\layout { ragged-right = ##t}
\relative c'' {
+ \override Score.PaperColumn #'layer = #1
+ \override Score.PaperColumn #'stencil = #ly:paper-column::print
+
\stemDown
\time 12/4
f8[
#include "score-engraver.hh"
#include "warn.hh"
#include "item.hh"
+#include "spanner.hh"
#include "translator.icc"
void stop_translation_timestep ();
void process_acknowledged ();
+ DECLARE_END_ACKNOWLEDGER (spanner);
+
private:
void create_bar ();
Item *bar_;
+ vector<Spanner*> spanners_;
};
Bar_engraver::Bar_engraver ()
{
if (!bar_ && scm_is_string (get_property ("whichBar")))
create_bar ();
+
+ if (bar_)
+ for (vsize i = 0; i < spanners_.size (); i++)
+ spanners_[i]->set_bound (RIGHT, bar_);
}
/*
context ()->get_score_context ()->set_property ("forbidBreak", SCM_BOOL_T);
bar_ = 0;
+ spanners_.clear ();
+}
+
+void
+Bar_engraver::acknowledge_end_spanner (Grob_info gi)
+{
+ Grob *g = gi.grob ();
+
+ if (to_boolean (g->get_property ("to-barline")))
+ spanners_.push_back (dynamic_cast<Spanner*> (g));
}
+ADD_END_ACKNOWLEDGER (Bar_engraver, spanner);
+
ADD_TRANSLATOR (Bar_engraver,
/* doc */ "Create barlines. This engraver is controlled through the "
"@code{whichBar} property. If it has no bar line to create, it will forbid a linebreak at this point",
}
finished_cresc_ = cresc_;
+
+ /* backwards compatibility with hairpinToBarline */
+ bool use_bar = to_boolean (get_property ("hairpinToBarline"))
+ && scm_is_string (get_property ("whichBar"))
+ && !script_ev_;
+
+ finished_cresc_->set_property ("to-barline", scm_from_bool (use_bar));
+
+ announce_end_grob (finished_cresc_, SCM_EOL);
cresc_ = 0;
current_cresc_ev_ = 0;
}
{
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_
finished_line_spanner_->set_bound (RIGHT, ci);
finished_line_spanner_->set_bound (LEFT, ci);
}
-
finished_line_spanner_ = 0;
}
}
"also the X-reference point of the spanner.\n",
"minimum-length "
+ "to-barline "
);
(thin-kern ,number? "The space after a hair-line in a bar line.")
(threshold ,number-pair? "@code{(@var{min} . @var{max})}, where
@var{min} and @var{max} are dimensions in staff space.")
+ (to-barline ,boolean? "If true, the spanner will stop at that barline
+just before it would otherwise stop.")
(tie-configuration ,list? "List of @code{(@var{position} .
@var{dir})} pairs, indicating the desired tie configuration, where
@var{position} is the offset from the center of the staff in staff