From 7f04d3df57ba78924680fc53c900e99c839ffbcd Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 27 Mar 2002 02:03:18 +0000 Subject: [PATCH] lilypond-1.5.15 --- Documentation/footer.html.in | 2 +- lily/auto-beam-engraver.cc | 3 ++- lily/beam-engraver.cc | 5 +++-- lily/beaming-info.cc | 26 +++++++++++++++++--------- lily/include/beaming.hh | 5 ++--- lily/scm-hash.cc | 6 +++--- lily/translator.cc | 2 +- 7 files changed, 29 insertions(+), 20 deletions(-) diff --git a/Documentation/footer.html.in b/Documentation/footer.html.in index 8a96551d0c..cfb235d277 100644 --- a/Documentation/footer.html.in +++ b/Documentation/footer.html.in @@ -24,7 +24,7 @@ Please send GNU LilyPond questions and comments to

Please send comments on these web pages to -@MAIL_ADDRESS@ +@MAILADDRESS@

diff --git a/lily/auto-beam-engraver.cc b/lily/auto-beam-engraver.cc index 97451c6a4e..2044f88500 100644 --- a/lily/auto-beam-engraver.cc +++ b/lily/auto-beam-engraver.cc @@ -291,7 +291,8 @@ Auto_beam_engraver::typeset_beam () { if (finished_beam_p_) { - finished_grouping_p_->beamify (); + finished_grouping_p_->beamify(*unsmob_moment (get_property ("beatLength")), + (bool)gh_scm2bool(get_property("subdivideBeams"))); Beam::set_beaming (finished_beam_p_, finished_grouping_p_); typeset_grob (finished_beam_p_); finished_beam_p_ = 0; diff --git a/lily/beam-engraver.cc b/lily/beam-engraver.cc index a927a75f05..b9e7eb63fe 100644 --- a/lily/beam-engraver.cc +++ b/lily/beam-engraver.cc @@ -181,8 +181,9 @@ Beam_engraver::typeset_beam () { if (finished_beam_p_) { - finished_beam_info_p_->beamify (); - + finished_beam_info_p_->beamify(*unsmob_moment (get_property ("beatLength")), + (bool)gh_scm2bool(get_property("subdivideBeams"))); + Beam::set_beaming (finished_beam_p_, finished_beam_info_p_); typeset_grob (finished_beam_p_); delete finished_beam_info_p_; diff --git a/lily/beaming-info.cc b/lily/beaming-info.cc index 97071ee65e..9eaed37763 100644 --- a/lily/beaming-info.cc +++ b/lily/beaming-info.cc @@ -24,23 +24,29 @@ Beaming_info::Beaming_info (Moment m, int i) } const int infinity_i = INT_MAX; // guh. +const int at_beat = 1<<15; int -Beaming_info_list::min_denominator_index () const +Beaming_info_list::best_splitpoint_index (Moment &beat_length,bool subdivide) const { int minden = infinity_i; int minidx = -1; + Moment beat_pos; for (int i=1; i < infos_.size (); i++) { - if (infos_[i].start_mom_.den () < minden) + beat_pos = infos_[i].start_mom_ / beat_length; + int den = beat_pos.den (); + if (infos_[i].beams_i_drul_[LEFT] == infos_[i-1].beams_i_drul_[RIGHT] && !subdivide) + den *= 4; + if (den < minden) { minidx = i; - minden = infos_[i].start_mom_.den (); + minden = den; } } - return minidx; + return minidx|(minden==1 && subdivide ? at_beat : 0); } int @@ -56,13 +62,14 @@ Beaming_info_list::beam_extend_count (Direction d) const } void -Beaming_info_list::beamify () +Beaming_info_list::beamify (Moment &beat_length,bool subdivide) { if (infos_.size () <= 1) return; Drul_array splits; - int m = min_denominator_index (); + int m = best_splitpoint_index (beat_length,subdivide); + bool split = subdivide && (m & at_beat); m = m & ~at_beat; splits[LEFT].infos_ = infos_.slice (0,m); splits[RIGHT].infos_ = infos_.slice (m, infos_.size ()); @@ -70,12 +77,13 @@ Beaming_info_list::beamify () do { - splits[d].beamify (); + splits[d].beamify (beat_length,subdivide); } while (flip (&d) != LEFT); - int middle_beams = splits[RIGHT].beam_extend_count (LEFT) infos_; int beam_extend_count (Direction) const; - int min_denominator_index () const; - void beamify (); + int best_splitpoint_index (Moment &beat_length,bool subdivide) const; + void beamify (Moment &beat_length,bool subdivide); void add_stem (Moment d, int beams); }; #endif /* BEAMING_HH */ - diff --git a/lily/scm-hash.cc b/lily/scm-hash.cc index b8bc8d8d03..7eeb67188b 100644 --- a/lily/scm-hash.cc +++ b/lily/scm-hash.cc @@ -14,7 +14,7 @@ void copy_scm_hashes (SCM dest, SCM src) { - for (int i = SCM_LENGTH(src); i--;) + for (int i = SCM_SYMBOL_LENGTH (src); i--;) for (SCM s = scm_vector_ref (src, SCM_MAKINUM (i)); ly_pair_p(s); s = ly_cdr (s)) { scm_hashq_set_x (dest, ly_caar (s), ly_cdar (s)); @@ -108,7 +108,7 @@ Scheme_hash_table::set (SCM k, SCM v) /* resize if getting too large. */ - if (elt_count_ > 2 * SCM_LENGTH (hash_tab_)) + if (elt_count_ > 2 * SCM_SYMBOL_LENGTH (hash_tab_)) { SCM nh = scm_make_vector (gh_int2scm (3* elt_count_+1), SCM_EOL); copy_scm_hashes (nh, hash_tab_); @@ -142,7 +142,7 @@ SCM Scheme_hash_table::to_alist () const { SCM l = SCM_EOL; - for (int i = SCM_LENGTH(hash_tab_); i--;) + for (int i = SCM_SYMBOL_LENGTH (hash_tab_); i--;) for (SCM s = scm_vector_ref (hash_tab_, gh_int2scm (i)); ly_pair_p(s); s = ly_cdr (s)) { l = scm_acons (ly_caar (s), ly_cdar (s), l); diff --git a/lily/translator.cc b/lily/translator.cc index 6820044530..fd9f367df6 100644 --- a/lily/translator.cc +++ b/lily/translator.cc @@ -160,7 +160,7 @@ Translator::name (SCM trans) if (unsmob_translator (trans)) { char const* nm = classname (unsmob_translator (trans)); - return gh_str02scm (nm); + return ly_str02scm (nm); } return SCM_EOL; -- 2.39.5