#include "mensural-ligature.hh"
#include "ligature-engraver.hh"
-#include "musical-request.hh"
+#include "request.hh"
#include "warn.hh"
#include "item.hh"
#include "spanner.hh"
Grob_info info = primitives_[i];
int duration_log =
Note_head::get_balltype (dynamic_cast<Item*> (info.grob_));
- Note_req *nr = dynamic_cast<Note_req*> (info.music_cause ());
- if (!nr)
+
+ Music * nr = info.music_cause ();
+
+
+ /*
+
+ ugh. why not simply check for pitch?
+ */
+ if (!nr->is_mus_type ("note-event"))
{
info.music_cause ()->origin ()->warning (_f ("can not determine pitch of ligature primitive -> skipping"));
i++;
void set_delta_pitch (Item *primitive, Grob_info info1, Grob_info info2)
{
- Note_req *nr1 = dynamic_cast<Note_req*> (info1.music_cause ());
- Note_req *nr2 = dynamic_cast<Note_req*> (info2.music_cause ());
- Pitch pitch1 = *unsmob_pitch (nr1->get_mus_property ("pitch"));
- Pitch pitch2 = *unsmob_pitch (nr2->get_mus_property ("pitch"));
+ Pitch pitch1 = *unsmob_pitch (info1.music_cause ()->get_mus_property ("pitch"));
+ Pitch pitch2 = *unsmob_pitch (info2.music_cause ()->get_mus_property ("pitch"));
int delta_pitch = (pitch2.steps () - pitch1.steps ());
primitive->set_grob_property ("delta-pitch", gh_int2scm (delta_pitch));
}
gh_scm2double (thickness_scm) : 1.4;
thickness *= finished_ligature_->get_paper ()->get_var ("linethickness");
- /*
- * FIXME: Since character "noteheads--1mensural" is defined in
- * parmesan font only, the right-hand expression in the
- * following assignment evaluates to a width of 0.0, in case
- * font-family of finished_ligature_ is _not_ set to "ancient"
- * (by default, it is; see grob properties of MensuralLigature
- * in scm/grob-description.scm). This may arise severe problems
- * in the future when switching between fonts (e.g. mensural
- * versus neo-mensural).
- */
Real head_width =
Font_interface::get_default_font (finished_ligature_)->
find_by_name ("noteheads--1mensural").extent (X_AXIS).length ();
- if (head_width == 0.0)
- {
- programming_error ("Mensural_ligature_engraver: failed evaluating head_width (most probably a font-family selection problem)");
- }
-
SCM flexa_width_scm =
finished_ligature_->get_grob_property ("flexa-width");
Real flexa_width = (flexa_width_scm != SCM_EOL) ?
for (int i = 0; i < primitives_.size (); i++)
{
Grob_info info = primitives_[i];
- Note_req *nr = dynamic_cast<Note_req*> (info.music_cause ());
- Pitch pitch = *unsmob_pitch (nr->get_mus_property ("pitch"));
+ Pitch pitch = *unsmob_pitch (info.music_cause ()->get_mus_property ("pitch"));
if (i > 0)
{
Item *primitive = dynamic_cast<Item*> (info.grob_);
ENTER_DESCRIPTION (Mensural_ligature_engraver,
/* descr */ "Handles Mensural_ligature_requests by glueing special ligature heads together.",
/* creats*/ "MensuralLigature",
-/* acks */ "ligature-head-interface note-head-interface rest-interface",
+/* accepts */ "",
+/* acks */ "ligature-head-interface note-head-interface rest-interface",
/* reads */ "",
/* write */ "");