]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/key.hh
5c24db2f08e4b22113e76a87a45add99760026d1
[lilypond.git] / lily / include / key.hh
1 /*
2   key.hh -- declare Key, Octave_key
3
4   (c) 1996--2000 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   Array<bool> internal_forceacc_b_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   void set_internal_forceacc (Musical_pitch);
41   void clear_internal_forceacc (Musical_pitch);
42
43   bool different_acc (Musical_pitch) const;
44   bool internal_forceacc (Musical_pitch) const;
45   bool double_to_single_acc (Musical_pitch) const;
46   
47   Key();
48   void print () const;  
49 };
50
51 #endif // KEY_HH
52
53