#include "paper-def.hh"
#include "lookup.hh"
#include "musical-pitch.hh"
+#include "staff-symbol-referencer.hh"
const int FLAT_TOP_PITCH=2; /* fes,ges,as and bes typeset in lower octave */
const int SHARP_TOP_PITCH=4; /* ais and bis typeset in lower octave */
Key_item::Key_item ()
{
- multi_octave_b_ = false;
- set_elt_property (breakable_scm_sym, SCM_BOOL_T);
+ set_elt_property ("breakable", SCM_BOOL_T);
set_c_position (0);
}
int
Key_item::calculate_position(int p, int a) const
{
- if (multi_octave_b_)
+ if (to_boolean (get_elt_property ("multi-octave")))
{
return p + c0_position_;
}
{
p -= 7; /* Typeset below c_position */
}
+ /* Provide for the four cases in which there's a glitch */
+ /* it's a hack, but probably not worth */
+ /* the effort of finding a nicer solution. dl. */
+ if (get_c_position ()==2 && a>0 && p==3)
+ p -= 7;
+ if (get_c_position ()==-3 && a>0 && p==-1)
+ p += 7;
+ if (get_c_position ()==-4 && a<0 && p==-1)
+ p += 7;
+ if (get_c_position ()==-2 && a<0 && p==-3)
+ p += 7;
return p + get_c_position ();
}
}
Key_item::do_brew_molecule_p() const
{
Molecule*output = new Molecule;
- Real inter = staff_line_leading_f ()/2.0;
+
+ Staff_symbol_referencer_interface si (this);
+ Real inter = si.staff_space ()/2.0;
int j;
if ((break_status_dir () == LEFT || break_status_dir () == CENTER)
|| (old_pitch_arr_[i] == pitch_arr_[j]
&& old_acc_arr_[i] != acc_arr_[j]))
{
- Molecule m =lookup_l ()->accidental (0,false);
+ Molecule m =lookup_l ()->afm_find ("accidentals-0");
+
m.translate_axis (calculate_position(old_pitch_arr_[i], old_acc_arr_[i]) * inter, Y_AXIS);
output->add_at_edge (X_AXIS, RIGHT, m,0);
}
for (int i =0; i < pitch_arr_.size(); i++)
{
- Molecule m =lookup_l ()->accidental (acc_arr_[i],false);
+ Molecule m = lookup_l ()->afm_find ("accidentals-" + to_str (acc_arr_[i]));
m.translate_axis (calculate_position(pitch_arr_[i], acc_arr_[i]) * inter, Y_AXIS);
output->add_at_edge (X_AXIS, RIGHT, m, 0);
}
- if (pitch_arr_.size())
- {
- Molecule m (lookup_l ()->fill (Box (
- Interval (0, paper_l ()->note_width ()),
- Interval (0,0))));
-
- output->add_at_edge (X_AXIS, RIGHT, m,0 );
- }
+
return output;
}
+