]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/accidental-engraver.cc
* lily/multi-measure-rest-engraver.cc: use internalBarNumber
[lilypond.git] / lily / accidental-engraver.cc
index f6ea8e0e18a1bea149d3e3ab874df1404571af24..3bd03fb69719c684e598189a7a8675bf47a51f6c 100644 (file)
@@ -289,7 +289,7 @@ number_accidentals (bool *different,
 int
 Accidental_engraver::get_bar_number ()
 {
-  SCM barnum = get_property ("currentBarNumber");
+  SCM barnum = get_property ("internalBarNumber");
   SCM smp = get_property ("measurePosition");
 
   int bn = robust_scm2int (barnum, 0);
@@ -333,8 +333,8 @@ Accidental_engraver::process_acknowledged ()
                                             pitch, origin,
                                             cautionaries, barnum);
 
-         bool cautionary = to_boolean (note->get_property ("cautionary"));
 
+         bool cautionary = to_boolean (note->get_property ("cautionary"));
          if (num_caut > num)
            {
              num = num_caut;
@@ -342,7 +342,8 @@ Accidental_engraver::process_acknowledged ()
              cautionary = true;
            }
 
-         if (num == 0 && to_boolean (note->get_property ("force-accidental")))
+         bool forced = to_boolean (note->get_property ("force-accidental"));
+         if (num == 0 && forced)
            num = 1;
 
          /* Cannot look for ties: it's not guaranteed that they reach
@@ -350,6 +351,10 @@ Accidental_engraver::process_acknowledged ()
          if (num
              && !note->in_event_class ("trill-span-event"))
            create_accidental (&accidentals_[i], num > 1, cautionary);
+
+
+         if (forced || cautionary)
+           accidentals_[i].accidental_->set_property ("forced", SCM_BOOL_T);
        }
     }
 }
@@ -398,11 +403,7 @@ Accidental_engraver::make_standard_accidental (Stream_event *note,
     level, so that we get the property settings for
     Accidental from the respective Voice.
   */
-  Grob *a
-    = make_grob_from_properties (trans,
-                                ly_symbol2scm ("Accidental"),
-                                note_head->self_scm (),
-                                "Accidental");
+  Grob *a = trans->make_item ("Accidental", note_head->self_scm ());
 
   /*
     We add the accidentals to the support of the arpeggio,
@@ -438,11 +439,7 @@ Accidental_engraver::make_suggested_accidental (Stream_event *note,
                                                Engraver *trans)
 {
   (void) note;
-  Grob *a
-    = make_grob_from_properties (trans,
-                                ly_symbol2scm ("AccidentalSuggestion"),
-                                note_head->self_scm (),
-                                "AccidentalSuggestion");
+  Grob *a = trans->make_item ("AccidentalSuggestion", note_head->self_scm ());
 
   Side_position_interface::add_support (a, note_head);
   if (Grob *stem = unsmob_grob (a->get_object ("stem")))
@@ -606,6 +603,7 @@ ADD_TRANSLATOR (Accidental_engraver,
 
                "autoAccidentals "
                "autoCautionaries "
+               "internalBarNumber "
                "extraNatural "
                "harmonicAccidentals "
                "localKeySignature",