]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/piano-pedal-engraver.cc
release: 1.3.106
[lilypond.git] / lily / piano-pedal-engraver.cc
index 861c74f9390bf1e7ace46d5d2dd0be32d33c2d7b..3f09f169e1579d2bddc1ca60bc7f59fa1453ed00 100644 (file)
@@ -10,7 +10,6 @@
 #include "musical-request.hh"
 #include "score-element.hh"
 #include "item.hh"
-#include "lookup.hh"
 #include "lily-guile.hh"
 #include "rhythmic-head.hh"
 #include "stem.hh"
 #include "item.hh"
 
 
-/*
-   TODO:
-     * it would be really cool if an engraver could be initialised with a
-       string, ie:
-
-          Piano_pedal_engraver::"sostenuto"
-          Piano_pedal_engraver::"sustain"
-          Piano_pedal_engraver::"una-chorda"
-
- */
-
-/*
-  Would it? The semantics are unclear, and real benefits are muddy
-  too.  --hwn
-*/
 
 
 
@@ -134,9 +118,10 @@ Piano_pedal_engraver::do_try_music (Music *m)
     {
       for (Pedal_info*p = info_list_; p->name_; p ++)
        {
-         if (s->span_type_str_ == p->name_)
+         if (scm_equal_p (s->get_mus_property ("span-type"),
+                          ly_str02scm (p->name_))==SCM_BOOL_T)
            {
-             p->req_l_drul_[s->span_dir_] = s;
+             p->req_l_drul_[s->get_span_dir()] = s;
              return true;
            }
        }
@@ -149,7 +134,7 @@ Piano_pedal_engraver::do_process_music ()
 {
   for (Pedal_info*p = info_list_; p->name_; p ++)
     {
-      SCM s = SCM_UNDEFINED;
+      SCM s = SCM_EOL;
       if (p->req_l_drul_[STOP] && p->req_l_drul_[START])
        {
          if (!p->start_req_l_)
@@ -182,16 +167,10 @@ Piano_pedal_engraver::do_process_music ()
 
       if (gh_string_p (s))
        {
-         String propname = String ("basic")+  p->name_ + "PedalProperties";
+         String propname = String (p->name_) + "Pedal";
          p->item_p_ = new Item (get_property (propname.ch_C()));
          p->item_p_->set_elt_property ("text", s);
-         // guh
-
-         Side_position::set_axis (p->item_p_,Y_AXIS);
 
-         // todo: init with basic props.
-         p->item_p_->add_offset_callback (Side_position_aligned_on_self_proc, X_AXIS);
-         p->item_p_->add_offset_callback (Side_position_centered_on_parent_proc, X_AXIS);
          announce_element (p->item_p_,
                            p->req_l_drul_[START]
                            ? p->req_l_drul_[START]