]> git.donarmstrong.com Git - lilypond.git/blob - lily/dot-column-engraver.cc
New glyph (black diamond) and two harmonic-like notehead styles using it.
[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--2007 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 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 }
39
40 void
41 Dot_column_engraver::acknowledge_rhythmic_head (Grob_info info)
42 {
43   Grob *d = unsmob_grob (info.grob ()->get_object ("dot"));
44   if (d)
45     {
46       if (!dotcol_)
47         dotcol_ = make_item ("DotColumn", SCM_EOL);
48
49       Dot_column::add_head (dotcol_, info.grob ());
50     }
51 }
52
53
54 ADD_ACKNOWLEDGER (Dot_column_engraver, rhythmic_head);
55 ADD_TRANSLATOR (Dot_column_engraver,
56                 /* doc */ "Engraves dots on dotted notes shifted to the right of the note.\n"
57                 "If omitted, then dots appear on top of the notes.",
58                 /* create */ "DotColumn",
59                 /* read */ "",
60                 /* write */ "");