]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/key.hh
release: 1.1.51
[lilypond.git] / lily / include / key.hh
index cbffa1e8f7d33562ab83268c99afff77302cbae2..140db77927ed3a39b361b3edb138569d300d0783 100644 (file)
@@ -1,40 +1,47 @@
 /*
   key.hh -- declare Key, Octave_key
 
-  (c) 1996,97 Han-Wen Nienhuys
+  (c) 1996--1999 Han-Wen Nienhuys
 */
 
 #ifndef KEY_HH
 #define KEY_HH
 
-#include "varray.hh"
+#include "array.hh"
 #include "scalar.hh"
+#include "lily-proto.hh"
 
 /// administration of current key in one octave.
 class Octave_key {
 
 public:
-    Array<int> accidental_i_arr_;
-    Key();
-    void set(int i, int acc);
-    int acc(int i)const { return accidental_i_arr_[i]; }
+  Array<int> accidental_i_arr_;
+  void clear ();
+  Octave_key();
+  void set (int i, int acc);
+  int acc (int i) const { return accidental_i_arr_[i]; }
+  void print () const;
 };
 
 /// administration of accidentals
 class Key
 {
-    /** for each octave a key. Has to be private since octave 0 isn't member 0.
-     */
-    Array<Octave_key> octaves;
+  /** for each octave a key. Has to be private since octave 0 isn't member 0.
+   */
+  Array<Octave_key> octaves_;
+  int octave_to_index (int) const;
 public:
-    bool multi_octave_b_;
-    
-    Octave_key&oct(int);
-    Octave_key  oct(int) const;
-    void set(int name, int acc);
-    void set(int oct, int name, int acc);
-    Key();
+  bool multi_octave_b_;
+  
+  void clear ();
+  Octave_key const& oct (int) const;
+  void set (int name, int acc);
+  void set (Musical_pitch);
+
+  bool different_acc (Musical_pitch) const;
+  
+  Key();
+  void print () const;  
 };
 
 #endif // KEY_HH