]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/local-key-item.hh
626af84454cbc3f8ef655d61f52170d1d5a3de40
[lilypond.git] / lily / include / local-key-item.hh
1 /*
2   local-key-item.hh -- part of GNU LilyPond
3
4   (c) 1996--2000 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 #include "note-head-side.hh"
14
15 struct Local_key_cautionary_tuple
16 {
17   Musical_pitch pitch_;
18   bool cautionary_b_;
19   bool natural_b_;
20
21   Local_key_cautionary_tuple ()
22   {
23     cautionary_b_ = false;
24     natural_b_ = false;
25   }
26   static int compare (Local_key_cautionary_tuple const&s1, Local_key_cautionary_tuple const&s2)
27   {
28     return Musical_pitch::compare (s1.pitch_, s2.pitch_);
29   }
30 };
31
32 /**
33   Accidentals which can be different for each octave.
34
35   
36   TODO
37
38   Make an item for each accidental separately, and make a
39   Accidental_column to group them.
40   
41  */
42
43 class Local_key_item : public Note_head_side
44 {
45   Array<Local_key_cautionary_tuple> accidental_arr_;
46
47   Molecule accidental (int,bool,bool) const;
48 public:
49   Local_key_item ();
50   void add_pitch (Musical_pitch, bool cautionary, bool natural);
51 protected:
52   virtual void do_pre_processing();
53   virtual Molecule* do_brew_molecule_p() const;
54 };
55 #endif // LOCALKEYITEM_HH
56