]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/gregorian-ligature-engraver.cc
* The grand 2005-2006 replace.
[lilypond.git] / lily / gregorian-ligature-engraver.cc
index 88fbbb5022ae8035be8cd364df32c9addd34c3d0..29d8f40d3e3827db36fd9624e44f9f512f65dd2d 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2003--2005 Juergen Reuter <reuter@ipd.uka.de>
+  (c) 2003--2006 Juergen Reuter <reuter@ipd.uka.de>
 */
 
 #include "gregorian-ligature-engraver.hh"
@@ -13,6 +13,7 @@
 #include "staff-symbol-referencer.hh"
 #include "spanner.hh"
 #include "paper-column.hh"
+#include "pitch.hh"
 
 /*
  * This abstract class is the common superclass for all ligature
@@ -87,7 +88,7 @@ void check_and_fix_all_prefixes (Array<Grob_info> primitives)
   /* Check for illegal head modifier combinations */
   for (int i = 0; i < primitives.size (); i++)
     {
-      Grob *primitive = primitives[i].grob_;
+      Grob *primitive = primitives[i].grob ();
 
       /* compute head prefix set by inspecting primitive grob properties */
       int prefix_set
@@ -185,7 +186,7 @@ void check_and_fix_all_prefixes (Array<Grob_info> primitives)
       /* all other combinations should be valid (unless I made a
         mistake) */
 
-      primitive->set_property ("prefix-set", scm_int2num (prefix_set));
+      primitive->set_property ("prefix-set", scm_from_int (prefix_set));
     }
 }
 
@@ -201,7 +202,7 @@ provide_context_info (Array<Grob_info> primitives)
   int prev_pitch = 0;
   for (int i = 0; i < primitives.size (); i++)
     {
-      Grob *primitive = primitives[i].grob_;
+      Grob *primitive = primitives[i].grob ();
       Music *music_cause = primitives[i].music_cause ();
       int context_info = 0;
       int pitch = unsmob_pitch (music_cause->get_property ("pitch"))->steps ();
@@ -209,9 +210,7 @@ provide_context_info (Array<Grob_info> primitives)
 
       if (prefix_set & PES_OR_FLEXA)
        if (!i) // ligature may not start with 2nd head of pes or flexa
-         {
-           primitive->warning (_ ( "Cannot apply `\\~' on first head of ligature; ignoring `\\~'"));
-         }
+         primitive->warning (_ ("can't apply `\\~' on first head of ligature"));
        else if (pitch > prev_pitch) // pes
          {
            prev_context_info |= PES_LOWER;
@@ -223,17 +222,13 @@ provide_context_info (Array<Grob_info> primitives)
            context_info |= FLEXA_RIGHT;
          }
        else // (pitch == prev_pitch)
-         {
-           primitive->warning (_ ("can't apply `\\~' on heads with identical pitch; ignoring `\\~'"));
-         }
+         primitive->warning (_ ("can't apply `\\~' on heads with identical pitch"));
       if (prev_prefix_set & DEMINUTUM)
-       {
-         context_info |= AFTER_DEMINUTUM;
-       }
+       context_info |= AFTER_DEMINUTUM;
 
       if (prev_primitive)
        prev_primitive->set_property ("context-info",
-                                     scm_int2num (prev_context_info));
+                                     scm_from_int (prev_context_info));
       prev_primitive = primitive;
       prev_prefix_set = prefix_set;
       prev_context_info = context_info;
@@ -241,15 +236,7 @@ provide_context_info (Array<Grob_info> primitives)
     }
   if (prev_primitive)
     prev_primitive->set_property ("context-info",
-                                 scm_int2num (prev_context_info));
-}
-
-void
-Gregorian_ligature_engraver::transform_heads (Spanner *, Array<Grob_info>)
-{
-  programming_error ("Gregorian_ligature_engraver::transform_heads (): "
-                    "this is an abstract method that should not be called, "
-                    "but overridden by a subclass");
+                                 scm_from_int (prev_context_info));
 }
 
 void
@@ -272,10 +259,5 @@ Gregorian_ligature_engraver::stop_translation_timestep ()
   pes_or_flexa_req_ = 0;
 }
 
-ADD_TRANSLATOR (Gregorian_ligature_engraver,
-               /* descr */ "This is an abstract class.  Subclasses such as Vaticana_ligature_engraver handle ligatures by glueing special ligature heads together.",
-               /* creats*/ "",
-               /* accepts */ "ligature-event",
-               /* acks  */ "note-head-interface rest-interface",
-               /* reads */ "",
-               /* write */ "");
+// no ADD_ACKNOWLEDGER / ADD_ACKNOWLEDGER / ADD_TRANSLATOR macro calls
+// since this class is abstract