]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/local-key-item.hh
ccedf0f9b7e7fa222d1bf8248678b6a41d2827a9
[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    static SCM scheme_molecule (SCM);
45   
46   void add_pitch (Musical_pitch, bool cautionary, bool natural);
47 protected:
48   virtual void before_line_breaking ();
49   Molecule do_brew_molecule() const;
50 };
51
52 #endif // LOCALKEYITEM_HH
53