]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/local-key-item.hh
release: 1.1.33
[lilypond.git] / lily / include / local-key-item.hh
1 /*
2   local-key-item.hh -- part of GNU LilyPond
3
4   (c) 1996--1999 Han-Wen Nienhuys
5 */
6
7 #ifndef LOCALKEYITEM_HH
8 #define LOCALKEYITEM_HH
9 #include "item.hh"
10 #include "array.hh"
11 #include "musical-pitch.hh"
12
13 struct Local_key_cautionary_tuple
14 {
15   Musical_pitch pitch_;
16   bool cautionary_b_;
17
18   Local_key_cautionary_tuple ()
19     {
20       cautionary_b_ = false;
21     }
22   static int compare (Local_key_cautionary_tuple const&s1, Local_key_cautionary_tuple const&s2)
23     {
24       return Musical_pitch::compare (s1.pitch_, s2.pitch_);
25     }
26 };
27
28 /**
29   Accidentals which can be different for each octave.
30
31   TODO:
32   update item if Items are removed
33
34   TODO
35   
36   figure out private/public
37   
38  */
39 class Local_key_item : public Item {
40   Array<Local_key_cautionary_tuple> accidental_arr_;
41   Link_array<Item> support_items_;
42 public:
43   int c0_position_i_;
44   Local_key_item ();
45   void add_support (Item*);
46   void add_pitch (Musical_pitch, bool cautionary);
47 protected:
48   virtual void do_pre_processing();    
49   virtual void do_substitute_element_pointer (Score_element*,Score_element*);
50   virtual Molecule* do_brew_molecule_p() const;
51 };
52 #endif // LOCALKEYITEM_HH
53