]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/local-key-item.hh
release: 1.3.55
[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
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   TODO: schemify me!
36  */
37 class Local_key_item : public Item
38 {
39   Array<Local_key_cautionary_tuple> accidental_arr_;
40
41   Molecule accidental (int,bool,bool) const;
42 public:
43   Local_key_item (SCM );
44   void add_pitch (Musical_pitch, bool cautionary, bool natural);
45 protected:
46   virtual void before_line_breaking ();
47   virtual Molecule do_brew_molecule() const;
48
49
50 };
51 #endif // LOCALKEYITEM_HH
52