]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/mensural-ligature-engraver.cc
lilypond-manuals.css: edit color scheme and some spacing
[lilypond.git] / lily / mensural-ligature-engraver.cc
index ab7e7d81d633fd1bc462b50edeaef15dbbc41f30..482538c720588537f16291fc2b243b46514fe7ad 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 2002--2014 Juergen Reuter <reuter@ipd.uka.de>,
+  Copyright (C) 2002--2015 Juergen Reuter <reuter@ipd.uka.de>,
   Pal Benko <benkop@freestart.hu>
 
   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<Grob_info> const &primitives);
-  DECLARE_TRANSLATOR_LISTENER (ligature);
 
 public:
   TRANSLATOR_DECLARATIONS (Mensural_ligature_engraver);
+  TRANSLATOR_INHERIT (Coherent_ligature_engraver);
 
 private:
   void transform_heads (vector<Grob_info> 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<Grob_info> const &primitives
           continue;
         }
 
-      int pitch = unsmob_pitch (nr->get_property ("pitch"))->steps ();
+      int pitch = unsmob<Pitch> (nr->get_property ("pitch"))->steps ();
       int prim = 0;
 
       if (at_beginning)
@@ -182,7 +176,7 @@ Mensural_ligature_engraver::transform_heads (vector<Grob_info> const &primitives
             }
           // b. descendens longa or brevis
           else if (i < s - 1
-                   && (unsmob_pitch (primitives[i + 1].event_cause ()
+                   && (unsmob<Pitch> (primitives[i + 1].event_cause ()
                                      ->get_property ("pitch"))->steps () < pitch)
                    && duration_log > -3)
             {
@@ -275,7 +269,7 @@ Mensural_ligature_engraver::transform_heads (vector<Grob_info> const &primitives
                   /*
                     breve: check whether descending
                   */
-                  int const next_pitch = unsmob_pitch
+                  int const next_pitch = unsmob<Pitch>
                                          (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 */