]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/piano-pedal-engraver.cc
*** empty log message ***
[lilypond.git] / lily / piano-pedal-engraver.cc
index 8ab24223261fc643c7f60031170ee62ac3b681b1..234cd5c85237f66a7b212856fa991687e70130a9 100644 (file)
@@ -3,7 +3,7 @@
   
   source file of the GNU LilyPond music typesetter
   
- (c) 2000--2003 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 2000--2004 Jan Nieuwenhuizen <janneke@gnu.org>
   
   Chris Jackson <chris@fluffhouse.org.uk> - extended to support
   bracketed pedals.
@@ -18,7 +18,8 @@
 #include "staff-symbol-referencer.hh"
 #include "item.hh"
 #include "axis-group-interface.hh"
-#include "translator-group.hh"
+#include "context.hh"
+
 #include "directional-element-interface.hh"
 #include "note-column.hh"
 #include "warn.hh"
@@ -159,27 +160,15 @@ Piano_pedal_engraver::acknowledge_grob (Grob_info info)
 bool
 Piano_pedal_engraver::try_music (Music *m)
 {
-  if (m->is_mus_type ("abort-event"))
-    {
-      for (Pedal_info*p = info_list_; p->name_; p ++)
-       {
-         p->event_drul_[START] = 0;
-         p->event_drul_[STOP] = 0;
-         
-         if (p->bracket_)
-           p->bracket_->suicide ();
-         p->bracket_ = 0;
-       }
-    }
-  else if  (m->is_mus_type ("pedal-event"))
+ if  (m->is_mus_type ("pedal-event"))
     {
       for (Pedal_info*p = info_list_; p->name_; p ++)
        {
          String nm = p->name_ + String ("Event");
-         if (gh_equal_p (m->get_mus_property ("name") ,
+         if (gh_equal_p (m->get_property ("name") ,
                          gh_symbol2scm (nm.to_str0())))
            {
-             Direction d = to_dir (m->get_mus_property ("span-direction"));
+             Direction d = to_dir (m->get_property ("span-direction"));
              p->event_drul_[d] = m;
              return true;
            }
@@ -310,7 +299,7 @@ Piano_pedal_engraver::create_text_grobs (Pedal_info *p, bool mixed)
       String propname = String (p->name_) + "Pedal";
 
       p->item_ = make_item (propname.to_str0 ());
-      p->item_->set_grob_property ("text", s);
+      p->item_->set_property ("text", s);
       Axis_group_interface::add_element (p->line_spanner_, p->item_);
          
       announce_grob (p->item_,
@@ -352,14 +341,14 @@ Piano_pedal_engraver::create_bracket_grobs (Pedal_info *p, bool mixed)
        p->bracket_->set_bound (RIGHT, cmc);
 
       /*
-       Set properties so that the molecule-creating function will
+       Set properties so that the stencil-creating function will
        know whether the right edge should be flared ___/
        */
 
       if (!p->event_drul_[START])
        {
-         SCM flare = p->bracket_->get_grob_property ("bracket-flare");
-         p->bracket_->set_grob_property ("bracket-flare", scm_cons (gh_car (flare),
+         SCM flare = p->bracket_->get_property ("bracket-flare");
+         p->bracket_->set_property ("bracket-flare", scm_cons (gh_car (flare),
                                                                     gh_double2scm (0)));
        }
 
@@ -376,19 +365,19 @@ Piano_pedal_engraver::create_bracket_grobs (Pedal_info *p, bool mixed)
       p->bracket_  = make_spanner ("PianoPedalBracket");
 
       /*
-       Set properties so that the molecule-creating function will
+       Set properties so that the stencil-creating function will
        know whether the left edge should be flared \___
       */
 
       if (!p->finished_bracket_)
        {
-         SCM flare = p->bracket_->get_grob_property ("bracket-flare");
-         p->bracket_->set_grob_property ("bracket-flare", scm_cons (gh_double2scm (0),gh_cdr (flare)));
+         SCM flare = p->bracket_->get_property ("bracket-flare");
+         p->bracket_->set_property ("bracket-flare", scm_cons (gh_double2scm (0),gh_cdr (flare)));
        }
 
 
       /* Set this property for 'mixed style' pedals,    Ped._______/\ ,  
-        so the molecule function will shorten the ____ line by the length of the Ped. text.
+        so the stencil function will shorten the ____ line by the length of the Ped. text.
       */
 
       if (mixed)
@@ -403,7 +392,7 @@ Piano_pedal_engraver::create_bracket_grobs (Pedal_info *p, bool mixed)
            WTF is pedal-text not the bound of the object? --hwn
          */
          if (p->item_)
-           p->bracket_->set_grob_property ("pedal-text", p->item_->self_scm ());
+           p->bracket_->set_property ("pedal-text", p->item_->self_scm ());
        }
 
 
@@ -544,7 +533,6 @@ Piano_pedal_engraver::typeset_all ()
 
       if (p->finished_line_spanner_)
        {
-         Side_position_interface::add_staff_support (p->finished_line_spanner_);
          Grob * l = p->finished_line_spanner_->get_bound (LEFT);
          Grob * r = p->finished_line_spanner_->get_bound (RIGHT);      
          if (!r && l)
@@ -567,7 +555,7 @@ Piano_pedal_engraver::typeset_all ()
 ENTER_DESCRIPTION (Piano_pedal_engraver,
 /* descr */       "Engrave piano pedal symbols and brackets.",
 /* creats*/       "SostenutoPedal SustainPedal UnaCordaPedal SostenutoPedalLineSpanner SustainPedalLineSpanner UnaCordaPedalLineSpanner",
-/* accepts */     "pedal-event abort-event",
+/* accepts */     "pedal-event",
 /* acks  */       "note-column-interface",
 /* reads */       "pedalSostenutoStrings pedalSustainStrings pedalUnaCordaStrings pedalSostenutoStyle pedalSustainStyle pedalUnaCordaStyle",
 /* write */       "");