2006-02-15 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * 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.
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}}. ",
#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<Item*> heads_;
public:
TRANSLATOR_DECLARATIONS (Dot_column_engraver);
protected:
- DECLARE_ACKNOWLEDGER (stem);
DECLARE_ACKNOWLEDGER (rhythmic_head);
void stop_translation_timestep ();
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
}
}
-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"
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);
}
"clash with staff lines ",
/* properties */
+ "dots "
"positioning-done "
"direction "
- "stem");
+ );
return SCM_BOOL_F;
}
+
SCM
Paper_book::get_system_specs ()
{
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 "
+ );
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 ();
}
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);