]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/key.hh
release: 1.3.55
[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 /*
14   JUNKME JUNKME JUNKME
15  */
16
17 /// administration of current key in one octave.
18 class Octave_key {
19
20 public:
21   Array<int> accidental_i_arr_;
22   Array<bool> internal_forceacc_b_arr_;
23   void clear ();
24   Octave_key();
25   void set (int i, int acc);
26   int acc (int i) const { return accidental_i_arr_[i]; }
27   void print () const;
28 };
29
30 /// administration of accidentals
31 class Key
32 {
33   /** for each octave a key. Has to be private since octave 0 isn't member 0.
34    */
35   Array<Octave_key> octaves_;
36   int octave_to_index (int) const;
37 public:
38   bool multi_octave_b_;
39   
40   void clear ();
41   Octave_key const& oct (int) const;
42   void set (int name, int acc);
43   void set (Musical_pitch);
44   void set_internal_forceacc (Musical_pitch);
45   void clear_internal_forceacc (Musical_pitch);
46
47   bool different_acc (Musical_pitch) const;
48   bool internal_forceacc (Musical_pitch) const;
49   bool double_to_single_acc (Musical_pitch) const;
50   
51   Key();
52   void print () const;  
53 };
54
55 #endif // KEY_HH
56
57