From c20deb0c0e5bb6db1552dfb155d286a82d4288ca Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 27 Mar 2002 02:07:32 +0000 Subject: [PATCH] lilypond-1.5.11 --- midi2ly/duration-iter.cc | 107 ------------------------------- midi2ly/include/duration-iter.hh | 39 ----------- 2 files changed, 146 deletions(-) delete mode 100644 midi2ly/duration-iter.cc delete mode 100644 midi2ly/include/duration-iter.hh diff --git a/midi2ly/duration-iter.cc b/midi2ly/duration-iter.cc deleted file mode 100644 index 12c2fa832b..0000000000 --- a/midi2ly/duration-iter.cc +++ /dev/null @@ -1,107 +0,0 @@ -/* - duration-convert.cc -- implement Duration_convert - - source file of the LilyPond music typesetter - - (c) 1997--2001 Han-Wen Nienhuys - Jan Nieuwenhuizen -*/ -#include -#include "duration-convert.hh" -#include "warn.hh" -#include "duration-iter.hh" - -Duration_iterator::Duration_iterator () -{ - cursor_dur_.durlog_i_ = 7; - if (Duration_convert::no_smaller_than_i_s) - cursor_dur_.durlog_i_ = Duration_convert::no_smaller_than_i_s; -} - -Duration -Duration_iterator::operator ++(int) -{ - return forward_dur (); -} - -Duration -Duration_iterator::dur () -{ - return cursor_dur_; -} - -Duration -Duration_iterator::forward_dur () -{ - /* should do smart table? guessing: - duration wholes - 16 0.0625 - 32.. 0.0703 - 8:2/3 0.0833 - 16. 0.0938 - 8 0.1250 - 16.. 0.1406 - 4:2/3 0.1667 - 8. 0.1875 - - */ - assert (ok ()); - - Duration dur = this->dur (); - - if (!cursor_dur_.dots_i_ && !cursor_dur_.plet_b ()) - { - cursor_dur_.durlog_i_ += 1; - cursor_dur_.dots_i_ = 2; - } - else if (cursor_dur_.dots_i_ == 2) - { - assert (!cursor_dur_.plet_b ()); - cursor_dur_.dots_i_ = 0; - cursor_dur_.durlog_i_ -=2; - cursor_dur_.set_plet (2, 3); - } - else if (cursor_dur_.plet_b () - && (cursor_dur_.plet_.iso_i_ == 2) - && (cursor_dur_.plet_.type_i_ == 3)) - { - assert (!cursor_dur_.dots_i_); - cursor_dur_.set_plet (1, 1); - cursor_dur_.durlog_i_ += 1; - cursor_dur_.dots_i_ = 1; - } - else if (cursor_dur_.dots_i_ == 1) - { - assert (!cursor_dur_.plet_b ()); - cursor_dur_.dots_i_ = 0; - cursor_dur_.durlog_i_ -= 1; - } - - if (Duration_convert::no_tuplets_b_s - && cursor_dur_.plet_b () && ok ()) - forward_dur (); - if (Duration_convert::no_double_dots_b_s - && (cursor_dur_.dots_i_ == 2) && ok ()) - forward_dur (); - if (Duration_convert::no_smaller_than_i_s - && (cursor_dur_.durlog_i_ > Duration_convert::no_smaller_than_i_s) && ok ()) - forward_dur (); - if (Duration_convert::no_smaller_than_i_s - && cursor_dur_.dots_i_ - && (cursor_dur_.durlog_i_ >= Duration_convert::no_smaller_than_i_s) - && ok ()) - forward_dur (); - if (Duration_convert::no_smaller_than_i_s - && (cursor_dur_.dots_i_ == 2) - && (cursor_dur_.durlog_i_ >= Duration_convert::no_smaller_than_i_s / 2) - && ok ()) - forward_dur (); - - return dur; -} - -bool -Duration_iterator::ok () -{ - return cursor_dur_.length_mom () <= Rational (4); -} diff --git a/midi2ly/include/duration-iter.hh b/midi2ly/include/duration-iter.hh deleted file mode 100644 index d3320c3317..0000000000 --- a/midi2ly/include/duration-iter.hh +++ /dev/null @@ -1,39 +0,0 @@ -/* - duration-iter.hh -- declare Duration_iterator - - source file of the GNU LilyPond music typesetter - - (c) 1998--2001 Han-Wen Nienhuys - - */ - -#ifndef DURATION_ITER_HH -#define DURATION_ITER_HH - -/// (iter_dur) -struct Duration_iterator { - - /// start at shortest: 128:2/3 - Duration_iterator (); - - /// return forward_dur (); - Duration operator ++(int); - - /// return current dur - Duration dur (); - - /// return dur (), step to next - Duration forward_dur (); - - /// durations left? - bool ok (); - -private: - - Duration cursor_dur_; -}; - - - -#endif /* DURATION_ITER_HH */ - -- 2.39.5