]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/key-item.hh
release: 1.0.17
[lilypond.git] / lily / include / key-item.hh
1 /*
2   key-item.hh -- part of GNU LilyPond
3
4   (c) 1996--1998 Han-Wen Nienhuys
5 */
6
7 #ifndef KEYITEM_HH
8 #define KEYITEM_HH
9
10 #include "item.hh"
11 #include "array.hh"
12
13
14 /// An item which places accidentals at the start of the line
15 struct Key_item : Item {
16   Array<int> pitch_arr_;
17   Array<int> acc_arr_;
18   Array<int> old_pitch_arr_;
19   Array<int> old_acc_arr_;
20
21   // ugh.  Naming 
22   int c_position;
23   // see above.
24   int c0_position;
25   bool default_b_;
26   bool multi_octave_b_;
27     
28   DECLARE_MY_RUNTIME_TYPEINFO;
29   SCORE_ELEMENT_CLONE(Key_item);
30
31   Key_item ();
32   void add (int pitch, int acc);
33   void add (const Musical_pitch&);
34   void add_old (int pitch, int acc);
35   void add_old (const Musical_pitch&);
36   void set (bool multi_octave_b,
37             Array<Musical_pitch> const &idx_arr,
38             Array<Musical_pitch> const &old_idx_arr);
39
40   void set_c_position (int);
41   int Key_item::calculate_position(int p, int a) const;
42
43 protected:
44   virtual void do_pre_processing();
45   Molecule* brew_molecule_p() const;
46 };
47
48 #endif // KEYITEM_HH