]> git.donarmstrong.com Git - lilypond.git/blob - lily/dot-column-engraver.cc
Merge branch 'jneeman' of git+ssh://jneem@git.sv.gnu.org/srv/git/lilypond into jneeman
[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 #include "item.hh" 
15
16 class Dot_column_engraver : public Engraver
17 {
18   Grob *dotcol_;
19   vector<Item*> heads_;
20 public:
21   TRANSLATOR_DECLARATIONS (Dot_column_engraver);
22
23 protected:
24
25   DECLARE_ACKNOWLEDGER (rhythmic_head);
26
27   void stop_translation_timestep ();
28 };
29
30 Dot_column_engraver::Dot_column_engraver ()
31 {
32   dotcol_ = 0;
33 }
34
35 void
36 Dot_column_engraver::stop_translation_timestep ()
37 {
38   dotcol_ = 0;
39   heads_.clear ();
40 }
41
42 void
43 Dot_column_engraver::acknowledge_rhythmic_head (Grob_info info)
44 {
45   Grob *d = unsmob_grob (info.grob ()->get_object ("dot"));
46   if (d)
47     {
48       if (!dotcol_)
49         dotcol_ = make_item ("DotColumn", SCM_EOL);
50
51       Dot_column::add_head (dotcol_, info.grob ());
52     }
53 }
54
55
56 ADD_ACKNOWLEDGER (Dot_column_engraver, rhythmic_head);
57 ADD_TRANSLATOR (Dot_column_engraver,
58                 /* doc */ "Engraves dots on dotted notes shifted to the right of the note.\n"
59                 "If omitted, then dots appear on top of the notes.",
60                 /* create */ "DotColumn",
61                 /* read */ "",
62                 /* write */ "");