]> git.donarmstrong.com Git - lilypond.git/blob - lily/crescendo.cc
release: 0.0.41
[lilypond.git] / lily / crescendo.cc
1 /*
2   crescendo.cc -- implement Crescendo
3
4   source file of the LilyPond music typesetter
5
6   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8
9 #include "crescendo.hh"
10 #include "lookup.hh"
11 #include "paper-def.hh"
12
13 Crescendo::Crescendo(int s)
14 {
15     staff_size_i_ = s;
16     grow_dir_i_ =0;
17     dir_i_ = -1 ;
18 }
19
20 Spanner*
21 Crescendo::do_break_at(PCol*, PCol*)const
22 {
23     return new Crescendo(*this);
24 }
25
26
27 Molecule*
28 Crescendo::brew_molecule_p() const return m_p ;
29 {
30     m_p = new Molecule;
31     Real w_f = width().length();
32     Symbol s( paper()->lookup_l()->hairpin(w_f, grow_dir_i_ < 0) );
33     m_p->add(Atom(s));
34     int pos = (dir_i_ >0) ? staff_size_i_ + 4 : - 4 ;
35     m_p->translate(Offset(0,pos * paper()->internote()));
36 }