]> git.donarmstrong.com Git - lilypond.git/blob - lily/multi-measure-rest.cc
release: 0.1.62
[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 <jan@digicash.com>
7   
8  */
9
10 #include "multi-measure-rest.hh"
11 #include "debug.hh"
12 #include "paper-def.hh"
13 #include "lookup.hh"
14 #include "dimen.hh"
15 #include "rest.hh"
16 #include "script.hh"
17 #include "text-def.hh"
18 #include "molecule.hh"
19
20 IMPLEMENT_IS_TYPE_B1 (Multi_measure_rest, Item);
21
22 Multi_measure_rest::Multi_measure_rest ()
23 {
24   measures_i_ = 0;
25 }
26
27 void
28 Multi_measure_rest::do_print () const
29 {
30   DOUT << "measures_i_ " << measures_i_;
31 }
32
33 Molecule*
34 Multi_measure_rest::brew_molecule_p () const
35 {
36   /*
37    [TODO]                                     3
38      * make real multi-measure rest symbol: |---|
39      * make two,four,eight-measure-rest symbols
40    */
41
42   Atom s (paper ()->lookup_l ()->rest (0, 0));
43   Molecule* mol_p = new Molecule ( Atom (s));
44   Real interline_f = paper ()->interline_f ();
45   mol_p->translate_axis (interline_f, Y_AXIS);
46
47   if (measures_i_ > 1)
48     {
49       Text_def text;
50       text.text_str_ = measures_i_;
51       text.style_str_ = "number";
52       Atom s = text.get_atom (paper (), UP);
53       s.translate_axis (3.0 * interline_f, Y_AXIS);
54       mol_p->add (s);
55     }
56
57   return mol_p;
58 }
59