/*
local-key-item.hh -- part of GNU LilyPond
- (c) 1996--1998 Han-Wen Nienhuys
+ (c) 1996--2000 Han-Wen Nienhuys
*/
#ifndef LOCALKEYITEM_HH
#include "array.hh"
#include "musical-pitch.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: schemify me!
*/
-class Local_key_item : public Item {
+class Local_key_item : public Item
+{
+ Array<Local_key_cautionary_tuple> accidental_arr_;
+
+ Molecule accidental (int,bool,bool) const;
public:
- DECLARE_MY_RUNTIME_TYPEINFO;
- Array<Musical_pitch> accs;
- Link_array<Item> support_items_;
- int c0_position_i_;
-
- Local_key_item ();
- void add_support (Item*);
- void add (Musical_pitch);
+ Local_key_item (SCM );
+ static SCM scheme_molecule (SCM);
+
+ void add_pitch (Musical_pitch, bool cautionary, bool natural);
protected:
- virtual void do_pre_processing();
- virtual void do_substitute_dependency (Score_element*,Score_element*);
- virtual Molecule* brew_molecule_p() const;
+ virtual void before_line_breaking ();
+ Molecule do_brew_molecule() const;
};
+
#endif // LOCALKEYITEM_HH