]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/accidental-engraver.cc
Run `make grand-replace'.
[lilypond.git] / lily / accidental-engraver.cc
index 4d8fbc06a10a182579d77edc57ba89d2c07f1ee1..457fd734c4ce87442e83403718b67a2ca94174f5 100644 (file)
@@ -1,9 +1,9 @@
 /*
-  accidental-engraver.cc -- implement accidental_engraver
+  accidental-engraver.cc -- implement Accidental_engraver
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1997--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  (c) 1997--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>
   Modified 2001--2002 by Rune Zedeler <rz@daimi.au.dk>
 */
 
@@ -257,16 +257,16 @@ check_pitch_against_signature (SCM key_signature, Pitch const &pitch,
 // TODO: consider moving check_pitch_against_signature to SCM (in which case
 // we can delete this function).
 LY_DEFINE (ly_find_accidentals_simple, "ly:find-accidentals-simple", 5, 0, 0,
-          (SCM keysig, SCM pp, SCM barnum, SCM laziness, SCM octaveness ),
-          "Checks the need for an accidental and a 'restore' accidental against a"
-          " key signature.  The laziness is the number of bars for which reminder"
-          " accidentals are used (ie. if laziness is zero, we only cancel accidentals"
-          " in the same bar; if laziness is three, we cancel accidentals up to three"
-          " bars after they first appear.  Octaveness is either 'same-octave or"
-          " 'any-octave and it specifies whether accidentals should be canceled in"
-          " different octaves.")
+          (SCM keysig, SCM pitch_scm, SCM barnum, SCM laziness, SCM octaveness ),
+          "Checks the need for an accidental and a @q{restore} accidental against a"
+          " key signature.  The @var{laziness} is the number of bars for which reminder"
+          " accidentals are used (ie. if @var{laziness} is zero, we only cancel accidentals"
+          " in the same bar; if @var{laziness} is three, we cancel accidentals up to three"
+          " bars after they first appear.  @var{octaveness} is either"
+          " @code{'same-octave} or @code{'any-octave} and it specifies whether"
+          " accidentals should be canceled in different octaves.")
 {
-  LY_ASSERT_TYPE (unsmob_pitch, pp, 2);
+  LY_ASSERT_TYPE (unsmob_pitch, pitch_scm, 2);
   LY_ASSERT_TYPE (scm_is_integer, barnum, 3);
   LY_ASSERT_TYPE (ly_is_symbol, octaveness, 5);
 
@@ -275,7 +275,7 @@ LY_DEFINE (ly_find_accidentals_simple, "ly:find-accidentals-simple", 5, 0, 0,
 
   SCM_ASSERT_TYPE (symbol_ok, octaveness, SCM_ARG5, __FUNCTION__, "'any-octave or 'same-octave");
 
-  Pitch * pitch = unsmob_pitch (pp);
+  Pitch *pitch = unsmob_pitch (pitch_scm);
 
   int bar_number = scm_to_int (barnum);
   bool ignore_octave = ly_symbol2scm ("any-octave") == octaveness; 
@@ -512,14 +512,8 @@ Accidental_engraver::stop_translation_timestep ()
       Rational a = pitch->get_alteration ();
       SCM key = scm_cons (scm_from_int (o), scm_from_int (n));
 
-      Duration *dur = unsmob_duration (note->get_property ("duration"));
-      Rational dur_length = dur ? dur->get_length () : Rational (0);
-      Moment mp = robust_scm2moment (get_property ("measurePosition"), Moment (0));
-
-      Moment end_mp = mp.grace_part_ < Rational(0)
-       ? Moment(mp.main_part_, mp.grace_part_ + dur_length)
-       : Moment(mp.main_part_ + dur_length, 0);
-
+      Moment end_mp = measure_position (context (),
+                                       unsmob_duration (note->get_property ("duration")));
       SCM position = scm_cons (scm_from_int (barnum), end_mp.smobbed_copy ());
 
       SCM localsig = SCM_EOL;
@@ -642,6 +636,7 @@ ADD_TRANSLATOR (Accidental_engraver,
                /* create */
                "Accidental "
                "AccidentalCautionary "
+               "AccidentalPlacement "
                "AccidentalSuggestion ",
 
                /* read */