/*
new-accidental-engraver.cc -- implement new_accidental_engraver
- (c) 1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
- Modified 2001--2002 by Rune Zedeler <rz@daimi.au.dk>
+ (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ Modified 2001--2004 by Rune Zedeler <rz@daimi.au.dk>
This is an experimental file - producing correct accidentals but
unfortunately ruining the spacing. -rz
virtual void process_music ();
virtual void acknowledge_grob (Grob_info);
virtual void stop_translation_timestep ();
- virtual void initialize ();
virtual void process_acknowledged_grobs ();
virtual void finalize ();
virtual void process_grobs_first_pass ();
New_accidental_engraver::New_accidental_engraver ()
{
+ last_keysig_ = SCM_BOOL_F;
accidental_placement_ = 0;
- last_keysig_ = SCM_EOL;
}
/* inserts the source alist into the destination alist, erasing old entries.
}
}
-void
-New_accidental_engraver::initialize ()
-{
- // to ensure that process_music will initialize last_keysig_
- last_keysig_ = SCM_BOOL_F;
-}
-
/*
calculates the number of accidentals on basis of the current local key sig
(passed as argument)
number_accidentals (SCM sig, Music * note, Pitch *pitch, SCM curbarnum, SCM lazyness,
bool ignore_octave_b)
{
- int n = pitch->notename_;
- int o = pitch->octave_;
- int a = pitch->alteration_;
+ int n = pitch->get_notename ();
+ int o = pitch->get_octave ();
+ int a = pitch->get_alteration ();
int curbarnum_i = gh_scm2int (curbarnum);
int accbarnum_i = 0;
if (ignore_octave_b)
prev = ly_assoc_cdr (gh_int2scm (n), sig);
else
- prev = gh_assoc (gh_cons (gh_int2scm (o), gh_int2scm (n)), sig);
+ prev = scm_assoc (gh_cons (gh_int2scm (o), gh_int2scm (n)), sig);
/* should really be true unless prev == SCM_BOOL_F */
if (gh_pair_p (prev) && gh_pair_p (ly_cdr (prev)))
/* If an accidental was not found or the accidental was too old */
if (prev == SCM_BOOL_F ||
(gh_number_p (lazyness) && curbarnum_i > accbarnum_i + gh_scm2int (lazyness)))
- prev = gh_assoc (gh_int2scm (n), sig);
+ prev = scm_assoc (gh_int2scm (n), sig);
SCM prev_acc = (prev == SCM_BOOL_F) ? gh_int2scm (0) : ly_cdr (prev);
*/
else if (gh_symbol_p (ly_car (accidentals)))
{
- String context = ly_symbol2string (ly_car (accidentals));
+ SCM context = ly_car (accidentals);
- while (origin && !origin->is_alias_b (context))
+ while (origin && !origin->is_alias (context))
origin = origin->daddy_trans_;
if (!origin)
warning (_f ("Symbol is not a parent context: %s. Ignored",
- context.to_str0 ()));
+ ly_symbol2string (context).to_str0 ()));
}
else warning (_f ("Accidental typesetting must be pair or context-name: %s",
ly_scm2string (ly_car (accidentals)).to_str0 ()));
for (int j = 0; j < ties_.size (); j++)
if (support == Tie::head (ties_[j], RIGHT))
tie_changes = accidentals_[i].different_;
- int n = pitch->notename_;
- int o = pitch->octave_;
- int a = pitch->alteration_;
+ int n = pitch->get_notename ();
+ int o = pitch->get_octave ();
+ int a = pitch->get_alteration ();
SCM o_s = gh_int2scm (o);
SCM n_s = gh_int2scm (n);
SCM on_s = gh_cons (o_s,n_s);
if (num)
{
- Grob * a = new Item (get_property ("Accidental"));
+ Grob * a = make_item ("Accidental");
a->set_parent (support, Y_AXIS);
if (!accidental_placement_)
{
- accidental_placement_ = new Item (get_property ("AccidentalPlacement"));
+ accidental_placement_ = make_item ("AccidentalPlacement");
announce_grob (accidental_placement_, a->self_scm());
}
announce_grob (a, SCM_EOL);
- SCM accs = gh_cons (gh_int2scm (pitch->alteration_), SCM_EOL);
+ SCM accs = gh_cons (gh_int2scm (pitch->get_alteration ()), SCM_EOL);
if (num == 2 && extra_natural_b)
accs = gh_cons (gh_int2scm (0), accs);