]> git.donarmstrong.com Git - lilypond.git/blob - lily/dot-column-engraver.cc
* lily/dot-column.cc (side_position): reach stem via dots-> head->stem.
[lilypond.git] / lily / dot-column-engraver.cc
1 /*
2   dot-column-engraver.cc -- implement Dot_column_engraver
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1998--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
8
9 #include "rhythmic-head.hh"
10 #include "dot-column.hh"
11 #include "side-position-interface.hh"
12 #include "engraver.hh"
13 #include "translator.icc"
14
15 class Dot_column_engraver : public Engraver
16 {
17   Grob *dotcol_;
18   vector<Item*> heads_;
19 public:
20   TRANSLATOR_DECLARATIONS (Dot_column_engraver);
21
22 protected:
23
24   DECLARE_ACKNOWLEDGER (rhythmic_head);
25
26   void stop_translation_timestep ();
27 };
28
29 Dot_column_engraver::Dot_column_engraver ()
30 {
31   dotcol_ = 0;
32 }
33
34 void
35 Dot_column_engraver::stop_translation_timestep ()
36 {
37   dotcol_ = 0;
38   heads_.clear ();
39 }
40
41 void
42 Dot_column_engraver::acknowledge_rhythmic_head (Grob_info info)
43 {
44   Grob *d = unsmob_grob (info.grob ()->get_object ("dot"));
45   if (d)
46     {
47       if (!dotcol_)
48         dotcol_ = make_item ("DotColumn", SCM_EOL);
49
50       Dot_column::add_head (dotcol_, info.grob ());
51     }
52 }
53
54
55 ADD_ACKNOWLEDGER (Dot_column_engraver, rhythmic_head);
56 ADD_TRANSLATOR (Dot_column_engraver,
57                 /* doc */ "Engraves dots on dotted notes shifted to the right of the note.\n"
58                 "If omitted, then dots appear on top of the notes.",
59                 /* create */ "DotColumn",
60                 /* accept */ "",
61                 /* read */ "",
62                 /* write */ "");