X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fambitus-engraver.cc;h=a84f9d65ec35b4d7d2d7855ef693049a332c76ca;hb=5e24aa455cac67a7e7b42a0539fcbd8c235417bf;hp=f50b651050756c7bc63ce61f6a4076a35854cbb9;hpb=e53b6ddc057f5419b4bc6219f0cf6132a487a305;p=lilypond.git diff --git a/lily/ambitus-engraver.cc b/lily/ambitus-engraver.cc index f50b651050..a84f9d65ec 100644 --- a/lily/ambitus-engraver.cc +++ b/lily/ambitus-engraver.cc @@ -3,17 +3,13 @@ source file of the GNU LilyPond music typesetter - (c) 2002--2004 Juergen Reuter - + (c) 2002--2005 Juergen Reuter + Han-Wen Nienhuys set_parent (heads_[d], Y_AXIS); - heads_[d]->set_property ("accidental-grob", accidentals_[d]->self_scm ()); + heads_[d]->set_property ("accidental-grob", + accidentals_[d]->self_scm ()); Axis_group_interface::add_element (group_, heads_[d]); Axis_group_interface::add_element (group_, accidentals_[d]); Side_position_interface::add_support (accidentals_[d], heads_[d]); } while (flip (&d) != DOWN); + ambitus_->set_parent (heads_[DOWN], X_AXIS); Axis_group_interface::add_element (group_, ambitus_); - - is_typeset_ = false; -} + is_typeset_ = false; +} Ambitus_engraver::Ambitus_engraver () { @@ -72,6 +76,7 @@ Ambitus_engraver::Ambitus_engraver () accidentals_[LEFT] = accidentals_[RIGHT] = 0; group_ = 0; is_typeset_ = false; + start_key_sig_ = SCM_EOL; } void @@ -103,7 +108,6 @@ Ambitus_engraver::stop_translation_timestep () start_c0_ = robust_scm2int (get_property ("middleCPosition"), 0); start_key_sig_ = get_property ("keySignature"); - is_typeset_ = true; } } @@ -111,10 +115,10 @@ Ambitus_engraver::stop_translation_timestep () void Ambitus_engraver::acknowledge_grob (Grob_info info) { - Item *item = dynamic_cast (info.grob_); + Item *item = dynamic_cast (info.grob ()); if (item) { - if (Note_head::has_interface (info.grob_)) + if (Note_head::has_interface (info.grob ())) { Music *nr = info.music_cause (); if (nr && nr->is_mus_type ("note-event")) @@ -136,8 +140,8 @@ Ambitus_engraver::finalize () { Pitch p = pitch_interval_[d]; heads_[d]->set_property ("staff-position", - scm_from_int (start_c0_ + - p.steps ())); + scm_from_int (start_c0_ + + p.steps ())); SCM handle = scm_assoc (scm_cons (scm_from_int (p.get_octave ()), scm_from_int (p.get_notename ())), @@ -146,17 +150,20 @@ Ambitus_engraver::finalize () if (handle == SCM_BOOL_F) handle = scm_assoc (scm_from_int (p.get_notename ()), start_key_sig_); + + int sig_alter = (handle != SCM_BOOL_F) + ? scm_to_int (scm_cdr (handle)) : 0; - int sig_alter = (handle != SCM_BOOL_F) ? scm_to_int (ly_cdr (handle)) : 0; if (sig_alter == p.get_alteration ()) { - accidentals_[d]->suicide(); + accidentals_[d]->suicide (); heads_[d]->set_property ("accidental-grob", SCM_EOL); } else { - accidentals_[d]->set_property ("accidentals", - scm_list_1 (scm_from_int (p.get_alteration ()))); + SCM l = scm_list_1 (scm_from_int (p.get_alteration ())); + accidentals_[d]->set_property ("accidentals", l); + } } while (flip (&d) != DOWN); @@ -169,18 +176,19 @@ Ambitus_engraver::finalize () Direction d = DOWN; do { - accidentals_[d]->suicide(); - heads_[d]->suicide(); - } + accidentals_[d]->suicide (); + heads_[d]->suicide (); + } while (flip (&d) != DOWN); - ambitus_->suicide(); + + ambitus_->suicide (); } } -ENTER_DESCRIPTION (Ambitus_engraver, -/* descr */ "", -/* creats*/ "Ambitus AmbitusLine AmbitusNoteHead AmbitusAccidental", -/* accepts */ "", -/* acks */ "note-head-interface", -/* reads */ "", -/* write */ ""); +ADD_TRANSLATOR (Ambitus_engraver, + /* descr */ "", + /* creats*/ "Ambitus AmbitusLine AmbitusNoteHead AmbitusAccidental", + /* accepts */ "", + /* acks */ "note-head-interface", + /* reads */ "", + /* write */ "");