]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/key.hh
90c14792353fc710aa69f8f7d1d0e12bf537803b
[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 #include "lily-proto.hh"
13
14 /// administration of current key in one octave.
15 class Octave_key {
16
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;
24 };
25
26 /// administration of accidentals
27 class Key
28 {
29   /** for each octave a key. Has to be private since octave 0 isn't member 0.
30    */
31   Array<Octave_key> octaves_;
32   int octave_to_index (int) const;
33 public:
34   bool multi_octave_b_;
35   
36   void clear ();
37   Octave_key const& oct (int) const;
38   void set (int name, int acc);
39   void set (Musical_pitch);
40
41   bool different_acc (Musical_pitch) const;
42   
43   Key();
44   void print () const;  
45 };
46
47 #endif // KEY_HH
48
49