]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/key.hh
release: 1.3.0
[lilypond.git] / lily / include / key.hh
1 /*
2   key.hh -- declare Key, Octave_key
3
4   (c) 1996--1999 Han-Wen Nienhuys
5 */
6
7 #ifndef KEY_HH
8 #define KEY_HH
9
10 #include "array.hh"
11 #include "lily-proto.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 const& oct (int) const;
37   void set (int name, int acc);
38   void set (Musical_pitch);
39
40   bool different_acc (Musical_pitch) const;
41   
42   Key();
43   void print () const;  
44 };
45
46 #endif // KEY_HH
47
48