]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/key.hh
partial: 0.1.65.jcn
[lilypond.git] / lily / include / key.hh
1 /*
2   key.hh -- declare Key, Octave_key
3
4   (c) 1996,97 Han-Wen Nienhuys
5 */
6
7 #ifndef KEY_HH
8 #define KEY_HH
9
10 #include "varray.hh"
11 #include "scalar.hh"
12
13 /// administration of current key in one octave.
14 class Octave_key {
15
16 public:
17   Array<int> accidental_i_arr_;
18   void clear ();
19   Octave_key();
20   void set (int i, int acc);
21   int acc (int i) const { return accidental_i_arr_[i]; }
22   void print () const;
23 };
24
25 /// administration of accidentals
26 class Key
27 {
28   /** for each octave a key. Has to be private since octave 0 isn't member 0.
29    */
30   Array<Octave_key> octaves_;
31   int octave_to_index (int) const;
32 public:
33   bool multi_octave_b_;
34   
35   void clear ();
36   Octave_key&oct (int);
37   void set (int name, int acc);
38   void set (int oct, int name, int acc);
39   Key();
40   void print () const;  
41 };
42
43 #endif // KEY_HH
44
45