]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/piano-pedal-engraver.cc
* lily/paper-outputter.cc (output_expr):
[lilypond.git] / lily / piano-pedal-engraver.cc
index c4fab9af8736a11197da4fe7d468c64eaefb5bb1..b26d280600057a5530f7aa5ac19b5deaad846452 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;
            }
@@ -249,7 +238,7 @@ Piano_pedal_engraver::create_text_grobs (Pedal_info *p, bool mixed)
 
       String msg = _ ("Need 3 strings for piano pedals. No pedal made. ");
       if (m)
-       m->origin()->warning (msg);
+       m->origin ()->warning (msg);
       else
        warning (msg);
       
@@ -283,7 +272,7 @@ Piano_pedal_engraver::create_text_grobs (Pedal_info *p, bool mixed)
            {
              s = ly_caddr (strings);
              if (previous_.size ())
-               previous_.pop();
+               previous_.pop ();
            }
          p->start_ev_ = 0;
        }
@@ -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_,
@@ -340,8 +329,8 @@ Piano_pedal_engraver::create_bracket_grobs (Pedal_info *p, bool mixed)
     {
       if (!p->event_drul_[START])
        {
-         if (previous_.size())
-           previous_.pop();
+         if (previous_.size ())
+           previous_.pop ();
        }
       
       assert (!p->finished_bracket_); 
@@ -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 ());
        }
 
 
@@ -432,8 +421,8 @@ Piano_pedal_engraver::create_bracket_grobs (Pedal_info *p, bool mixed)
 
            // position new pedal spanner below the current one
          */
-         if (previous_.size()) 
-           Side_position_interface::add_support (p->line_spanner_, previous_.top());
+         if (previous_.size ()) 
+           Side_position_interface::add_support (p->line_spanner_, previous_.top ());
 
          previous_.push (p->line_spanner_);    
        }
@@ -452,7 +441,7 @@ Piano_pedal_engraver::finalize ()
        suicide?
        */
       if (p->line_spanner_
-         && !p->line_spanner_->live())
+         && !p->line_spanner_->live ())
        p->line_spanner_ = 0;
       
       if (p->line_spanner_)
@@ -461,7 +450,7 @@ Piano_pedal_engraver::finalize ()
          typeset_all ();
        }
       if (p->bracket_
-         && !p->bracket_->live())
+         && !p->bracket_->live ())
        p->bracket_ = 0;
       
       if (p->bracket_)
@@ -509,7 +498,7 @@ Piano_pedal_engraver::typeset_all ()
          && !p->finished_line_spanner_->live ())
        p->finished_line_spanner_ = 0;
       if (p->finished_bracket_
-         && !p->finished_bracket_->live())
+         && !p->finished_bracket_->live ())
        p->finished_bracket_ = 0;
 
 
@@ -566,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 */       "");