]> git.donarmstrong.com Git - lilypond.git/blob - lily/grid-point-engraver.cc
trim outdated comment.
[lilypond.git] / lily / grid-point-engraver.cc
1 /*
2   grid-line-engraver.cc --  implement Grid_point_engraver
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 2005--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
8
9 #include "engraver.hh"
10 #include "item.hh"
11 #include "moment.hh"
12
13 #include "translator.icc"
14
15 class Grid_point_engraver : public Engraver
16 {
17 public:
18   TRANSLATOR_DECLARATIONS (Grid_point_engraver);
19 protected:
20   void process_music ();
21 };
22
23 void
24 Grid_point_engraver::process_music ()
25 {
26   SCM grid_interval = get_property ("gridInterval");
27   if (Moment *mom = unsmob_moment (grid_interval))
28     {
29       Moment now = now_mom ();
30
31       if (!now.main_part_.mod_rat (mom->main_part_))
32         make_item ("GridPoint", SCM_EOL);
33     }
34 }
35
36 Grid_point_engraver::Grid_point_engraver ()
37 {
38 }
39
40 ADD_TRANSLATOR (Grid_point_engraver,
41                 /* doc */ "generate grid points.",
42                 /* create */ "GridPoint",
43                 /* read */ "gridInterval",
44                 /* write */ "");
45