X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fmensural-ligature-engraver.cc;h=482538c720588537f16291fc2b243b46514fe7ad;hb=97a0169312a260933246ab224e4f8b0969871dd5;hp=ab7e7d81d633fd1bc462b50edeaef15dbbc41f30;hpb=9e781b7dc83b60a543ce218aa1a5f139f74c760f;p=lilypond.git diff --git a/lily/mensural-ligature-engraver.cc b/lily/mensural-ligature-engraver.cc index ab7e7d81d6..482538c720 100644 --- a/lily/mensural-ligature-engraver.cc +++ b/lily/mensural-ligature-engraver.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 2002--2014 Juergen Reuter , + Copyright (C) 2002--2015 Juergen Reuter , Pal Benko LilyPond is free software: you can redistribute it and/or modify @@ -59,10 +59,10 @@ protected: virtual Spanner *create_ligature_spanner (); virtual void build_ligature (Spanner *ligature, vector const &primitives); - DECLARE_TRANSLATOR_LISTENER (ligature); public: TRANSLATOR_DECLARATIONS (Mensural_ligature_engraver); + TRANSLATOR_INHERIT (Coherent_ligature_engraver); private: void transform_heads (vector const &primitives); @@ -73,14 +73,8 @@ private: Real &min_length); }; -IMPLEMENT_TRANSLATOR_LISTENER (Mensural_ligature_engraver, ligature); -void -Mensural_ligature_engraver::listen_ligature (Stream_event *ev) -{ - Ligature_engraver::listen_ligature (ev); -} - -Mensural_ligature_engraver::Mensural_ligature_engraver () +Mensural_ligature_engraver::Mensural_ligature_engraver (Context *c) + : Coherent_ligature_engraver (c) { brew_ligature_primitive_proc = Mensural_ligature::brew_ligature_primitive_proc; @@ -129,7 +123,7 @@ Mensural_ligature_engraver::transform_heads (vector const &primitives continue; } - int pitch = unsmob_pitch (nr->get_property ("pitch"))->steps (); + int pitch = unsmob (nr->get_property ("pitch"))->steps (); int prim = 0; if (at_beginning) @@ -182,7 +176,7 @@ Mensural_ligature_engraver::transform_heads (vector const &primitives } // b. descendens longa or brevis else if (i < s - 1 - && (unsmob_pitch (primitives[i + 1].event_cause () + && (unsmob (primitives[i + 1].event_cause () ->get_property ("pitch"))->steps () < pitch) && duration_log > -3) { @@ -275,7 +269,7 @@ Mensural_ligature_engraver::transform_heads (vector const &primitives /* breve: check whether descending */ - int const next_pitch = unsmob_pitch + int const next_pitch = unsmob (next_info.event_cause ()->get_property ("pitch"))->steps (); if (next_pitch < pitch) /* @@ -495,8 +489,14 @@ Mensural_ligature_engraver::build_ligature (Spanner *ligature, ligature->set_property ("minimum-length", scm_from_double (min_length)); } -ADD_ACKNOWLEDGER (Mensural_ligature_engraver, rest); -ADD_ACKNOWLEDGER (Mensural_ligature_engraver, ligature_head); + +void +Mensural_ligature_engraver::boot () +{ + ADD_LISTENER (Mensural_ligature_engraver, ligature); + ADD_ACKNOWLEDGER (Mensural_ligature_engraver, rest); + ADD_ACKNOWLEDGER (Mensural_ligature_engraver, ligature_head); +} ADD_TRANSLATOR (Mensural_ligature_engraver, /* doc */