/*
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