]> git.donarmstrong.com Git - lilypond.git/blob - lily/multi-measure-rest.cc
release: 1.1.6
[lilypond.git] / lily / multi-measure-rest.cc
1 /*   
2   multi-measure-rest.cc --  implement Multi_measure_rest
3   
4   source file of the GNU LilyPond music typesetter
5   
6   (c) 1998 Jan Nieuwenhuizen <janneke@gnu.org>
7   
8  */
9
10 #include "multi-measure-rest.hh"
11 #include "debug.hh"
12 #include "paper-def.hh"
13 #include "lookup.hh"
14 #include "rest.hh"
15 #include "script.hh"
16 #include "text-def.hh"
17 #include "molecule.hh"
18
19
20
21 Multi_measure_rest::Multi_measure_rest ()
22 {
23   measures_i_ = 0;
24 }
25
26 void
27 Multi_measure_rest::do_print () const
28 {
29   DOUT << "measures_i_ " << measures_i_;
30 }
31
32 Molecule*
33 Multi_measure_rest::brew_molecule_p () const
34 {
35   /*
36    [TODO]                                     3
37      * make real multi-measure rest symbol: |---|
38      * make two,four,eight-measure-rest symbols
39    */
40
41   Atom s (lookup_l ()->rest (0, 0));
42   Molecule* mol_p = new Molecule ( Atom (s));
43   Real interline_f = paper ()->interline_f ();
44   mol_p->translate_axis (interline_f, Y_AXIS);
45
46   if (measures_i_ > 1)
47     {
48       Text_def text;
49       text.text_str_ = to_str (measures_i_);
50       text.style_str_ = "number";
51       Atom s = text.get_atom (paper (), UP);
52       s.translate_axis (3.0 * interline_f, Y_AXIS);
53       mol_p->add_atom (s);
54     }
55
56   return mol_p;
57 }
58