]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/ligature-engraver.cc
* lily/include/tie.hh (struct Tie_details): add x_gap_
[lilypond.git] / lily / ligature-engraver.cc
index fe680c7a7db8b352289d7b8b892ec00f0780366b..cd975b71e98c8f72244ee7e380b44b9210f03ee3 100644 (file)
@@ -15,6 +15,8 @@
 #include "warn.hh"
 #include "context.hh"
 
+#include "translator.icc"
+
 /*
  * This abstract class provides the general framework for ligatures of
  * any kind.  It cares for handling start/stop ligatures events and
@@ -87,15 +89,6 @@ Ligature_engraver::try_music (Music *m)
   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:
@@ -154,13 +147,9 @@ Ligature_engraver::process_music ()
        }
 
       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_;
@@ -190,19 +179,13 @@ Ligature_engraver::process_music ()
       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");
-       }
+       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 ();
 
@@ -212,14 +195,6 @@ Ligature_engraver::process_music ()
     }
 }
 
-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 ()
 {
@@ -265,32 +240,30 @@ Ligature_engraver::current_ligature ()
 }
 
 void
-Ligature_engraver::acknowledge_grob (Grob_info info)
+Ligature_engraver::acknowledge_note_head (Grob_info info)
 {
   if (ligature_)
     {
-      if (Note_head::has_interface (info.grob ()))
+      primitives_.push (info);
+      if (info.grob ())
        {
-         primitives_.push (info);
          info.grob ()->set_property ("print-function",
-                                   brew_ligature_primitive_proc);
-       }
-      if (Rest::has_interface (info.grob ()))
-       {
-         info.music_cause ()->origin ()->warning (_ ("ignoring rest: ligature may not contain rest"));
-         prev_start_event_->origin ()->warning (_ ("ligature was started here"));
-         // TODO: maybe better should stop ligature here rather than
-         // ignoring the rest?
+                                     brew_ligature_primitive_proc);
        }
     }
 }
 
-#include "translator.icc"
+void
+Ligature_engraver::acknowledge_rest (Grob_info info)
+{
+  if (ligature_)
+    {
+      info.music_cause ()->origin ()->warning (_ ("ignoring rest: ligature may not contain rest"));
+      prev_start_event_->origin ()->warning (_ ("ligature was started here"));
+      // TODO: maybe better should stop ligature here rather than
+      // ignoring the rest?
+    }
+}
 
-ADD_TRANSLATOR (Ligature_engraver,
-               /* descr */ "Abstract class; a concrete subclass handles Ligature_events by engraving Ligatures in a concrete style.",
-               /* 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