]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/local-key-item.hh
release: 1.3.68
[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
10
11 #include "item.hh"
12 #include "array.hh"
13 #include "musical-pitch.hh"
14
15
16
17 struct Local_key_cautionary_tuple
18 {
19   Musical_pitch pitch_;
20   bool cautionary_b_;
21   bool natural_b_;
22
23   Local_key_cautionary_tuple ()
24   {
25     cautionary_b_ = false;
26     natural_b_ = false;
27   }
28   static int compare (Local_key_cautionary_tuple const&s1, Local_key_cautionary_tuple const&s2)
29   {
30     return Musical_pitch::compare (s1.pitch_, s2.pitch_);
31   }
32 };
33
34 /**
35   Accidentals which can be different for each octave.
36
37   TODO: schemify me!
38  */
39 class Local_key_item : public Item
40 {
41   Array<Local_key_cautionary_tuple> accidental_arr_;
42
43   Molecule accidental (int,bool,bool) const;
44 public:
45   Local_key_item (SCM );
46    static SCM brew_molecule (SCM);
47   
48   void add_pitch (Musical_pitch, bool cautionary, bool natural);
49
50   SCM member_before_line_breaking ();
51   static SCM before_line_breaking (SCM);
52   SCM member_brew_molecule() const;
53 };
54
55 #endif // LOCALKEYITEM_HH
56