]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/local-key-item.hh
release: 1.3.8
[lilypond.git] / lily / include / local-key-item.hh
index 467f331201dfb3ea82a62cbb0c0d53436a2f961c..931c984c6ea43a3fba9bf58c77ea1591a84b15f5 100644 (file)
@@ -1,49 +1,57 @@
 /*
   local-key-item.hh -- part of GNU LilyPond
 
-  (c) 1996,97 Han-Wen Nienhuys
+  (c) 1996--1999 Han-Wen Nienhuys
 */
 
 #ifndef LOCALKEYITEM_HH
 #define LOCALKEYITEM_HH
 #include "item.hh"
-#include "varray.hh"
-
-struct Local_acc {
-    int name_i_;
-    int accidental_i_;
-    int octave_i_;
-    static int compare (Local_acc&, Local_acc&);
+#include "array.hh"
+#include "musical-pitch.hh"
+#include "staff-symbol-referencer.hh"
+#include "note-head-side.hh"
+
+struct Local_key_cautionary_tuple
+{
+  Musical_pitch pitch_;
+  bool cautionary_b_;
+  bool natural_b_;
+
+  Local_key_cautionary_tuple ()
+    {
+      cautionary_b_ = false;
+         natural_b_ = false;
+    }
+  static int compare (Local_key_cautionary_tuple const&s1, Local_key_cautionary_tuple const&s2)
+    {
+      return Musical_pitch::compare (s1.pitch_, s2.pitch_);
+    }
 };
 
 /**
   Accidentals which can be different for each octave.
 
-  TODO:
-  update item if Items are removed
-
-  TODO
   
-  figure out private/public
+  TODO
+
+  Make an item for each accidental separately, and make a
+  Accidental_column to group them.
   
  */
-class Local_key_item : public Item {
-public:
-    DECLARE_MY_RUNTIME_TYPEINFO;
-    Array<Local_acc> accs;
-    Link_array<Item> support_items_;
-    int c0_position;
 
+class Local_key_item : public Note_head_side, public Staff_symbol_referencer {
+  Array<Local_key_cautionary_tuple> accidental_arr_;
 
-    
-    Local_key_item (int c0position);
-    void add_support (Item*);
-    void add (int oct, int pitch, int acc);
-    void add (Melodic_req*);
+  Molecule accidental (int,bool) const;
+public:
+  int c0_position_i_;
+  Local_key_item ();
+  void add_pitch (Musical_pitch, bool cautionary, bool natural);
 protected:
-    virtual void do_pre_processing();    
-    virtual void do_substitute_dependency (Score_elem*,Score_elem*);
-    virtual Molecule* brew_molecule_p()const;
+  virtual void do_pre_processing();
+  virtual void do_substitute_element_pointer (Score_element*,Score_element*);
+  virtual Molecule* do_brew_molecule_p() const;
 };
 #endif // LOCALKEYITEM_HH