From 52aac05f94741476df91304f533afc20442a4435 Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 24 Mar 2002 19:36:49 +0000 Subject: [PATCH] lilypond-0.0.45 --- lily/bar-reg.cc | 14 +++++++++++--- lily/include/command-request.hh | 19 ++++++++++++++++++- lily/meter-reg.cc | 11 ++++++----- 3 files changed, 35 insertions(+), 9 deletions(-) diff --git a/lily/bar-reg.cc b/lily/bar-reg.cc index c28443df62..93334497cf 100644 --- a/lily/bar-reg.cc +++ b/lily/bar-reg.cc @@ -23,9 +23,11 @@ Bar_register::try_request(Request*r_l) Command_req* c_l = r_l->command(); if (!c_l|| !c_l->bar()) return false; - - assert(!bar_req_l_); - bar_req_l_ = c_l->bar(); + Bar_req * b= c_l->bar(); + if (bar_req_l_ && bar_req_l_->compare(*b)) + return false; + + bar_req_l_ = b; return true; } @@ -44,6 +46,8 @@ Bar_register::process_requests() } } + + void Bar_register::split_bar(Bar *& pre, Bar * no, Bar * &post) { @@ -77,3 +81,7 @@ Bar_register::post_move_processing() bar_req_l_ = 0; bar_p_ =0; } + +IMPLEMENT_STATIC_NAME(Bar_register); + + diff --git a/lily/include/command-request.hh b/lily/include/command-request.hh index f32dbea2fd..488728d2d9 100644 --- a/lily/include/command-request.hh +++ b/lily/include/command-request.hh @@ -49,6 +49,7 @@ struct Partial_measure_req : Timing_req { struct Meter_change_req : Timing_req { int beats_i_, one_beat_i_; + int compare(Meter_change_req const&); Meter_change_req(); void set(int,int); REQUESTMETHODS(Meter_change_req, meterchange); @@ -99,13 +100,29 @@ struct Group_feature_req : Command_req { }; +/** + Handle key changes. + Routines for sharps and flats are separated, + so that caller may identify non-conventional keys. +*/ struct Key_change_req : Command_req { Array melodic_p_arr_; - virtual void transpose(Melodic_req const &)const; + bool minor_b_; + Key_change_req(); Key_change_req(Key_change_req const&); ~Key_change_req(); REQUESTMETHODS(Key_change_req, keychange); + + /// return number of flats in key + int flats_i(); + + /// return number of sharps in key + int sharps_i(); + + void transpose(Melodic_req const & d) const; + /// is minor key? + int minor_b(); }; struct Clef_change_req : Command_req { diff --git a/lily/meter-reg.cc b/lily/meter-reg.cc index f15e5ddb09..3c500e6042 100644 --- a/lily/meter-reg.cc +++ b/lily/meter-reg.cc @@ -11,7 +11,6 @@ #include "command-request.hh" Meter_register::Meter_register() - { post_move_processing(); } @@ -22,10 +21,11 @@ Meter_register::try_request(Request*r_l) Command_req* creq_l= r_l->command(); if (!creq_l || !creq_l->meterchange()) return false; - - assert(!meter_req_l_); - meter_req_l_ = r_l->command()->meterchange(); - + Meter_change_req *m = creq_l->meterchange(); + if (meter_req_l_ && meter_req_l_->compare(*m)) + return false; + + meter_req_l_ = m; return true; } @@ -62,3 +62,4 @@ Meter_register::post_move_processing() meter_req_l_ = 0; meter_p_ =0; } +IMPLEMENT_STATIC_NAME(Meter_register); -- 2.39.5