From 89b8e209c6b75cc483280e743f700c5c9014d691 Mon Sep 17 00:00:00 2001 From: fred Date: Sat, 18 Jan 1997 13:17:27 +0000 Subject: [PATCH] lilypond-0.0.23 --- hdr/parseconstruct.hh | 4 +++- src/note.cc | 8 ++++++++ src/timedescription.cc | 34 +++++++++++++++++++++++++++------- 3 files changed, 38 insertions(+), 8 deletions(-) diff --git a/hdr/parseconstruct.hh b/hdr/parseconstruct.hh index 8afb32d94b..6a22127a38 100644 --- a/hdr/parseconstruct.hh +++ b/hdr/parseconstruct.hh @@ -1,13 +1,15 @@ /* parseconstruct.hh -- part of LilyPond - (c) 1996 Han-Wen Nienhuys + (c) 1996,97 Han-Wen Nienhuys */ #ifndef PARSECONSTRUCT_HH #define PARSECONSTRUCT_HH #include "proto.hh" + +Voice_element*get_mark_element(String); void set_default_duration(int *); void get_default_duration(int *); void set_default_octave(String); diff --git a/src/note.cc b/src/note.cc index 4454e67727..5c132038bc 100644 --- a/src/note.cc +++ b/src/note.cc @@ -236,3 +236,11 @@ get_text_req(int d , Text_def*def) return new Text_req(d, def); } +Voice_element* +get_mark_element(String s) +{ + Voice_element*v_p = new Voice_element; + v_p->add( new Mark_req(s)); + + return v_p; +} diff --git a/src/timedescription.cc b/src/timedescription.cc index ce9b667aaf..9ffb981c85 100644 --- a/src/timedescription.cc +++ b/src/timedescription.cc @@ -3,7 +3,8 @@ String Time_description::str()const { - String s( "Time_description { at "); + String s( "Time_description { "); + s+=String( " cadenza: ") + cadenza_b_ + " at "; s+=when; s+="\nmeter " + String(whole_per_measure/one_beat) +":" +(1/one_beat); s+= "\nposition "+String( bars) + ":"+ whole_in_measure +"\n}\n"; @@ -19,19 +20,34 @@ void Time_description::OK() const { #ifdef NDEBUG - assert(whole_in_measure < whole_per_measure && 0 <= whole_in_measure); + if (!cadenza_b_) + assert(whole_in_measure < whole_per_measure); + assert(0 <= whole_in_measure); assert(one_beat); #endif } +void +Time_description::set_cadenza(bool b) +{ + if (cadenza_b_ && !b) { + if (whole_in_measure) { + bars ++; + whole_in_measure = 0; + } + } + cadenza_b_ = b ; +} + Time_description::Time_description(Moment dt, Time_description const *prev) { if (prev) { assert(dt >= 0); *this = *prev; - when += + dt; + when += dt; whole_in_measure += dt; - while ( whole_in_measure >= whole_per_measure ) { + + while ( !cadenza_b_ && whole_in_measure >= whole_per_measure ) { whole_in_measure -= whole_per_measure; bars ++; } @@ -41,7 +57,8 @@ Time_description::Time_description(Moment dt, Time_description const *prev) one_beat = 0.25; when = 0.0; bars = 0; - } + cadenza_b_ = false; + } } void @@ -50,21 +67,24 @@ Time_description::set_meter(int l, int o) assert(o); one_beat = 1/Moment(o); whole_per_measure = Moment(l) * one_beat; + if(whole_in_measure) + error_t("Meterchange should be at start of measure", when); } void Time_description::setpartial(Moment p) { if (when) - error_t ("Partial measure only allowed at beginning.", when); + error_t ("Partial measure only allowed at beginning.", *this); if (p<0||p > whole_per_measure) - error_t ("Partial measure has incorrect size", when); + error_t ("Partial measure has incorrect size", *this); whole_in_measure = whole_per_measure - p; } Moment Time_description::barleft() { + assert(!cadenza_b_); return whole_per_measure-whole_in_measure; } -- 2.39.5