]> git.donarmstrong.com Git - lilypond.git/blob - lily/key.cc
release: 0.0.39-1
[lilypond.git] / lily / key.cc
1 #include "key.hh"
2
3 const int OCTAVES=14;           // ugh..
4 const int ZEROOCTAVE=7;
5
6 Key::Key()
7 {
8     accidental_i_arr_.set_size(7);
9     for (int i= 0; i < 7 ; i++)
10         accidental_i_arr_[i] = 0;
11 }
12
13 Local_key::Local_key()
14 {
15     octaves.set_size(OCTAVES);
16 }
17
18 Key&
19 Local_key::oct(int i)
20 {
21     return octaves[i+ZEROOCTAVE];    
22 }
23
24 void
25 Key::set(int i, int a)
26 {
27     assert(a > -3 && a < 3);
28     accidental_i_arr_[i]=a;    
29 }
30
31
32 void
33 Local_key::reset(Key k)
34 {
35     for (int i= 0; i < OCTAVES ; i++)
36         octaves[i] = k;
37 }
38