lilypond-1.1.44
[lilypond.git] / lily / include / key.hh
blob140db77927ed3a39b361b3edb138569d300d0783
1 /*
2 key.hh -- declare Key, Octave_key
4 (c) 1996--1999 Han-Wen Nienhuys
5 */
7 #ifndef KEY_HH
8 #define KEY_HH
10 #include "array.hh"
11 #include "scalar.hh"
12 #include "lily-proto.hh"
14 /// administration of current key in one octave.
15 class Octave_key {
17 public:
18 Array<int> accidental_i_arr_;
19 void clear ();
20 Octave_key();
21 void set (int i, int acc);
22 int acc (int i) const { return accidental_i_arr_[i]; }
23 void print () const;
26 /// administration of accidentals
27 class Key
29 /** for each octave a key. Has to be private since octave 0 isn't member 0.
31 Array<Octave_key> octaves_;
32 int octave_to_index (int) const;
33 public:
34 bool multi_octave_b_;
36 void clear ();
37 Octave_key const& oct (int) const;
38 void set (int name, int acc);
39 void set (Musical_pitch);
41 bool different_acc (Musical_pitch) const;
43 Key();
44 void print () const;
47 #endif // KEY_HH