]> git.donarmstrong.com Git - lilypond.git/blob - lily/rest.cc
release: 1.3.1
[lilypond.git] / lily / rest.cc
1 /*
2   rest.cc -- implement Rest
3
4   source file of the GNU LilyPond music typesetter
5
6   (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9 #include "molecule.hh"
10 #include "paper-def.hh"
11 #include "lookup.hh"
12 #include "rest.hh"
13 #include "dots.hh"
14 #include "axis-group-element.hh"
15 #include "paper-score.hh"
16
17 void
18 Rest::do_add_processing ()
19 {
20   if (balltype_i_ == 0)
21     position_i_ += 2;
22
23   Rhythmic_head::do_add_processing ();
24 }
25
26 void
27 Rest::do_post_processing ()
28 {
29   Rhythmic_head::do_post_processing ();
30   if (dots_l_ && balltype_i_ > 4)
31     {
32       dots_l_->position_i_ += 3;
33       if (balltype_i_ == 7)
34         dots_l_->position_i_++;
35     }
36 }
37
38 Rest::Rest ()
39 {
40   position_i_ =0;
41 }
42
43 Molecule *
44 Rest::do_brew_molecule_p () const
45 {
46   bool ledger_b =false;
47
48   if (balltype_i_ == 0 || balltype_i_ == 1)
49     ledger_b = abs(position_f ()  - (2* balltype_i_ - 1)) > lines_i (); 
50       
51
52   
53   String style; 
54   SCM style_sym =get_elt_property (style_scm_sym);
55   if (balltype_i_ >= 2 && style_sym != SCM_BOOL_F)
56     {
57       style = ly_scm2string (SCM_CDR(style_sym));
58     }
59   
60   Molecule s(lookup_l ()->rest (balltype_i_, ledger_b, style));
61   Molecule * m = new Molecule ( Molecule (s));
62
63   return m;
64 }
65
66