]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/ligature-engraver.cc
Update.
[lilypond.git] / lily / ligature-engraver.cc
index e13798034b16a7cdb858130a665b197f9cd21e86..ce6e8a8c2b14ff872ad7e64b451f91ea5c93a857 100644 (file)
@@ -94,7 +94,7 @@ Ligature_engraver::try_music (Music *m)
  * .ly snippet:
  *
  * \property Voice.NoteHead \override #'print-function =
- *     < value of #'ligature-primitive-callback of Voice.NoteHead >
+ *     < value of noteHeadLigaturePrimitive
  *
  * TODO: What we are doing here on the c++ level, should actually be
  * performed on the SCM level.  However, I do not know how to teach
@@ -106,12 +106,9 @@ Ligature_engraver::try_music (Music *m)
 void
 Ligature_engraver::override_stencil_callback ()
 {
-  SCM target_callback = ly_symbol2scm ("print-function");
-  SCM source_callback = ly_symbol2scm ("ligature-primitive-callback");
-  SCM noteHeadProperties = updated_grob_properties (context (), ly_symbol2scm ("NoteHead"));
-  SCM value = scm_cdr (scm_sloppy_assq (source_callback, noteHeadProperties));
   execute_pushpop_property (context (), ly_symbol2scm ("NoteHead"),
-                           target_callback, value);
+                           ly_symbol2scm ("stencil"),
+                           get_property ("noteHeadLigaturePrimitive"));
 }
 
 /*
@@ -130,9 +127,8 @@ Ligature_engraver::override_stencil_callback ()
 void
 Ligature_engraver::revert_stencil_callback ()
 {
-  SCM symbol = ly_symbol2scm ("NoteHead");
-  SCM key = ly_symbol2scm ("print-function");
-  execute_pushpop_property (context (), symbol, key, SCM_UNDEFINED);
+  execute_pushpop_property (context (), ly_symbol2scm ("NoteHead"),
+                           ly_symbol2scm ("stencil"), SCM_UNDEFINED);
 }
 
 void
@@ -147,13 +143,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_;
@@ -180,22 +172,12 @@ Ligature_engraver::process_music ()
 
       prev_start_event_ = events_drul_[START];
       ligature_ = create_ligature_spanner ();
-      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");
-       }
 
       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 ();
 
@@ -257,7 +239,7 @@ Ligature_engraver::acknowledge_note_head (Grob_info info)
       primitives_.push (info);
       if (info.grob ())
        {
-         info.grob ()->set_property ("print-function",
+         info.grob ()->set_property ("stencil",
                                      brew_ligature_primitive_proc);
        }
     }