]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/piano-pedal-engraver.cc
release: 1.3.61
[lilypond.git] / lily / piano-pedal-engraver.cc
index 3fdbf0352a9b54ba7adc20ffed5428c4ff31b97f..8f43379ba51bede70572e67fd85c967d54e9e04e 100644 (file)
@@ -16,8 +16,9 @@
 #include "stem.hh"
 #include "side-position-interface.hh"
 #include "staff-symbol-referencer.hh"
-#include "text-item.hh"
-#include "sustain-pedal.hh"
+#include "item.hh"
+
+
 /*
    TODO:
      * it would be really cool if an engraver could be initialised with a
           Piano_pedal_engraver::"sustain"
           Piano_pedal_engraver::"una-chorda"
 
-
-
  */
 
 /*
   Would it? The semantics are unclear, and real benefits are muddy
-  too.  --hwn */
+  too.  --hwn
+*/
 
 
 
@@ -159,7 +159,7 @@ Piano_pedal_engraver::do_process_music ()
            }
          else
            {
-             s = get_property ("stopStart" + String (p->name_ ));
+             s = get_property (("stopStart" + String (p->name_ )).ch_C());
            }
          p->start_req_l_ = p->req_l_drul_[START];
        }
@@ -171,41 +171,34 @@ Piano_pedal_engraver::do_process_music ()
            }
          else
            {
-             s = get_property ("stop" + String (p->name_ ));
+             s = get_property (("stop" + String (p->name_ )).ch_C());
            }
          p->start_req_l_ = 0;
        }
       else if (p->req_l_drul_[START])
        {
          p->start_req_l_ = p->req_l_drul_[START];
-         s = get_property ("start" + String (p->name_ ));
+         s = get_property (("start" + String (p->name_ )).ch_C());
        }
 
-      if (s != SCM_UNDEFINED)
+      if (gh_string_p (s))
        {
          if (p->name_ == String ("Sustain"))
            {
-             p->item_p_ = new Sustain_pedal;
-             p->item_p_->set_elt_property ("text", s);
+             // fixme: Item should be sufficient.
+             p->item_p_ = new Item (get_property ("basicSustainPedalProperties"));
            }
          else
            {
-             p->item_p_ = new Text_item;
-             p->item_p_->set_elt_property ("text", s);
-             // guh
-             p->item_p_->set_elt_property ("style", ly_str02scm ("italic"));
+             p->item_p_ = new Item (get_property ("basicPedalProperties"));
            }
+         p->item_p_->set_elt_property ("text", s);
+         // guh
 
          Side_position_interface si (p->item_p_);
          si.set_axis (Y_AXIS);
 
-         /* Hmm,
-            If set to empty, it can't be centred
-            Howto centre non-fat text?
-            p->item_p_->set_empty (X_AXIS);
-         */
-         p->item_p_->set_elt_property ("no-spacing-rods"  , SCM_BOOL_T);
-         p->item_p_->set_elt_property ("self-alignment-X", gh_int2scm (0));
+         // todo: init with basic props.
          p->item_p_->add_offset_callback (Side_position_interface::aligned_on_self, X_AXIS);
          p->item_p_->add_offset_callback (Side_position_interface::centered_on_parent, X_AXIS);
          announce_element (Score_element_info (p->item_p_,
@@ -230,7 +223,7 @@ Piano_pedal_engraver::do_pre_move_processing ()
     {
       if (p->item_p_)
        {
-         side_position (p->item_p_).add_staff_support ();
+         Side_position_interface (p->item_p_).add_staff_support ();
          /*
            Hmm.
          */