return false;
}
-Spanner *
-Ligature_engraver::create_ligature_spanner ()
-{
- programming_error ("Ligature_engraver::create_ligature_spanner (): "
- "this is an abstract method that should not be called, "
- "but overridden by a subclass");
- return 0;
-}
-
/*
* This method should do something that comes close to the following
* .ly snippet:
*
* \property Voice.NoteHead \override #'print-function =
- * < value of #'ligature-primitive-callback of Voice.NoteHead >
+ * < value of noteHeadLigaturePrimitive
*
* TODO: What we are doing here on the c++ level, should actually be
* performed on the SCM level. However, I do not know how to teach
void
Ligature_engraver::override_stencil_callback ()
{
- SCM target_callback = ly_symbol2scm ("print-function");
- SCM source_callback = ly_symbol2scm ("ligature-primitive-callback");
- SCM noteHeadProperties = updated_grob_properties (context (), ly_symbol2scm ("NoteHead"));
- SCM value = scm_cdr (scm_sloppy_assq (source_callback, noteHeadProperties));
execute_pushpop_property (context (), ly_symbol2scm ("NoteHead"),
- target_callback, value);
+ ly_symbol2scm ("stencil"),
+ get_property ("noteHeadLigaturePrimitive"));
}
/*
void
Ligature_engraver::revert_stencil_callback ()
{
- SCM symbol = ly_symbol2scm ("NoteHead");
- SCM key = ly_symbol2scm ("print-function");
- execute_pushpop_property (context (), symbol, key, SCM_UNDEFINED);
+ execute_pushpop_property (context (), ly_symbol2scm ("NoteHead"),
+ ly_symbol2scm ("stencil"), SCM_UNDEFINED);
}
void
}
if (!last_bound_)
- {
- events_drul_[STOP]->origin ()->warning (_ ("no right bound"));
- }
+ events_drul_[STOP]->origin ()->warning (_ ("no right bound"));
else
- {
- ligature_->set_bound (RIGHT, last_bound_);
- }
+ ligature_->set_bound (RIGHT, last_bound_);
prev_start_event_ = 0;
finished_primitives_ = primitives_;
prev_start_event_ = events_drul_[START];
ligature_ = create_ligature_spanner ();
- brew_ligature_primitive_proc
- = ligature_->get_property ("ligature-primitive-callback");
- if (brew_ligature_primitive_proc == SCM_EOL)
- {
- programming_error ("Ligature_engraver: ligature-primitive-callback undefined");
- }
Grob *bound = unsmob_grob (get_property ("currentMusicalColumn"));
if (!bound)
- {
- events_drul_[START]->origin ()->warning (_ ("no left bound"));
- }
+ events_drul_[START]->origin ()->warning (_ ("no left bound"));
else
- {
- ligature_->set_bound (LEFT, bound);
- }
+ ligature_->set_bound (LEFT, bound);
ligature_start_mom_ = now_mom ();
}
}
-void
-Ligature_engraver::typeset_ligature (Spanner *, Array<Grob_info>)
-{
- programming_error ("Ligature_engraver::typeset_ligature (): "
- "this is an abstract method that should not be called, "
- "but overridden by a subclass");
-}
-
void
Ligature_engraver::stop_translation_timestep ()
{
if (ligature_)
{
primitives_.push (info);
- info.grob ()->set_property ("print-function",
- brew_ligature_primitive_proc);
+ if (info.grob ())
+ {
+ info.grob ()->set_property ("stencil",
+ brew_ligature_primitive_proc);
+ }
}
}
}
}
-
-ADD_ACKNOWLEDGER (Ligature_engraver, rest);
-ADD_ACKNOWLEDGER (Ligature_engraver, note_head);
-ADD_TRANSLATOR (Ligature_engraver,
- /* descr */ "Abstract class; a concrete subclass handles Ligature_events by engraving Ligatures in a concrete style.",
- /* creats */ "",
- /* accepts */ "ligature-event",
- /* reads */ "",
- /* write */ "");
+// no ADD_ACKNOWLEDGER / ADD_ACKNOWLEDGER / ADD_TRANSLATOR macro calls
+// since this class is abstract