item_p_ = new Key_item;
Staff_symbol_referencer_interface st (item_p_);
st.set_interface ();
+
- item_p_->set_elt_property ("break-aligned", SCM_BOOL_T); // ugh
-
+ item_p_->set_elt_property ("break-align-symbol", ly_symbol2scm ("Key_item"));
item_p_->set_elt_property ("multi-octave",
gh_bool2scm (key_.multi_octave_b_));
{
if (dynamic_cast <Clef_change_req *> (info.req_l_))
{
- SCM c = get_property ("createKeyOnClefChange", 0);
+ SCM c = get_property ("createKeyOnClefChange");
if (to_boolean (c))
create_key ();
}
else if (dynamic_cast<Bar *> (info.elem_l_)
&& accidental_idx_arr_.size ())
{
- bool def = (!item_p_);
create_key ();
- if (!def)
- {
- item_p_->set_elt_property ("visibility-lambda",
- ly_eval_str ("all-visibility"));
- }
}
}
void
-Key_engraver::do_process_requests ()
+Key_engraver::do_process_music ()
{
if (keyreq_l_)
{
{
if (item_p_)
{
+ if (keyreq_l_)
+ item_p_->set_elt_property ("visibility-lambda",
+ scm_eval (ly_symbol2scm ("all-visible")));
+
typeset_element (item_p_);
item_p_ = 0;
}
/*
- TODO Slightly hairy.
+ TODO. Use properties; and this is too hairy.
*/
void
Key_engraver::read_req (Key_change_req const * r)
{
+ if (!r->key_)
+ return;
+
old_accidental_idx_arr_ = accidental_idx_arr_;
key_.clear ();
- SCM prop = get_property ("keyOctaviation", 0);
+ SCM prop = get_property ("keyOctaviation");
key_.multi_octave_b_ = to_boolean (prop);
accidental_idx_arr_.clear ();
- if (r->key_.ordinary_key_b_)
+ if (r->key_->ordinary_key_b_)
{
- int no_of_acc = r->key_.ordinary_accidentals_i ();
+ int no_of_acc = r->key_->ordinary_accidentals_i ();
// Hmm, can't these be handled/constructed by Key_change_req?
if (no_of_acc < 0)
}
else // Special key
{
- for (int i = 0; i < r->key_.pitch_arr_.size (); i ++)
+ for (int i = 0; i < r->key_->pitch_arr_.size (); i ++)
{
- Musical_pitch m_l =r->key_.pitch_arr_[i];
+ Musical_pitch m_l =r->key_->pitch_arr_[i];
if (key_.multi_octave_b_)
key_.set (m_l);
else