]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/key-item.hh
release: 1.3.56
[lilypond.git] / lily / include / key-item.hh
index fda86e5375651cd1a2c9a7bc08196c0c4bd1b1c1..2c7f396ab4396954563ea6d623b5c0872ec25baa 100644 (file)
@@ -1,33 +1,41 @@
 /*
   key-item.hh -- part of GNU LilyPond
 
-  (c) 1996,97 Han-Wen Nienhuys
+  (c) 1996--2000 Han-Wen Nienhuys
 */
 
 #ifndef KEYITEM_HH
 #define KEYITEM_HH
 
 #include "item.hh"
-#include "varray.hh"
-
-
-/// An item which places accidentals at the start of the line
-struct Key_item : Item {
-    Array<int> pitch;
-    Array<int> acc;
-    int c_position;
-
-    
-    /* *************** */
-    NAME_MEMBERS();
-    SCORE_ELEM_CLONE(Key_item)
-
-    Key_item(int cposition);
-    void add(int pitch, int acc);
-    void read(const Key_register&);
-    void set_c_position(int);
-    void preprocess();
-    Molecule* brew_molecule_p()const;
+#include "array.hh"
+
+
+/**
+  A group of  accidentals.
+
+  Properties:
+
+  c0-position -- integer indicating the position of central C?
+
+  old-accidentals -- list of (pitch, accidental) pairs
+
+  new-accidentals -- list of (pitch, accidental) pairs
+ */
+class Key_item :public  Item
+{
+  int calculate_position(SCM pair) const;
+
+public:
+  VIRTUAL_COPY_CONS(Score_element);
+  Key_item (SCM);
+  void add (int pitch, int acc);
+  void add_old (int pitch, int acc);
+ static SCM scheme_molecule (SCM);
+  
+
+protected:
+  virtual Molecule do_brew_molecule() const;
 };
 
 #endif // KEYITEM_HH