/*
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>
Modified 2001--2002 by Rune Zedeler <rz@daimi.au.dk>
LilyPond is free software: you can redistribute it and/or modify
in grobs should always store ly_deep_copy ()s of those.
*/
-Accidental_engraver::Accidental_engraver ()
+Accidental_engraver::Accidental_engraver (Context *c)
+ : Engraver (c)
{
accidental_placement_ = 0;
last_keysig_ = SCM_EOL;
*/
else if (scm_is_symbol (rule))
{
- Context *dad = origin;
- while (dad && !dad->is_alias (rule))
- dad = dad->get_parent_context ();
-
+ Context *dad = find_context_above (origin, rule);
if (dad)
origin = dad;
}
Stream_event *note = accidentals_[i].melodic_;
Context *origin = accidentals_[i].origin_;
- Pitch *pitch = Pitch::unsmob (note->get_property ("pitch"));
+ Pitch *pitch = unsmob<Pitch> (note->get_property ("pitch"));
if (!pitch)
continue;
*/
for (vsize i = 0; i < left_objects_.size (); i++)
{
- if (left_objects_[i]->get_property ("side-axis") == scm_from_int (X_AXIS))
+ if (ly_is_equal (left_objects_[i]->get_property ("side-axis"), scm_from_int (X_AXIS)))
Side_position_interface::add_support (left_objects_[i], a);
}
Accidental_placement::add_accidental
(accidental_placement_, a,
- get_property ("accidentalGrouping") == ly_symbol2scm ("voice"),
+ scm_is_eq (get_property ("accidentalGrouping"), ly_symbol2scm ("voice")),
(long) trans);
note_head->set_object ("accidental-grob", a->self_scm ());
Grob *a = trans->make_item ("AccidentalSuggestion", note_head->self_scm ());
Side_position_interface::add_support (a, note_head);
- if (Grob *stem = Grob::unsmob (a->get_object ("stem")))
+ if (Grob *stem = unsmob<Grob> (a->get_object ("stem")))
Side_position_interface::add_support (a, stem);
a->set_parent (note_head, X_AXIS);
{
// Don't mark accidentals as "tied" when the pitch is not
// actually the same. This is relevant for enharmonic ties.
- Stream_event *le = Stream_event::unsmob (l->get_property ("cause"));
- Stream_event *re = Stream_event::unsmob (r->get_property ("cause"));
+ Stream_event *le = unsmob<Stream_event> (l->get_property ("cause"));
+ Stream_event *re = unsmob<Stream_event> (r->get_property ("cause"));
if (le && re
&& !ly_is_equal (le->get_property ("pitch"), re->get_property ("pitch")))
continue;
int barnum = measure_number (origin);
- Pitch *pitch = Pitch::unsmob (note->get_property ("pitch"));
+ Pitch *pitch = unsmob<Pitch> (note->get_property ("pitch"));
if (!pitch)
continue;
SCM key = scm_cons (scm_from_int (o), scm_from_int (n));
Moment end_mp = measure_position (context (),
- Duration::unsmob (note->get_property ("duration")));
+ unsmob<Duration> (note->get_property ("duration")));
SCM position = scm_cons (scm_from_int (barnum), end_mp.smobbed_copy ());
SCM localsig = SCM_EOL;
|| note->in_event_class ("trill-span-event"))
// option to skip accidentals on string harmonics
&& (to_boolean (get_property ("harmonicAccidentals"))
- || info.grob ()->get_property ("style") != ly_symbol2scm ("harmonic"))
+ || !scm_is_eq (info.grob ()->get_property ("style"),
+ ly_symbol2scm ("harmonic")))
// ignore accidentals in non-printing voices like NullVoice
&& !to_boolean (info.context ()->get_property ("nullAccidentals")))
{
Accidental_engraver::process_music ()
{
SCM sig = get_property ("keyAlterations");
- if (last_keysig_ != sig)
+ if (!scm_is_eq (last_keysig_, sig))
update_local_key_signature (sig);
}
-ADD_ACKNOWLEDGER (Accidental_engraver, arpeggio);
-ADD_ACKNOWLEDGER (Accidental_engraver, finger);
-ADD_ACKNOWLEDGER (Accidental_engraver, rhythmic_head);
-ADD_END_ACKNOWLEDGER (Accidental_engraver, tie);
-ADD_ACKNOWLEDGER (Accidental_engraver, note_column);
+
+void
+Accidental_engraver::boot ()
+{
+ ADD_ACKNOWLEDGER (Accidental_engraver, arpeggio);
+ ADD_ACKNOWLEDGER (Accidental_engraver, finger);
+ ADD_ACKNOWLEDGER (Accidental_engraver, rhythmic_head);
+ ADD_END_ACKNOWLEDGER (Accidental_engraver, tie);
+ ADD_ACKNOWLEDGER (Accidental_engraver, note_column);
+}
ADD_TRANSLATOR (Accidental_engraver,
/* doc */