From a41a1443e20ae9337b26dd15823c23b14379aaab Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 26 Mar 2002 21:28:21 +0000 Subject: [PATCH] lilypond-1.1.0 --- lily/axis-group-item.cc | 4 ++-- lily/axis-group-spanner.cc | 14 +++++++------- lily/beam-engraver.cc | 10 +++++----- lily/command-request.cc | 10 +++++----- lily/engraver-group.cc | 8 ++++---- lily/head-engraver.cc | 7 +++---- lily/heads-engraver.cc | 6 +++--- lily/key-performer.cc | 10 +++++----- lily/local-key-engraver.cc | 12 +++++------- lily/timing-translator.cc | 26 +++++++++++++------------- 10 files changed, 52 insertions(+), 55 deletions(-) diff --git a/lily/axis-group-item.cc b/lily/axis-group-item.cc index 33dfdceba9..273116d1ea 100644 --- a/lily/axis-group-item.cc +++ b/lily/axis-group-item.cc @@ -16,7 +16,7 @@ Axis_group_item::OK() const Link_array elems = elem_l_arr (); for (int i=0; i < elems.size(); i++) { - Item * it_l = elems[i]->access_Item (); + Item * it_l = dynamic_cast (elems[i]); assert (it_l); } } @@ -34,7 +34,7 @@ Axis_group_item::do_breakable_col_processing() Link_array elems = elem_l_arr (); for (int i=0; i < elems.size(); i++) { - Item* it_l = elems[i]->access_Item (); + Item* it_l = dynamic_cast (elems[i]); Direction j=LEFT; do { diff --git a/lily/axis-group-spanner.cc b/lily/axis-group-spanner.cc index 64a28da895..70c70c297f 100644 --- a/lily/axis-group-spanner.cc +++ b/lily/axis-group-spanner.cc @@ -24,7 +24,7 @@ Axis_group_spanner::do_break_processing_if_unbroken() { if (!elems[i]->line_l()) { - Item * item_l = elems[i]->access_Item (); + Item * item_l = dynamic_cast (elems[i]); if (item_l && item_l->breakable_b_ && item_l->break_status_dir() == 0) @@ -65,9 +65,9 @@ Axis_group_spanner::do_break_processing() /* this piece doesn't know where it belongs. Find out if it was broken, and use the broken remains */ - if (elt->access_Spanner ()) + if (dynamic_cast (elt)) { - Spanner * sp = elt->access_Spanner (); + Spanner * sp = dynamic_cast (elt); for (int j =0; j < broken_into_l_arr_.size(); j++) { @@ -83,15 +83,15 @@ Axis_group_spanner::do_break_processing() } } - else if (elt->access_Item () - && elt->access_Item ()->breakable_b_ - && elt->access_Item ()->break_status_dir () == 0) + else if (dynamic_cast (elt) + && dynamic_cast (elt)->breakable_b_ + && dynamic_cast (elt)->break_status_dir () == 0) { // broken items Direction j=LEFT; do { - Item * my_item = elt->access_Item ()->broken_to_drul_[j]; + Item * my_item = dynamic_cast (elt)->broken_to_drul_[j]; Line_of_score * item_line_l = my_item->line_l() ; if (! item_line_l) continue; diff --git a/lily/beam-engraver.cc b/lily/beam-engraver.cc index 6ef0ba09fc..4ef398b499 100644 --- a/lily/beam-engraver.cc +++ b/lily/beam-engraver.cc @@ -25,11 +25,11 @@ Beam_engraver::Beam_engraver() bool Beam_engraver::do_try_request(Request*r) { - Musical_req* mus_l = r->access_Musical_req (); + Musical_req* mus_l = dynamic_cast (r); if (!mus_l) return false; - Beam_req* b = mus_l->access_Beam_req (); + Beam_req* b = dynamic_cast (mus_l); if (!b) return false; @@ -100,14 +100,14 @@ Beam_engraver::acknowledge_element (Score_element_info i) if (!beam_p_ || !i.elem_l_->is_type_b (Stem::static_name ())) return; - Stem* s = (Stem*)i.elem_l_->access_Item (); - if (!i.req_l_ || !i.req_l_->access_Musical_req () || !i.req_l_->access_Musical_req ()->access_Rhythmic_req ()) + Stem* s = (Stem*)dynamic_cast (i.elem_l_); + if (!dynamic_cast (i.req_l_)) { ::warning ( _("Stem must have Rhythmic structure.")); return; } - Rhythmic_req *rhythmic_req = i.req_l_->access_Musical_req ()->access_Rhythmic_req (); + Rhythmic_req *rhythmic_req = dynamic_cast (i.req_l_); if (rhythmic_req->duration_.durlog_i_<= 2) { rhythmic_req->warning (_ ("stem doesn't fit in beam")); diff --git a/lily/command-request.cc b/lily/command-request.cc index b32dc96ff4..e407f30661 100644 --- a/lily/command-request.cc +++ b/lily/command-request.cc @@ -32,7 +32,7 @@ Cadenza_req::do_print() const bool Cadenza_req::do_equal_b (Request*r) const { - Cadenza_req*cad = r->access_Command_req ()->access_Timing_req ()->access_Cadenza_req (); + Cadenza_req*cad = dynamic_cast (r); return cad->on_b_ == on_b_; } @@ -47,7 +47,7 @@ Cadenza_req::Cadenza_req (bool b) bool Bar_req::do_equal_b (Request*r) const { - Bar_req * b = r->access_Command_req ()->access_Bar_req (); + Bar_req * b = dynamic_cast (r); return type_str_ == b->type_str_; } @@ -81,7 +81,7 @@ Partial_measure_req::Partial_measure_req (Moment m) bool Partial_measure_req::do_equal_b (Request* r) const { - Partial_measure_req *p = r->access_Command_req ()->access_Timing_req ()->access_Partial_measure_req (); + Partial_measure_req *p = dynamic_cast (r); return p->duration_ == duration_; } @@ -150,7 +150,7 @@ Time_signature_change_req::do_print() const bool Time_signature_change_req::do_equal_b (Request * r) const { - Time_signature_change_req * m = r->access_Command_req ()->access_Timing_req ()->access_Time_signature_change_req (); + Time_signature_change_req * m = dynamic_cast (r); return m->beats_i_ == beats_i_ && one_beat_i_ == m->one_beat_i_; @@ -179,7 +179,7 @@ IMPLEMENT_IS_TYPE_B1(Tempo_req, Timing_req); bool Tempo_req::do_equal_b (Request *r) const { - Tempo_req *t = r->access_Command_req ()->access_Timing_req ()->access_Tempo_req (); + Tempo_req *t = dynamic_cast (r); return t->dur_.length()== dur_.length () && metronome_i_ == t->metronome_i_; } diff --git a/lily/engraver-group.cc b/lily/engraver-group.cc index 2dc0b4131b..2c1b3d2d86 100644 --- a/lily/engraver-group.cc +++ b/lily/engraver-group.cc @@ -30,7 +30,7 @@ Engraver_group_engraver::do_announces() Link_array groups = group_l_arr (); for (int i=0; i < groups.size(); i++) { - Engraver * eng = groups[i]->access_Engraver (); + Engraver * eng = dynamic_cast (groups[i]); if (eng) { Engraver_group_engraver * group = @@ -52,7 +52,7 @@ Engraver_group_engraver::do_announces() info.req_l_ = &dummy_req; for (int i=0; i < nongroups.size(); i++) { // Is this good enough? - Engraver * eng = nongroups[i]->access_Engraver (); + Engraver * eng = dynamic_cast (nongroups[i]); if (eng && eng!= info.origin_grav_l_arr_[0]) eng->acknowledge_element (info); } @@ -60,7 +60,7 @@ Engraver_group_engraver::do_announces() announce_info_arr_.clear (); for (int i=0; i < nongroups.size(); i++) { - Engraver * eng = nongroups[i]->access_Engraver (); + Engraver * eng = dynamic_cast (nongroups[i]); if (eng) eng->process_acknowledged (); } @@ -77,7 +77,7 @@ Engraver_group_engraver::get_staff_info() const Link_array simple_translators = nongroup_l_arr (); for (int i=0; i < simple_translators.size(); i++) { - Engraver * eng = simple_translators[i]->access_Engraver (); + Engraver * eng = dynamic_cast (simple_translators[i]); if (eng) eng->fill_staff_info (inf); } diff --git a/lily/head-engraver.cc b/lily/head-engraver.cc index c8c5e79248..ce4e5dcdf3 100644 --- a/lily/head-engraver.cc +++ b/lily/head-engraver.cc @@ -23,11 +23,10 @@ Note_head_engraver::do_try_request (Request *req_l) if (note_req_l_) return false; - if (!(req_l->access_Musical_req () && req_l->access_Musical_req ()->access_Note_req ())) - + if (!(dynamic_cast (req_l))) return false; - note_req_l_=req_l->access_Musical_req ()->access_Rhythmic_req (); + note_req_l_=dynamic_cast (req_l); return true; } @@ -47,7 +46,7 @@ Note_head_engraver::do_process_requests() announce_element (Score_element_info (dot_p_,0)); } - note_p_->position_i_ = note_req_l_->access_Note_req ()->pitch_.steps (); + note_p_->position_i_ = dynamic_cast (note_req_l_)->pitch_.steps (); Score_element_info itinf (note_p_,note_req_l_); diff --git a/lily/heads-engraver.cc b/lily/heads-engraver.cc index 63e192ea06..a8e0aaa46b 100644 --- a/lily/heads-engraver.cc +++ b/lily/heads-engraver.cc @@ -18,10 +18,10 @@ Note_heads_engraver::Note_heads_engraver() bool Note_heads_engraver::do_try_request (Request *req_l) { - if (!req_l->access_Musical_req ()) + if (!dynamic_cast (req_l)) return false; - Note_req * n =req_l->access_Musical_req ()->access_Note_req (); + Note_req * n =dynamic_cast (req_l); if (!n) return false; @@ -49,7 +49,7 @@ Note_heads_engraver::do_process_requests() dot_p_arr_.push (d); } - note_p->position_i_ = note_req_l->access_Note_req ()->pitch_.steps (); + note_p->position_i_ = dynamic_cast (note_req_l)->pitch_.steps (); Score_element_info itinf (note_p,note_req_l); diff --git a/lily/key-performer.cc b/lily/key-performer.cc index 02e80fca28..3ccac03e21 100644 --- a/lily/key-performer.cc +++ b/lily/key-performer.cc @@ -47,11 +47,11 @@ Key_performer::do_try_request (Request* req_l) if (key_req_l_) return false; - if (req_l->access_Command_req ()) - key_req_l_ = req_l->access_Command_req ()->access_Key_change_req (); - - if (key_req_l_) - return true; + if (dynamic_cast (req_l)) + { + key_req_l_ = dynamic_cast (req_l); + return true; + } return false; } diff --git a/lily/local-key-engraver.cc b/lily/local-key-engraver.cc index c6a3a07189..54df397c45 100644 --- a/lily/local-key-engraver.cc +++ b/lily/local-key-engraver.cc @@ -40,7 +40,7 @@ Local_key_engraver::do_creation_processing () } else { - key_C_ = &((Key_engraver*)result->access_Engraver ())->key_; + key_C_ = &((Key_engraver*)dynamic_cast (result))->key_; local_key_ = *key_C_; } } @@ -97,24 +97,22 @@ void Local_key_engraver::acknowledge_element (Score_element_info info) { Score_element * elem_l = info.elem_l_; - Item * item_l = elem_l->access_Item(); + Item * item_l = dynamic_cast (elem_l); - Note_req * note_l = (info.req_l_->access_Musical_req ()) - ? info.req_l_->access_Musical_req ()->access_Note_req () : 0; + Note_req * note_l = dynamic_cast (info.req_l_); if (note_l && item_l && item_l->is_type_b (Note_head::static_name ())) { mel_l_arr_.push (note_l); support_l_arr_.push (item_l); } - else if (info.req_l_->access_Command_req () - && info.req_l_->access_Command_req ()->access_Key_change_req () && key_C_) + else if (dynamic_cast (info.req_l_)) { local_key_ = *key_C_; } else if (elem_l->is_type_b (Tie::static_name ())) { - Tie * tie_l = (Tie*)elem_l->access_Spanner (); + Tie * tie_l = (Tie*)dynamic_cast (elem_l); if (tie_l->same_pitch_b_) tied_l_arr_.push (tie_l-> head_l_drul_[RIGHT]); } diff --git a/lily/timing-translator.cc b/lily/timing-translator.cc index 79dd64035c..316f31d523 100644 --- a/lily/timing-translator.cc +++ b/lily/timing-translator.cc @@ -20,8 +20,8 @@ Timing_translator::Timing_translator () bool Timing_translator::do_try_request(Request*r) { - Command_req * c = r->access_Command_req (); - if (!(c && c->access_Timing_req ())) + Command_req * c = dynamic_cast (r); + if (!(c && dynamic_cast (c))) return false; for (int i=0; i < timing_req_l_arr_.size (); i++) { @@ -34,7 +34,7 @@ Timing_translator::do_try_request(Request*r) } } - timing_req_l_arr_.push(c->access_Timing_req ()); + timing_req_l_arr_.push(dynamic_cast (c)); return true; } @@ -44,7 +44,7 @@ Timing_translator::time_signature_req_l() const Time_signature_change_req *m_l=0; for (int i=0; !m_l && i < timing_req_l_arr_.size (); i++) { - m_l=timing_req_l_arr_[i]->access_Time_signature_change_req (); + m_l=dynamic_cast (timing_req_l_arr_[i]); } return m_l; } @@ -55,7 +55,7 @@ Timing_translator::do_process_requests() for (int i=0; i < timing_req_l_arr_.size (); i++) { Timing_req * tr_l = timing_req_l_arr_[i]; - Time_signature_change_req *m_l = tr_l->access_Time_signature_change_req (); + Time_signature_change_req *m_l = dynamic_cast (tr_l); if (m_l) { int b_i= m_l->beats_i_; @@ -69,9 +69,9 @@ Timing_translator::do_process_requests() Rhythmic_grouping (MInterval (0,Moment (b_i, o_i)), b_i); } } - else if (tr_l->access_Partial_measure_req ()) + else if (dynamic_cast (tr_l)) { - Moment m = tr_l->access_Partial_measure_req ()->duration_; + Moment m = dynamic_cast (tr_l)->duration_; String error = time_.try_set_partial_str (m); if (error.length_i ()) { @@ -80,7 +80,7 @@ Timing_translator::do_process_requests() else time_.setpartial (m); } - else if (tr_l->access_Barcheck_req()) + else if (dynamic_cast (tr_l)) { if (time_.whole_in_measure_) { @@ -92,15 +92,15 @@ Timing_translator::do_process_requests() } } - else if (tr_l->access_Cadenza_req ()) + else if (dynamic_cast (tr_l)) { - time_.set_cadenza (tr_l->access_Cadenza_req ()->on_b_); + time_.set_cadenza (dynamic_cast (tr_l)->on_b_); } - else if (tr_l->access_Measure_grouping_req ()) + else if (dynamic_cast (tr_l)) { default_grouping_ = - parse_grouping (tr_l->access_Measure_grouping_req ()->beat_i_arr_, - tr_l->access_Measure_grouping_req ()->elt_length_arr_); + parse_grouping (dynamic_cast (tr_l)->beat_i_arr_, + dynamic_cast (tr_l)->elt_length_arr_); } } -- 2.39.2