]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/local-key-item.hh
release: 1.1.35
[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 #include "staff-symbol-referencer.hh"
13
14 struct Local_key_cautionary_tuple
15 {
16   Musical_pitch pitch_;
17   bool cautionary_b_;
18
19   Local_key_cautionary_tuple ()
20     {
21       cautionary_b_ = false;
22     }
23   static int compare (Local_key_cautionary_tuple const&s1, Local_key_cautionary_tuple const&s2)
24     {
25       return Musical_pitch::compare (s1.pitch_, s2.pitch_);
26     }
27 };
28
29 /**
30   Accidentals which can be different for each octave.
31
32   TODO:
33   update item if Items are removed
34
35   TODO
36   
37   figure out private/public
38   
39  */
40 class Local_key_item : public Item, public Staff_symbol_referencer {
41   Array<Local_key_cautionary_tuple> accidental_arr_;
42   Link_array<Item> support_items_;
43 public:
44   int c0_position_i_;
45   Local_key_item ();
46   void add_support (Item*);
47   void add_pitch (Musical_pitch, bool cautionary);
48 protected:
49   virtual void do_pre_processing();    
50   virtual void do_substitute_element_pointer (Score_element*,Score_element*);
51   virtual Molecule* do_brew_molecule_p() const;
52 };
53 #endif // LOCALKEYITEM_HH
54