]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/multi-measure-rest-engraver.cc
Docs-fr: fix PDF docs build
[lilypond.git] / lily / multi-measure-rest-engraver.cc
index 20199593994f1ba0c0386daf56cce529c6af20aa..39f9e1e063ee0c4da7296d7fd364bbefc8ff16fe 100644 (file)
@@ -1,8 +1,21 @@
 /*
-  multi_measure_rest-engraver.cc -- implement Multi_measure_rest_engraver
+  This file is part of LilyPond, the GNU music typesetter.
 
-  (c) 1998--2006 Jan Nieuwenhuizen <janneke@gnu.org>
+  Copyright (C) 1998--2010 Jan Nieuwenhuizen <janneke@gnu.org>
   Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+  LilyPond is free software: you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation, either version 3 of the License, or
+  (at your option) any later version.
+
+  LilyPond is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #include "multi-measure-rest.hh"
@@ -12,6 +25,7 @@
 #include "staff-symbol-referencer.hh"
 #include "stream-event.hh"
 #include "moment.hh"
+#include "spanner.hh"
 
 #include "translator.icc"
 
@@ -68,7 +82,7 @@ Multi_measure_rest_engraver::listen_multi_measure_rest (Stream_event *ev)
   /* FIXME: Should use ASSIGN_EVENT_ONCE. Can't do that yet because of
      the kill-mm-rests hack in part-combine-iterator. */
   rest_ev_ = ev;
-  stop_moment_ = now_mom () + get_event_length (rest_ev_);
+  stop_moment_ = now_mom () + get_event_length (rest_ev_, now_mom ());
   /*
   if (ASSIGN_EVENT_ONCE (rest_ev_, ev))
     stop_moment_ = now_mom () + get_event_length (rest_ev_);
@@ -137,7 +151,7 @@ Multi_measure_rest_engraver::process_music ()
        }
 
       start_measure_
-       = scm_to_int (get_property ("currentBarNumber"));
+       = scm_to_int (get_property ("internalBarNumber"));
     }
 
   bar_seen_ = bar_seen_ || scm_is_string (get_property ("whichBar"));
@@ -147,12 +161,13 @@ void
 Multi_measure_rest_engraver::stop_translation_timestep ()
 {
   /* We cannot do this earlier, as breakableSeparationItem is not yet
-     there.  */
+     there.
+
+     Actually, we no longer use breakableSeparationItem -- should this be moved?
+     -- jneem */
   if (bar_seen_)
     {
-      Grob *cmc = unsmob_grob (get_property ("breakableSeparationItem"));
-      if (!cmc)
-       cmc = unsmob_grob (get_property ("currentCommandColumn"));
+      Grob *cmc = unsmob_grob (get_property ("currentCommandColumn"));
 
       /* Ugh, this is a kludge - need this for multi-measure-rest-grace.ly  */
       last_command_item_ = dynamic_cast<Item *> (cmc);
@@ -204,7 +219,7 @@ Multi_measure_rest_engraver::start_translation_timestep ()
       last_rest_ = mmrest_;
       last_numbers_ = numbers_;
 
-      int cur = scm_to_int (get_property ("currentBarNumber"));
+      int cur = scm_to_int (get_property ("internalBarNumber"));
       int num = cur - start_measure_;
 
       /*
@@ -250,17 +265,25 @@ Multi_measure_rest_engraver::finalize ()
 
 ADD_TRANSLATOR (Multi_measure_rest_engraver,
                /* doc */
-               "Engraves multi-measure rests that are produced with @code{R}.  Reads "
-               "measurePosition and currentBarNumber to determine what number to print "
-               "over the MultiMeasureRest.  Reads measureLength to determine if it "
-               "should use a whole rest or a breve rest to represent 1 measure ",
-               /* create */ "MultiMeasureRest MultiMeasureRestNumber MultiMeasureRestText",
-               /* accept */ "multi-measure-rest-event multi-measure-text-event",
+               "Engrave multi-measure rests that are produced with"
+               " @samp{R}.  It reads @code{measurePosition} and"
+               " @code{internalBarNumber} to determine what number to print"
+               " over the @ref{MultiMeasureRest}.  Reads @code{measureLength}"
+               " to determine whether it should use a whole rest or a breve"
+               " rest to represent one measure.",
+               
+               /* create */
+               "MultiMeasureRest "
+               "MultiMeasureRestNumber "
+               "MultiMeasureRestText ",
+
                /* read */
-               "currentBarNumber "
+               "internalBarNumber "
                "restNumberThreshold "
-               "breakableSeparationItem "
                "currentCommandColumn "
                "measurePosition "
-               "measureLength",
-               /* write */ "");
+               "measureLength ",
+               
+               /* write */
+               ""
+               );