]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/chord-tremolo-engraver.cc
Issue 4569: Keep \autochange from escaping an existing context hierarchy
[lilypond.git] / lily / chord-tremolo-engraver.cc
index f0ac33d25ab0f134a62e1ff0042bc04e35981170..95fdaeef9d41a84f30932b169a410356cce2bb7d 100644 (file)
@@ -1,8 +1,8 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 2000--2010 Han-Wen Nienhuys <hanwen@xs4all.nl>
-                Erik Sandberg <mandolaerik@gmail.com>
+  Copyright (C) 2000--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>
+                 Erik Sandberg <mandolaerik@gmail.com>
 
   LilyPond is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -34,6 +34,8 @@
 
 #include "translator.icc"
 
+using std::string;
+
 /**
 
 This acknowledges repeated music with "tremolo" style.  It typesets
@@ -118,9 +120,9 @@ Chord_tremolo_engraver::acknowledge_stem (Grob_info info)
   if (beam_)
     {
       int tremolo_type = robust_scm2int (repeat_->get_property ("tremolo-type"), 1);
-      int flags = max (0, intlog2 (tremolo_type) - 2);
+      int flags = std::max (0, intlog2 (tremolo_type) - 2);
       int repeat_count = robust_scm2int (repeat_->get_property ("repeat-count"), 1);
-      int gap_count = min (flags, intlog2 (repeat_count) + 1);
+      int gap_count = std::min (flags, intlog2 (repeat_count) + 1);
 
       Grob *s = info.grob ();
       if (previous_stem_)
@@ -142,17 +144,16 @@ Chord_tremolo_engraver::acknowledge_stem (Grob_info info)
       if (Stem::duration_log (s) != 1)
         beam_->set_property ("gap-count", scm_from_int (gap_count));
 
-
       if (info.ultimate_event_cause ()->in_event_class ("rhythmic-event"))
-       Beam::add_stem (beam_, s);
+        Beam::add_stem (beam_, s);
       else
-       {
-         string s = _ ("stem must have Rhythmic structure");
-         if (info.event_cause ())
-           info.event_cause ()->origin ()->warning (s);
-         else
-           ::warning (s);
-       }
+        {
+          string s = _ ("stem must have Rhythmic structure");
+          if (info.event_cause ())
+            info.event_cause ()->origin ()->warning (s);
+          else
+            ::warning (s);
+        }
       // Store current grob, so we can possibly end the spanner here (and
       // reset the beam direction to RIGHT)
       previous_stem_ = s;
@@ -161,15 +162,15 @@ Chord_tremolo_engraver::acknowledge_stem (Grob_info info)
 
 ADD_ACKNOWLEDGER (Chord_tremolo_engraver, stem);
 ADD_TRANSLATOR (Chord_tremolo_engraver,
-               /* doc */
-               "Generate beams for tremolo repeats.",
+                /* doc */
+                "Generate beams for tremolo repeats.",
 
-               /* create */
-               "Beam ",
+                /* create */
+                "Beam ",
 
-               /* read */
-               "",
+                /* read */
+                "",
 
-               /* write */
-               ""
-               );
+                /* write */
+                ""
+               );