]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/ottava-engraver.cc
Imported Upstream version 2.16.0
[lilypond.git] / lily / ottava-engraver.cc
index fd59b33b8e83a7e158d1420ff149342c58fad534..bd39702bdb59da5c14ef516551455c8f9ce57673 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 2000--2011 Han-Wen Nienhuys
+  Copyright (C) 2000--2012 Han-Wen Nienhuys
 
   LilyPond is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -25,7 +25,6 @@
 #include "spanner.hh"
 #include "text-interface.hh"
 
-
 class Ottava_spanner_engraver : public Engraver
 {
 public:
@@ -69,14 +68,14 @@ Ottava_spanner_engraver::process_music ()
       finished_ = span_;
       span_ = 0;
       if (Text_interface::is_markup (ott))
-       {
-         span_ = make_spanner ("OttavaBracket", SCM_EOL);
-         span_->set_property ("text", ott);
-
-         SCM offset (get_property ("middleCOffset"));
-         if (robust_scm2double (offset, 0) > 0)
-           span_->set_property ("direction", scm_from_int (DOWN));
-       }
+        {
+          span_ = make_spanner ("OttavaBracket", SCM_EOL);
+          span_->set_property ("text", ott);
+
+          SCM offset (get_property ("middleCOffset"));
+          if (robust_scm2double (offset, 0) > 0)
+            span_->set_property ("direction", scm_from_int (DOWN));
+        }
     }
   last_ottavation_ = ott;
 }
@@ -90,7 +89,7 @@ Ottava_spanner_engraver::acknowledge_note_column (Grob_info info)
       Side_position_interface::add_support (span_, it);
 
       if (!span_->get_bound (LEFT))
-       span_->set_bound (LEFT, it);
+        span_->set_bound (LEFT, it);
       span_->set_bound (RIGHT, it);
     }
 }
@@ -100,16 +99,14 @@ Ottava_spanner_engraver::typeset_all ()
 {
   if (finished_)
     {
-      Direction d = LEFT;
-      do
-       {
-         if (!finished_->get_bound (RIGHT))
-           {
-             Grob *e = unsmob_grob (get_property ("currentMusicalColumn"));
-             finished_->set_bound (d, e);
-           }
-       }
-      while (flip (&d) != LEFT);
+      for (LEFT_and_RIGHT (d))
+        {
+          if (!finished_->get_bound (RIGHT))
+            {
+              Grob *e = unsmob_grob (get_property ("currentMusicalColumn"));
+              finished_->set_bound (d, e);
+            }
+        }
 
       finished_ = 0;
     }
@@ -142,17 +139,17 @@ Ottava_spanner_engraver::finalize ()
 ADD_ACKNOWLEDGER (Ottava_spanner_engraver, note_column);
 
 ADD_TRANSLATOR (Ottava_spanner_engraver,
-               /* doc */
-               "Create a text spanner when the ottavation property changes.",
-
-               /* create */
-               "OttavaBracket ",
-
-               /* read */
-               "middleCOffset "
-               "ottavation "
-               "currentMusicalColumn ",
-               
-               /* write */
-               ""
-               );
+                /* doc */
+                "Create a text spanner when the ottavation property changes.",
+
+                /* create */
+                "OttavaBracket ",
+
+                /* read */
+                "middleCOffset "
+                "ottavation "
+                "currentMusicalColumn ",
+
+                /* write */
+                ""
+               );