lilypond-0.0.50
[lilypond.git] / lily / key.cc
blob0f02ef845d0d3b4a9d854233ae2ec726531f1bb9
1 #include "key.hh"
3 const int OCTAVES=14; // ugh..
4 const int ZEROOCTAVE=7;
6 Octave_key::Octave_key()
8 accidental_i_arr_.set_size(7);
9 for (int i= 0; i < 7 ; i++)
10 accidental_i_arr_[i] = 0;
13 Key::Key()
15 multi_octave_b_ = false;
16 octaves.set_size(OCTAVES);
19 Octave_key&
20 Key::oct(int i)
22 return octaves[i+ZEROOCTAVE];
25 Octave_key
26 Key::oct(int i)const
28 return octaves[i+ZEROOCTAVE];
31 void
32 Octave_key::set(int i, int a)
34 assert(a > -3 && a < 3);
35 accidental_i_arr_[i]=a;
38 void
39 Key::set(int o, int n , int a)
41 octaves[o + ZEROOCTAVE].set(n,a);
44 void
45 Key::set (int n, int a)
47 for (int i= 0; i < OCTAVES ; i++)
48 octaves[i].set(n,a);