From: Han-Wen Nienhuys Date: Sun, 16 Jun 2002 22:43:05 +0000 (+0000) Subject: '' X-Git-Tag: release/1.5.62~16 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=99d0993d76e94b796cf480d8b540cd318d1a2463;p=lilypond.git '' --- diff --git a/ChangeLog b/ChangeLog index a993ab3754..c18eb112fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2002-06-17 Han-Wen + * lily/forbid-break-engraver.cc (class + Forbid_line_break_engraver): new engraver: forbid linebreaks + during playing notes + * lily/spacing-spanner.cc (loose_column): add another check: don't move around bar lines as loose columns. diff --git a/lily/forbid-break-engraver.cc b/lily/forbid-break-engraver.cc new file mode 100644 index 0000000000..0ece1306c5 --- /dev/null +++ b/lily/forbid-break-engraver.cc @@ -0,0 +1,45 @@ +#include "rhythmic-head.hh" +#include "engraver.hh" +#include "grob.hh" +#include "score-engraver.hh" + +class Forbid_line_break_engraver : public Engraver +{ +public: + TRANSLATOR_DECLARATIONS(Forbid_line_break_engraver); + virtual void start_translation_timestep (); +}; + +Forbid_line_break_engraver::Forbid_line_break_engraver(){} + +ENTER_DESCRIPTION(Forbid_line_break_engraver, +/* descr */ "Forbid line breaks when note heads are still playing +at some point.", +/* creats*/ "", +/* acks */ "", +/* reads */ "busyGrobs", +/* write */ ""); + +void +Forbid_line_break_engraver::start_translation_timestep() +{ + /* + Check for running note heads. This should probably be done elsewhere. + */ + SCM busy = get_property ("busyGrobs"); + + Moment now = now_mom(); + while (gh_pair_p (busy) && *unsmob_moment (gh_caar (busy)) == now) + busy = gh_cdr (busy); + + + while (gh_pair_p (busy)) + { + Grob *g = unsmob_grob (gh_cdar (busy)); + if (Rhythmic_head::has_interface (g)) + { + top_engraver()->forbid_breaks(); + } + busy = gh_cdr(busy); + } +} diff --git a/lily/grob-pq-engraver.cc b/lily/grob-pq-engraver.cc index ff23b793e2..b2540b8fa0 100644 --- a/lily/grob-pq-engraver.cc +++ b/lily/grob-pq-engraver.cc @@ -147,6 +147,7 @@ Grob_pq_engraver::start_translation_timestep () if (start_busy != busy) daddy_trans_l_->set_property ("busyGrobs", busy); + } diff --git a/lily/note-heads-engraver.cc b/lily/note-heads-engraver.cc index c6ae621e9b..7d48f15939 100644 --- a/lily/note-heads-engraver.cc +++ b/lily/note-heads-engraver.cc @@ -12,7 +12,7 @@ #include "dot-column.hh" #include "staff-symbol-referencer.hh" #include "item.hh" -#include "score-engraver.hh" +#include "engraver.hh" #include "warn.hh" /** @@ -136,6 +136,8 @@ Note_heads_engraver::stop_translation_timestep () void Note_heads_engraver::start_translation_timestep () { + + } diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly index c06eaf8483..d5ab04dc50 100644 --- a/ly/engraver-init.ly +++ b/ly/engraver-init.ly @@ -31,7 +31,7 @@ StaffContext=\translator { \consists "Piano_pedal_engraver" \consists "Instrument_name_engraver" \consists "Grob_pq_engraver" - + \consists "Forbid_line_break_engraver" \consistsend "Axis_group_engraver"