From 3a16b35654806d3c44566ee989d64084395536be Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Mon, 18 Sep 2000 22:59:58 +0200 Subject: [PATCH] patch::: 1.3.87.jcn1 1.3.87.jcn1 =========== * Made bugfix in Simple-music-iterator copy constructor. * Fixed get_music for sequential-music-iterator and request-chord-iterator. 1.3.87 ====== --- CHANGES | 11 +++++++++++ VERSION | 2 +- lily/request-chord-iterator.cc | 7 +++++-- lily/sequential-music-iterator.cc | 22 ++++++++++++++-------- lily/simple-music-iterator.cc | 3 ++- 5 files changed, 33 insertions(+), 12 deletions(-) diff --git a/CHANGES b/CHANGES index fe8475f59d..243f56c9aa 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,14 @@ +1.3.87.jcn1 +=========== + +* Made bugfix in Simple-music-iterator copy constructor. + +* Fixed get_music for sequential-music-iterator and request-chord-iterator. + + +1.3.87 +====== + 1.3.86.jcn2 ================ diff --git a/VERSION b/VERSION index 1da5d29c99..f9581647fb 100644 --- a/VERSION +++ b/VERSION @@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=3 PATCH_LEVEL=87 -MY_PATCH_LEVEL= +MY_PATCH_LEVEL=jcn1 # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/lily/request-chord-iterator.cc b/lily/request-chord-iterator.cc index f463190a34..86ab37eaf3 100644 --- a/lily/request-chord-iterator.cc +++ b/lily/request-chord-iterator.cc @@ -45,10 +45,12 @@ Request_chord_iterator::elt_l () const return (Request_chord*) music_l_; } - SCM -Request_chord_iterator::get_music (Moment)const +Request_chord_iterator::get_music (Moment m) const { + Request_chord_iterator* urg = (Request_chord_iterator*)this; + urg->last_processed_mom_ = m; + urg->last_processed_mom_.set_infinite (1); SCM s = SCM_EOL; if (music_l_) { @@ -58,6 +60,7 @@ Request_chord_iterator::get_music (Moment)const { s = gh_cons (gh_car (m) , s); } + urg->music_l_ = 0; } return s; } diff --git a/lily/sequential-music-iterator.cc b/lily/sequential-music-iterator.cc index 8218251942..82051844b4 100644 --- a/lily/sequential-music-iterator.cc +++ b/lily/sequential-music-iterator.cc @@ -92,37 +92,43 @@ Sequential_music_iterator::set_sequential_music_translator() SCM Sequential_music_iterator::get_music (Moment until)const { -#if 0 +#if 1 /* FIXME: get_music () is const, so we must operate on a copy of child-iter. + + hmm, part-combiner does work on a copy; why copy again? + Also, simply `working on a copy' doesn't work: if request-chord's + get_music doesn't do next (), we'll stay in this loop forever? */ + Sequential_music_iterator* urg = (Sequential_music_iterator*)this; SCM s = SCM_EOL; while (1) { Moment local_until = until - here_mom_; - while (iter_p_->ok ()) + while (urg->iter_p_->ok ()) { Moment here = iter_p_->pending_moment (); if (here != local_until) return s; - s = gh_append2 (iter_p_->get_music (local_until), s); + s = gh_append2 (urg->iter_p_->get_music (local_until), s); } - if (!iter_p_->ok ()) + if (!urg->iter_p_->ok ()) { - // leave_element (); + urg->leave_element (); - if (gh_pair_p (cursor_)) - start_next_element (); + if (gh_pair_p (urg->cursor_)) + urg->start_next_element (); else return s; } } return s; -#endif +#else return SCM_EOL; +#endif } void diff --git a/lily/simple-music-iterator.cc b/lily/simple-music-iterator.cc index a25147d4e9..e919d4b5a0 100644 --- a/lily/simple-music-iterator.cc +++ b/lily/simple-music-iterator.cc @@ -20,7 +20,8 @@ Simple_music_iterator::Simple_music_iterator () Simple_music_iterator::Simple_music_iterator (Simple_music_iterator const &src) : Music_iterator (src) { - last_processed_mom_ = -1; + last_processed_mom_ = src.last_processed_mom_; + length_mom_ = src.length_mom_; } void -- 2.39.2