]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/completion-rest-engraver.cc
Issue 4550 (2/2) Avoid "using namespace std;" in included files
[lilypond.git] / lily / completion-rest-engraver.cc
index 8700b6cceda7bda0d4ce26a6293042ebc55733bb..a60b400efce786fcf6c36de6958f8f61d42e2f82 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 1997--2014 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 1997--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>
                            Jan Nieuwenhuizen <janneke@gnu.org>
 
   LilyPond is free software: you can redistribute it and/or modify
@@ -19,7 +19,6 @@
 */
 
 #include <cctype>
-using namespace std;
 
 #include "dot-column.hh"
 #include "dots.hh"
@@ -40,6 +39,8 @@ using namespace std;
 
 #include "translator.icc"
 
+using std::vector;
+
 /*
   How does this work?
 
@@ -95,7 +96,7 @@ Completion_rest_engraver::listen_rest (Stream_event *ev)
   Moment now = now_mom ();
   Moment musiclen = get_event_length (ev, now);
 
-  rest_end_mom_ = max (rest_end_mom_, (now + musiclen));
+  rest_end_mom_ = std::max (rest_end_mom_, (now + musiclen));
   do_nothing_until_ = Rational (0, 0);
 }
 
@@ -105,15 +106,15 @@ Completion_rest_engraver::listen_rest (Stream_event *ev)
 Moment
 Completion_rest_engraver::next_moment (Rational const &note_len)
 {
-  Moment *e = Moment::unsmob (get_property ("measurePosition"));
-  Moment *l = Moment::unsmob (get_property ("measureLength"));
+  Moment *e = unsmob<Moment> (get_property ("measurePosition"));
+  Moment *l = unsmob<Moment> (get_property ("measureLength"));
   if (!e || !l || !to_boolean (get_property ("timing")))
     {
       return Moment (0, 0);
     }
 
   Moment result = *l - *e;
-  Moment const *unit = Moment::unsmob (get_property ("completionUnit"));
+  Moment const *unit = unsmob<Moment> (get_property ("completionUnit"));
 
   if (unit)
     {
@@ -152,7 +153,7 @@ Item *
 Completion_rest_engraver::make_rest (Stream_event *ev)
 {
   Item *rest = make_item ("Rest", ev->self_scm ());
-  if (Pitch *p = Pitch::unsmob (ev->get_property ("pitch")))
+  if (Pitch *p = unsmob<Pitch> (ev->get_property ("pitch")))
     {
       int pos = p->steps ();
       SCM c0 = get_property ("middleCPosition");
@@ -188,7 +189,7 @@ Completion_rest_engraver::process_music ()
     }
   else
     {
-      orig = Duration::unsmob (rest_events_[0]->get_property ("duration"));
+      orig = unsmob<Duration> (rest_events_[0]->get_property ("duration"));
       rest_dur = *orig;
       SCM factor = get_property ("completionFactor");
       if (ly_is_procedure (factor))