From aa93c901382b55d19a30b601afbdca85ccd16987 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Wed, 15 Feb 2006 13:02:17 +0000 Subject: [PATCH] * lily/dot-column.cc (side_position): reach stem via dots-> head->stem. * lily/dot-column-engraver.cc (class Dot_column_engraver): excise stem handling. * lily/bar-number-engraver.cc (process_music): document function of whichBar. * lily/score.cc (default_rendering): add pscore, not systems themselves. * lily/paper-book.cc (get_system_specs): separate generation of titles and systems. --- ChangeLog | 11 +++++++++++ lily/bar-number-engraver.cc | 3 ++- lily/dot-column-engraver.cc | 19 ------------------- lily/dot-column.cc | 33 ++++++++++++++++++++------------- lily/paper-book.cc | 1 + lily/rhythmic-head.cc | 11 +++++++++-- lily/score.cc | 4 +--- lily/stem.cc | 5 +++-- 8 files changed, 47 insertions(+), 40 deletions(-) diff --git a/ChangeLog b/ChangeLog index 43a8741d1d..3487999f3b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2006-02-15 Han-Wen Nienhuys + * lily/dot-column.cc (side_position): reach stem via dots-> head->stem. + + * lily/dot-column-engraver.cc (class Dot_column_engraver): excise + stem handling. + + * lily/bar-number-engraver.cc (process_music): document function + of whichBar. + + * lily/score.cc (default_rendering): add pscore, not systems + themselves. + * lily/paper-book.cc (get_system_specs): separate generation of titles and systems. diff --git a/lily/bar-number-engraver.cc b/lily/bar-number-engraver.cc index 3d61cdcfd9..57ad002f76 100644 --- a/lily/bar-number-engraver.cc +++ b/lily/bar-number-engraver.cc @@ -101,7 +101,8 @@ Bar_number_engraver::create_items () ADD_TRANSLATOR (Bar_number_engraver, /* doc */ "A bar number is created whenever measurePosition " - "is zero and there is a bar line. It is \n" + "is zero and when there is a bar line (ie. when @code{whichBar} is set. " + "It is \n" "put on top of all staves, and appears only at left side of the staff. " "The staves are taken from @code{stavesFound}, which is maintained by " "@code{@ref{Staff_collecting_engraver}}. ", diff --git a/lily/dot-column-engraver.cc b/lily/dot-column-engraver.cc index 65a16a094e..a2b1cdf3a5 100644 --- a/lily/dot-column-engraver.cc +++ b/lily/dot-column-engraver.cc @@ -10,20 +10,17 @@ #include "dot-column.hh" #include "side-position-interface.hh" #include "engraver.hh" -#include "stem.hh" #include "translator.icc" class Dot_column_engraver : public Engraver { Grob *dotcol_; - Grob *stem_; vector heads_; public: TRANSLATOR_DECLARATIONS (Dot_column_engraver); protected: - DECLARE_ACKNOWLEDGER (stem); DECLARE_ACKNOWLEDGER (rhythmic_head); void stop_translation_timestep (); @@ -32,23 +29,13 @@ protected: Dot_column_engraver::Dot_column_engraver () { dotcol_ = 0; - stem_ = 0; } void Dot_column_engraver::stop_translation_timestep () { - /* - Add the stem to the support so dots stay clear of flags. - - See [Ross, p 171] - */ - if (stem_ && dotcol_) - dotcol_->set_object ("stem", stem_->self_scm ()); - dotcol_ = 0; heads_.clear (); - stem_ = 0; } void @@ -64,13 +51,7 @@ Dot_column_engraver::acknowledge_rhythmic_head (Grob_info info) } } -void -Dot_column_engraver::acknowledge_stem (Grob_info info) -{ - stem_ = info.grob (); -} -ADD_ACKNOWLEDGER (Dot_column_engraver, stem); ADD_ACKNOWLEDGER (Dot_column_engraver, rhythmic_head); ADD_TRANSLATOR (Dot_column_engraver, /* doc */ "Engraves dots on dotted notes shifted to the right of the note.\n" diff --git a/lily/dot-column.cc b/lily/dot-column.cc index 2d01faa026..3ebddc69a0 100644 --- a/lily/dot-column.cc +++ b/lily/dot-column.cc @@ -31,20 +31,26 @@ SCM Dot_column::side_position (SCM smob) { Grob *me = unsmob_grob (smob); - Grob *stem = unsmob_grob (me->get_object ("stem")); - if (stem - && !Stem::get_beam (stem) - && Stem::duration_log (stem) > 2 - && !Stem::is_invisible (stem)) + extract_grob_set (me, "dots", dots); + + for (vsize i = 0; i < dots.size (); i++) { - /* - trigger stem end & direction calculation. - - This will add the stem to the support if a flag collision happens. - */ - stem->get_property ("stem-end-position"); + Grob *head = dots[i]->get_parent (Y_AXIS); + Grob *stem = head ? unsmob_grob (head->get_object ("stem")) : 0; + if (stem + && !Stem::get_beam (stem) + && Stem::duration_log (stem) > 2 + && !Stem::is_invisible (stem)) + { + /* + trigger stem end & direction calculation. + + This will add the stem to the support if a flag collision happens. + */ + stem->get_property ("stem-end-position"); + } } - + return Side_position_interface::x_aligned_side (smob); } @@ -290,7 +296,8 @@ ADD_INTERFACE (Dot_column, "clash with staff lines ", /* properties */ + "dots " "positioning-done " "direction " - "stem"); + ); diff --git a/lily/paper-book.cc b/lily/paper-book.cc index c2fcf60f30..8ef498aaec 100644 --- a/lily/paper-book.cc +++ b/lily/paper-book.cc @@ -256,6 +256,7 @@ Paper_book::get_score_title (SCM header) return SCM_BOOL_F; } + SCM Paper_book::get_system_specs () { diff --git a/lily/rhythmic-head.cc b/lily/rhythmic-head.cc index a024647d77..ec368b8a51 100644 --- a/lily/rhythmic-head.cc +++ b/lily/rhythmic-head.cc @@ -48,7 +48,14 @@ Rhythmic_head::duration_log (Grob *me) return scm_is_number (s) ? scm_to_int (s) : 0; } -ADD_INTERFACE (Rhythmic_head, "rhythmic-head-interface", +ADD_INTERFACE (Rhythmic_head, + + "rhythmic-head-interface", + "Note head or rest", - "dot stem duration-log"); + + "dot " + "duration-log" + "stem " + ); diff --git a/lily/score.cc b/lily/score.cc index c8fbf84056..99ec51880a 100644 --- a/lily/score.cc +++ b/lily/score.cc @@ -135,9 +135,7 @@ default_rendering (SCM music, SCM outdef, if (ly_is_module (header)) paper_book->add_score (header); - SCM systems = pscore->get_paper_systems (); - paper_book->add_score (systems); - + paper_book->add_score (pscore->self_scm ()); paper_book->classic_output (outname); paper_book->unprotect (); } diff --git a/lily/stem.cc b/lily/stem.cc index 3c1bdc326c..accada587d 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -261,11 +261,12 @@ Stem::calc_stem_end_position (SCM smob) if (dots) { Real dp = Staff_symbol_referencer::get_position (dots); - Real flagy = flag (me).extent (Y_AXIS)[-dir] * 2 / ss; + Interval flag_yext = flag (me).extent (Y_AXIS) * (2 / ss) + stem_end; /* Very gory: add myself to the X-support of the parent, which should be a dot-column. */ - if (dir * (stem_end + flagy - dp) < 0.5) + + if (flag_yext.distance (dp) < 0.5) { Grob *par = dots->get_parent (X_AXIS); -- 2.39.2