#include "lookup.hh"
static SCM
-pitch_less (SCM p1, SCM p2)
+pitch_less (SCM p1, SCM p2)
{
return Pitch::less_p (gh_car (p1), gh_car (p2));
}
pitch_less_proc = gh_new_procedure2_0 ("pits-less", &pitch_less);
}
-ADD_SCM_INIT_FUNC(lkpitch,init_pitch_funcs);
+ADD_SCM_INIT_FUNC (lkpitch,init_pitch_funcs);
void
Local_key_item::add_pitch (Grob*me, Pitch p, bool cautionary, bool natural,
- Grob* tie_break_cautionary)
+ Grob* tie_break_reminder)
{
SCM acs = me->get_grob_property ("accidentals");
SCM pitch = p.smobbed_copy ();
opts = gh_cons (ly_symbol2scm ("cautionary"), opts);
if (natural)
opts = gh_cons (ly_symbol2scm ("natural"), opts);
- if (tie_break_cautionary)
+ if (tie_break_reminder)
{
/* Ugh, these 'options' can't have a value, faking... */
- opts = gh_cons (tie_break_cautionary->self_scm (), opts);
- opts = gh_cons (ly_symbol2scm ("tie-break-cautionary"), opts);
+ opts = gh_cons (tie_break_reminder->self_scm (), opts);
+ opts = gh_cons (ly_symbol2scm ("tie-break-reminder"), opts);
}
pitch = gh_cons (pitch, opts);
{
Molecule open = Font_interface::get_default_font (me)->find_by_name (String ("accidentals-("));
Molecule close = Font_interface::get_default_font (me)->find_by_name (String ("accidentals-)"));
- m.add_at_edge(X_AXIS, LEFT, Molecule(open), 0);
- m.add_at_edge(X_AXIS, RIGHT, Molecule(close), 0);
+ m.add_at_edge (X_AXIS, LEFT, Molecule (open), 0);
+ m.add_at_edge (X_AXIS, RIGHT, Molecule (close), 0);
return m;
}
-/*
- HW says: move to tie.cc
+/* HW says: maybe move to tie.cc
+
+ Note, tie should not kill all accidentals when broken, only the ones
+ that are indicated by a property tie-break-reminder, I guess
- Ugh: this doesn't work: brew_molecule is called before line-breaking
- */
+ Find if any of the accidentals were created because they're at the rhs of a
+ tie. If that's the reason they exist, and the tie was NOT broken,
+ put the accidental up for deletion. Clear molecule cache. */
MAKE_SCHEME_CALLBACK (Local_key_item, after_line_breaking, 1);
SCM
Local_key_item::after_line_breaking (SCM smob)
Grob *me = unsmob_grob (smob);
SCM accs = me->get_grob_property ("accidentals");
- for (SCM s = accs;
+ for (SCM s = accs;
gh_pair_p (s); s = gh_cdr (s))
{
SCM opts = gh_cdar (s);
- SCM t = scm_memq (ly_symbol2scm ("tie-break-cautionary"), opts);
+ SCM t = scm_memq (ly_symbol2scm ("tie-break-reminder"), opts);
if (t != SCM_BOOL_F)
{
Grob *tie = unsmob_grob (gh_cadr (t));
Spanner *sp = dynamic_cast<Spanner*> (tie);
- if (!sp->broken_into_l_arr_.size ())
+ if (!sp->original_l_)
{
- /* there should be a better way to delete me */
+ /* there should be a better way to delete part of me */
scm_set_car_x (s, gh_list (gh_caar (s),
ly_symbol2scm ("deleted"),
SCM_UNDEFINED));
+ me->set_grob_property ("molecule", SCM_EOL);
}
}
}
accidental placement is more complicated than this.
*/
-MAKE_SCHEME_CALLBACK(Local_key_item,brew_molecule,1);
+MAKE_SCHEME_CALLBACK (Local_key_item,brew_molecule,1);
SCM
Local_key_item::brew_molecule (SCM smob)
{
int lastoct = -100;
SCM accs = me->get_grob_property ("accidentals");
- for (SCM s = accs;
+ for (SCM s = accs;
gh_pair_p (s); s = gh_cdr (s))
{
Pitch p (*unsmob_pitch (gh_caar (s)));
if (scm_memq (ly_symbol2scm ("natural"), opts) != SCM_BOOL_F)
{
Molecule prefix = Font_interface::get_default_font (me)->find_by_name (String ("accidentals-0"));
- acc.add_at_edge(X_AXIS, LEFT, Molecule(prefix), 0);
+ acc.add_at_edge (X_AXIS, LEFT, Molecule (prefix), 0);
}
if (scm_memq (ly_symbol2scm ("cautionary"), opts) != SCM_BOOL_F)
if (!gh_number_p (pads[d]))
continue;
- Box b(Interval (0, gh_scm2double (pads[d]) * note_distance),
+ Box b (Interval (0, gh_scm2double (pads[d]) * note_distance),
Interval (0,0));
Molecule m (Lookup::blank (b));
mol.add_at_edge (X_AXIS, d, m, 0);
- } while ( flip (&d)!= LEFT);
+ } while (flip (&d)!= LEFT);
}
- return mol.smobbed_copy();
+ return mol.smobbed_copy ();
}
bool