--- /dev/null
+/*
+ key-engraver.hh -- declare Key_engraver
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+
+#ifndef KEYGRAV_HH
+#define KEYGRAV_HH
+
+#include "engraver.hh"
+#include "key.hh"
+#include "musical-pitch.hh"
+
+/**
+ Make the key signature.
+ */
+class Key_engraver : public Engraver {
+ void create_key();
+ void read_req (Key_change_req const * r);
+
+public:
+ Key_engraver();
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ TRANSLATOR_CLONE(Key_engraver);
+ Key key_;
+ Key_change_req * keyreq_l_;
+ Key_item * kit_p_;
+ Array<Musical_pitch> accidental_idx_arr_;
+ Array<Musical_pitch> old_accidental_idx_arr_;
+ bool default_key_b_;
+ bool change_key_b_;
+
+protected:
+ virtual bool do_try_request (Request *req_l);
+ virtual void do_process_requests();
+ virtual void do_pre_move_processing();
+ virtual void do_post_move_processing();
+ virtual void acknowledge_element (Score_element_info);
+};
+
+#endif // KEYGRAV_HH
/*
key-item.hh -- part of GNU LilyPond
- (c) 1996,97 Han-Wen Nienhuys
+ (c) 1996--1998 Han-Wen Nienhuys
*/
#ifndef KEYITEM_HH
#define KEYITEM_HH
#include "item.hh"
-#include "varray.hh"
+#include "array.hh"
/// An item which places accidentals at the start of the line
struct Key_item : Item {
- Array<int> pitch;
- Array<int> acc;
- int c_position;
- bool default_b_;
-
+ Array<int> pitch;
+ Array<int> acc;
+ Array<int> old_pitch;
+ Array<int> old_acc;
+ int c_position;
+ int c0_position;
+ bool default_b_;
+ bool multi_octave_b_;
- DECLARE_MY_RUNTIME_TYPEINFO;
- SCORE_ELEM_CLONE(Key_item);
+ DECLARE_MY_RUNTIME_TYPEINFO;
+ SCORE_ELEMENT_CLONE(Key_item);
+
+ Key_item ();
+ void add (int pitch, int acc);
+ void add (const Musical_pitch&);
+ void add_old (int pitch, int acc);
+ void add_old (const Musical_pitch&);
+ void read (const Key_engraver&);
+ void set_c_position (int);
+ int Key_item::calculate_position(int p, int a) const;
- Key_item (int cposition);
- void add (int pitch, int acc);
- void read (const Key_engraver&);
- void set_c_position (int);
protected:
- virtual void do_pre_processing();
- Molecule* brew_molecule_p() const;
+ virtual void do_pre_processing();
+ Molecule* brew_molecule_p() const;
};
#endif // KEYITEM_HH