blob: e8a36e29a8de635d276bb0dd3913853ae736abdc (
about) (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
/*
crescendo.cc -- implement Crescendo
source file of the LilyPond music typesetter
(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
#include "dimen.hh"
#include "crescendo.hh"
#include "lookup.hh"
#include "paper-def.hh"
#include "debug.hh"
Crescendo::Crescendo(int s)
{
staff_size_i_ = s;
grow_dir_i_ =0;
dir_i_ = -1 ;
left_dyn_b_ = right_dyn_b_ =false;
}
Spanner*
Crescendo::do_break_at(PCol*, PCol*)const
{
return new Crescendo(*this);
}
Molecule*
Crescendo::brew_molecule_p() const return m_p ;
{
Real x_off_dim=0.0;
Real absdyn_dim = 10 PT; // UGR
m_p = new Molecule;
Real w_dim = width().length();
if ( left_dyn_b_ ) {
w_dim -= absdyn_dim;
x_off_dim += absdyn_dim;
}
if ( right_dyn_b_ ) {
w_dim -= absdyn_dim;
}
if (w_dim < 0) {
error("Crescendo too small");
w_dim = 0;
}
Symbol s( paper()->lookup_l()->hairpin(w_dim, grow_dir_i_ < 0) );
m_p->add(Atom(s));
int pos = (dir_i_ >0) ? staff_size_i_ + 4 : - 4 ;
if(dir_i_<0 ) // should do something better anyway.
m_p->translate(Offset(0, -m_p->extent().y.left ));
m_p->translate(Offset(x_off_dim,pos * paper()->internote()));
}
IMPLEMENT_STATIC_NAME(Crescendo);
|