From: fred Date: Sun, 24 Mar 2002 19:36:39 +0000 (+0000) Subject: lilypond-0.0.45 X-Git-Tag: release/1.5.59~5111 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=ac7ae42d9f6922c21e3061529401b1a8de0b107a;p=lilypond.git lilypond-0.0.45 --- diff --git a/Documentation/INSTALL.pod b/Documentation/INSTALL.pod index 4615b850f2..3c1b07819b 100644 --- a/Documentation/INSTALL.pod +++ b/Documentation/INSTALL.pod @@ -35,7 +35,7 @@ AT&T CC. =item * Bash. Most scripts will continue to work with a stock sh, but they -will generate (harmless) syntax errors +might generate (harmless) syntax errors =item * GNU make. diff --git a/lily/bar.cc b/lily/bar.cc index 8b831d206a..f0afa9b402 100644 --- a/lily/bar.cc +++ b/lily/bar.cc @@ -12,6 +12,8 @@ Bar::Bar( String t) type = t; } +IMPLEMENT_STATIC_NAME(Bar); + void Bar::do_print()const { diff --git a/lily/beam.cc b/lily/beam.cc index 9a07bcc614..c4d62b54d2 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -281,6 +281,8 @@ Beam::brew_molecule_p() const return out; out->translate(Offset(x0 - left->hpos,0)); } +IMPLEMENT_STATIC_NAME(Beam); + void Beam::do_print()const { diff --git a/lily/item.cc b/lily/item.cc index e653c46ac6..f9adbba73c 100644 --- a/lily/item.cc +++ b/lily/item.cc @@ -8,6 +8,8 @@ Item::Item() pcol_l_ = 0; } +IMPLEMENT_STATIC_NAME(Item); + void Item::do_print() const { diff --git a/lily/notehead.cc b/lily/notehead.cc index b1f660ef17..528460f6f1 100644 --- a/lily/notehead.cc +++ b/lily/notehead.cc @@ -26,6 +26,8 @@ Notehead::set_rhythmic(Rhythmic_req*r_req_l) dots = r_req_l->duration_.dots_i_; } +IMPLEMENT_STATIC_NAME(Notehead); + void Notehead::do_print()const { diff --git a/lily/register-group.cc b/lily/register-group.cc new file mode 100644 index 0000000000..0725d6c16b --- /dev/null +++ b/lily/register-group.cc @@ -0,0 +1,133 @@ +/* + registergroup.cc -- implement Register_group_register + + source file of the LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + +#include "proto.hh" +#include "plist.hh" +#include "register-group.hh" +#include "register.hh" + +bool +Register_group_register::acceptable_request_b(Request* r) +{ + for (iter_top(reg_list_, i); i.ok(); i++) { + if (i->acceptable_request_b(r)) + return true; + } + return false; +} + +void +Register_group_register::set_feature(Features d) +{ + for (iter_top(reg_list_, i); i.ok(); i++) { + i->set_feature(d); + } +} + +void +Register_group_register::pre_move_processing() +{ + for (iter_top(reg_list_, i); i.ok(); i++) + i->pre_move_processing(); +} + +void +Register_group_register::process_requests() +{ + for (iter_top(reg_list_, i); i.ok(); i++) + i->process_requests(); +} + +void +Register_group_register::post_move_processing() +{ + iter_top(reg_list_, i); + while (i.ok()) { + // this construction to ensure clean deletion + Request_register *reg_l = i++; + reg_l->post_move_processing(); + } +} + +void +Register_group_register::acknowledge_element(Staff_elem_info info) +{ + if (!contains_b(info.origin_reg_l_arr_[0])) + return; + + for (iter_top(reg_list_, i); i.ok(); i++) + i->acknowledge_element(info); +} + +bool +Register_group_register::contains_b(Request_register* reg_l) +{ + bool parent_b = Request_register::contains_b(reg_l); + + if (parent_b) + return true; + for (iter_top(reg_list_, j); j.ok(); j++) + if (j->contains_b(reg_l)) + return true; + return false; +} + + + +bool +Register_group_register::try_request(Request*req_l) +{ + iter_top(reg_list_, i); + while (i.ok()) { + + + // this construction to ensure clean deletion + Request_register *reg_l = i++; + if (reg_l->try_request( req_l )) + return true; + } + return false; +} + +void +Register_group_register::add(Request_register *reg_p) +{ + reg_list_.bottom().add(reg_p); + reg_p->daddy_reg_l_ = this; +} + + +Register_group_register::~Register_group_register() +{ + +} + +Request_register * +Register_group_register::get_register_p(Request_register*reg_l) +{ + iterator(reg_list_) reg_cur= reg_list_.find(reg_l); + assert(reg_cur.ok()); + return reg_cur.remove_p(); +} + +void +Register_group_register::terminate_register(Request_register*r_l) +{ + delete get_register_p(r_l); +} + +IMPLEMENT_STATIC_NAME(Register_group_register); + +void +Register_group_register::do_print()const +{ +#ifndef NPRINT + for (iter_top(reg_list_, i); i.ok(); i++) + i->print(); +#endif +} diff --git a/lily/register.cc b/lily/register.cc index dfaa3ce05b..b9edcf9d58 100644 --- a/lily/register.cc +++ b/lily/register.cc @@ -13,7 +13,7 @@ #include "complex-walker.hh" #include "local-key-item.hh" #include "complex-staff.hh" -#include "registergroup.hh" +#include "register-group.hh" #include "debug.hh" @@ -82,6 +82,8 @@ Request_register::print() const #endif } +IMPLEMENT_STATIC_NAME(Request_register); + void Request_register::do_print()const { diff --git a/lily/rest.cc b/lily/rest.cc index 97f91a6a6a..3e582511e9 100644 --- a/lily/rest.cc +++ b/lily/rest.cc @@ -22,6 +22,8 @@ Rest::Rest(Duration d) } +IMPLEMENT_STATIC_NAME(Rest); + void Rest::do_print()const { diff --git a/lily/spanner.cc b/lily/spanner.cc index d89301bc10..87a01078aa 100644 --- a/lily/spanner.cc +++ b/lily/spanner.cc @@ -4,6 +4,8 @@ +IMPLEMENT_STATIC_NAME(Spanner); + void Spanner::do_print()const { diff --git a/lily/staffsym.cc b/lily/staffsym.cc index ad639e9c2d..0ad2411589 100644 --- a/lily/staffsym.cc +++ b/lily/staffsym.cc @@ -17,6 +17,8 @@ Staff_symbol::Staff_symbol(int l) no_lines_i_ = l; } +IMPLEMENT_STATIC_NAME(Staff_symbol); + void Staff_symbol::do_print()const { diff --git a/lily/stem.cc b/lily/stem.cc index 4b141cb2e8..5e6592c482 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -26,6 +26,8 @@ Stem::Stem(int c) //, Moment len) stem_xoffset=0; } +IMPLEMENT_STATIC_NAME(Stem); + void Stem::do_print() const { diff --git a/lily/text-spanner.cc b/lily/text-spanner.cc index 3f231223d8..77ab800bdb 100644 --- a/lily/text-spanner.cc +++ b/lily/text-spanner.cc @@ -19,6 +19,8 @@ Text_spanner::Text_spanner() support = 0; } +IMPLEMENT_STATIC_NAME(Text_spanner); + void Text_spanner::do_print() const { diff --git a/lily/voice-group-regs.cc b/lily/voice-group-regs.cc index 8a602a5201..b9351bd8e8 100644 --- a/lily/voice-group-regs.cc +++ b/lily/voice-group-regs.cc @@ -5,7 +5,7 @@ (c) 1997 Han-Wen Nienhuys */ - +#include "voice.hh" #include "proto.hh" #include "plist.hh" #include "musical-request.hh" @@ -32,6 +32,7 @@ Voice_group_registers::Voice_group_registers(String id) if (id=="") // UGH id = __FUNCTION__ + String(temp_id_count++); group_id_str_ = id; + termination_mom_ = 0; } bool @@ -65,17 +66,21 @@ Voice_group_registers::terminate_register(Request_register*r_l) for (int i=0; i name() == Voice_registers::static_name()) - voice_regs_l_.push( (Voice_registers*)r_l ); + if (r_l->name() == Voice_registers::static_name()) { + Voice_registers * vregs_l = (Voice_registers*)r_l; + voice_regs_l_.push( vregs_l ); + Voice *v_l = vregs_l->voice_l_; + termination_mom_ = termination_mom_ >? v_l -> last(); + mtor << "adding Voice_registers, now terminating at " << + termination_mom_<< "\n"; + } +} + +void +Voice_group_registers::post_move_processing() +{ + if ( get_staff_info().time_C_ ->when_ > termination_mom_ ){ + mtor << "Terminating voice_group\n"; + daddy_reg_l_->terminate_register(this); + } + Register_group_register::post_move_processing(); } diff --git a/lily/voice-regs.cc b/lily/voice-regs.cc index ca39524be0..2aa7f18eb0 100644 --- a/lily/voice-regs.cc +++ b/lily/voice-regs.cc @@ -55,13 +55,17 @@ Voice_registers::try_request(Request*r_l) bool Voice_registers::acceptable_request_b(Request*r) { -// return (r->rest() || r->note() || r->slur() || r->groupchange()); - return r->groupchange() + Command_req * c_l = r->command(); + return r->groupchange() || (c_l&&c_l->terminate()) || Register_group_register::acceptable_request_b(r); } +IMPLEMENT_STATIC_NAME(Voice_registers); + void Voice_registers::do_print() const { +#ifndef NPRINT mtor << "Voice= " << voice_l_<<'\n'; Register_group_register::do_print(); +#endif }