source file of the GNU LilyPond music typesetter
- (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "dot-column.hh"
#include "side-position-interface.hh"
#include "engraver.hh"
+#include "stem.hh"
class Dot_column_engraver : public Engraver
{
- Grob *dotcol_p_ ;
+ Grob *dotcol_ ;
+ Grob * stem_;
Link_array<Item> head_l_arr_;
public:
- VIRTUAL_COPY_CONS(Translator);
- Dot_column_engraver();
+ VIRTUAL_COPY_CONS (Translator);
+ Dot_column_engraver ();
protected:
virtual void acknowledge_grob (Grob_info);
Dot_column_engraver::Dot_column_engraver ()
{
- dotcol_p_ =0;
+ dotcol_ =0;
+ stem_ = 0;
}
void
Dot_column_engraver::stop_translation_timestep ()
{
- if (dotcol_p_)
+ if (dotcol_)
{
- typeset_grob (dotcol_p_);
- dotcol_p_ =0;
+
+ /*
+ Add the stem to the support so dots stay clear of flags.
+
+ See [Ross, p 171]
+ */
+ if (stem_)
+ dotcol_->set_grob_property ("stem", stem_->self_scm ());
+
+ typeset_grob (dotcol_);
+ dotcol_ =0;
}
head_l_arr_.clear ();
+ stem_ =0;
}
void
Grob *d = unsmob_grob (info.elem_l_->get_grob_property ("dot"));
if (d)
{
- if (!dotcol_p_)
+ if (!dotcol_)
{
- dotcol_p_ = new Item(get_property ("DotColumn"));
+ dotcol_ = new Item (get_property ("DotColumn"));
- Dot_column::set_interface (dotcol_p_);
- Side_position::set_axis (dotcol_p_, X_AXIS);
- Side_position::set_direction (dotcol_p_, RIGHT);
- announce_grob (dotcol_p_, 0);
+ Dot_column::set_interface (dotcol_);
+ announce_grob (dotcol_, 0);
}
- Dot_column::add_head (dotcol_p_, info.elem_l_);
+ Dot_column::add_head (dotcol_, info.elem_l_);
+ }
+ else if (Stem::has_interface (info.elem_l_))
+ {
+ stem_ = info.elem_l_;
}
}
-ADD_THIS_TRANSLATOR(Dot_column_engraver);
+ADD_THIS_TRANSLATOR (Dot_column_engraver);