#include "paper-def.hh"
#include "lookup.hh"
+/*
+ UGH UGH UGH
+
+ This does 3 things at one:
+
+ - acc positioning
+ - drawing accidentals
+ - drawing note heads
+
+ It confuses interpretation & formatting.
+
+ UGH.
+ --hwn.
+ */
+
/*
* TODO: note-head collision handling
*
bool ignore_octave_b, bool force_accidental)
{
int notename = pitch->get_notename ();
- int octave = pitch->get_octave();
- int alteration = pitch->get_alteration();
+ int octave = pitch->get_octave ();
+ int alteration = pitch->get_alteration ();
if (force_accidental) // ignore key signature
return 1;
{
if (!num_acc)
return;
- if (pitch->get_alteration())
+ if (pitch->get_alteration ())
{
Stencil accidental (Font_interface::get_default_font (me)->
find_by_name (String ("accidentals-") +
Item *me = (Item *)unsmob_grob (smob);
Stencil stencil = Stencil ();
- SCM scm_note_head_style = me->get_grob_property ("note-head-style");
+ SCM scm_note_head_style = me->get_property ("note-head-style");
String note_head_style;
if (gh_symbol_p (scm_note_head_style))
{
FIXME: Use positions.
*/
int p_min, p_max;
- Pitch *pitch_min = unsmob_pitch (me->get_grob_property ("pitch-min"));
+ Pitch *pitch_min = unsmob_pitch (me->get_property ("pitch-min"));
if (!pitch_min)
{
- me->programming_error("Ambitus: pitch_min undefined; assuming 0");
+ me->programming_error ("Ambitus: pitch_min undefined; assuming 0");
p_min = 0;
}
else
{
p_min = pitch_min->steps ();
}
- Pitch *pitch_max = unsmob_pitch (me->get_grob_property ("pitch-max"));
+ Pitch *pitch_max = unsmob_pitch (me->get_property ("pitch-max"));
if (!pitch_max)
{
- me->programming_error("Ambitus: pitch_max undefined; assuming 0");
+ me->programming_error ("Ambitus: pitch_max undefined; assuming 0");
p_max = 0;
}
else
me->programming_error ("Ambitus: reverse range");
}
- SCM c0 = me->get_grob_property ("c0-position");
+ SCM c0 = me->get_property ("c0-position");
if (gh_number_p (c0))
{
p_min += gh_scm2int (c0);
head_max.translate_axis (0.5*p_max, Y_AXIS);
// join heads
- if (to_boolean (me->get_grob_property ("join-heads")) &&
+ if (to_boolean (me->get_property ("join-heads")) &&
((p_max - p_min) >= 3))
{
Real linethickness = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
stencil.add_stencil (ledger_lines);
// add accidentals
- SCM key_signature = me->get_grob_property ("key-signature");
- SCM scm_accidentals_style = me->get_grob_property ("accidentals-style");
+ SCM key_signature = me->get_property ("key-signature");
+ SCM scm_accidentals_style = me->get_property ("accidentals-style");
String accidentals_style;
if (gh_symbol_p (scm_accidentals_style))
{
{
accidentals_style = String ("");
}
+
int num_acc;
num_acc = number_accidentals (key_signature, pitch_min, true, false);
add_accidentals (me, &head_min, num_acc, pitch_min,
}
ADD_INTERFACE (Ambitus, "ambitus-interface",
- "An ambitus represents the pitch range of a voice.",
- "c0-position pitch-min pitch-max accidentals note-head-style join-heads");
+ "An object that represents the pitch range of a voice.",
+ "c0-position pitch-min pitch-max accidentals note-head-style accidentals-style join-heads");