- if (num)
- {
- Grob * a = new Item (get_property ("Accidental"));
- a->set_parent (support, Y_AXIS);
-
- if (!accidental_placement_)
- {
- accidental_placement_ = new Item (get_property ("AccidentalPlacement"));
- announce_grob (accidental_placement_, a->self_scm());
- }
-
- Accidental_placement::add_accidental (accidental_placement_, a);
- announce_grob (a, SCM_EOL);
-
-
- SCM accs = gh_cons (scm_int2num (pitch->get_alteration ()), SCM_EOL);
- if (num == 2 && extra_natural_b)
- accs = gh_cons (scm_int2num (0), accs);
-
- /* TODO:
-
- add cautionary option in accidental.
- */
-
- if (cautionary)
- {
- a->set_grob_property ("cautionary", SCM_BOOL_T);
- }
-
- if (tie_break_reminder)
- {
- // TODO.
- a->set_grob_property ("tie", tie_break_reminder->self_scm());
- }
-
-
- support->set_grob_property ("accidental-grob", a->self_scm ());
-
- a->set_grob_property ("accidentals", accs);
- accidentals_[i].accidental_ = a;
- /*
- We add the accidentals to the support of the arpeggio, so it is put left of the
- accidentals.
-
- */
- for (int i = 0; i < left_objects_.size (); i++)
- Side_position_interface::add_support (left_objects_[i], a);
- for (int i = 0; i < right_objects_.size (); i++)
- Side_position_interface::add_support (a, right_objects_[i]);
- }
-
-
- /*
- We should not record the accidental if it is the first
- note and it is tied from the previous measure.
-
- Checking whether it is tied also works mostly, but will it
- always do the correct thing?
- */
-
-
- int n = pitch->get_notename ();
- int o = pitch->get_octave ();
- int a = pitch->get_alteration ();
- SCM on_s = gh_cons (scm_int2num (o), scm_int2num (n));
-
- /*
- TODO: Speed this up!
-
- Perhaps only check translators mentioned in the auto-accidentals?
- -rz
-
- TODO: profile this.
-
- I'd be surprised if the impact of this would be
- measurable. Anyway, it seems localsig doesn't change
- every time-step, but a set_property() is done every
- time. We could save on that, probably.
-
- --hwn.
-
-
- */
-
- while (origin)
- {
- SCM localsig = origin->get_property ("localKeySignature");
- if (tie_changes)
- {
- /*
- Remember an alteration that is different both from
- that of the tied note and of the key signature.
- */
- localsig = ly_assoc_front_x
- (localsig, on_s, gh_cons (SCM_BOOL_T, barnum));
- }
- else
- {
- /*
- not really really correct if there are more than one
- noteheads with the same notename.
- */
- localsig = ly_assoc_front_x
- (localsig, on_s, gh_cons (scm_int2num (a), barnum));
- }
- origin->set_property ("localKeySignature", localsig);
- origin = origin->daddy_trans_;
- }
- }
+ entry->accidental_ = a;
+}
+
+Grob *
+Accidental_engraver::make_standard_accidental (Stream_event *note,
+ Grob *note_head,
+ Engraver *trans,
+ bool cautionary)
+{
+ (void)note;
+
+ /*
+ We construct the accidentals at the originating Voice
+ level, so that we get the property settings for
+ Accidental from the respective Voice.
+ */
+ Grob *a = 0;
+ if (cautionary)
+ a = trans->make_item ("AccidentalCautionary", note_head->self_scm ());
+ else
+ a = trans->make_item ("Accidental", note_head->self_scm ());
+
+ /*
+ We add the accidentals to the support of the arpeggio,
+ so it is put left of the accidentals.
+ */
+ for (vsize i = 0; i < left_objects_.size (); i++)
+ {
+ if (left_objects_[i]->get_property ("side-axis") == scm_from_int (X_AXIS))
+ Side_position_interface::add_support (left_objects_[i], a);