From: fred Date: Tue, 26 Mar 2002 21:28:37 +0000 (+0000) Subject: lilypond-1.1.1 X-Git-Tag: release/1.5.59~2801 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=74207b2f394e0ce28766ab4e45615fe8de05d5c4;p=lilypond.git lilypond-1.1.1 --- diff --git a/lily/axis-group-item.cc b/lily/axis-group-item.cc index 273116d1ea..6eabab3a58 100644 --- a/lily/axis-group-item.cc +++ b/lily/axis-group-item.cc @@ -40,7 +40,7 @@ Axis_group_item::do_breakable_col_processing() { Item *new_l = it_l->find_prebroken_piece (broken_to_drul_[j]->break_status_dir_); - ((Axis_group_item*)broken_to_drul_[j])->add_element (new_l); + (dynamic_cast (broken_to_drul_[j]))->add_element (new_l); } while (flip(&j)!=LEFT); } diff --git a/lily/axis-group-spanner.cc b/lily/axis-group-spanner.cc index 70c70c297f..fdd2969b5e 100644 --- a/lily/axis-group-spanner.cc +++ b/lily/axis-group-spanner.cc @@ -65,39 +65,36 @@ 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 (dynamic_cast (elt)) + Spanner * sp =dynamic_cast (elt); + Item *it = dynamic_cast (elt) ; + if (sp) { - Spanner * sp = dynamic_cast (elt); - for (int j =0; j < broken_into_l_arr_.size(); j++) { Axis_group_spanner * my_broken_l - = (Axis_group_spanner*)broken_into_l_arr_[j]; + = dynamic_cast(broken_into_l_arr_[j]); Spanner * broken_span_l - = sp->find_broken_piece ( - ((Score_element*)my_broken_l)->line_l()); + = sp->find_broken_piece (dynamic_cast(my_broken_l)->line_l()); if (broken_span_l) my_broken_l->add_element (broken_span_l); } } - else if (dynamic_cast (elt) - && dynamic_cast (elt)->breakable_b_ - && dynamic_cast (elt)->break_status_dir () == 0) + else if (it && it->breakable_b_ && it->break_status_dir () == 0) { // broken items Direction j=LEFT; do { - Item * my_item = dynamic_cast (elt)->broken_to_drul_[j]; + Item * my_item = it->broken_to_drul_[j]; Line_of_score * item_line_l = my_item->line_l() ; if (! item_line_l) continue; Axis_group_spanner * v - = (Axis_group_spanner*)find_broken_piece (item_line_l); + = dynamic_cast(find_broken_piece (item_line_l)); if (v) v->add_element (my_item); else @@ -118,7 +115,7 @@ Axis_group_spanner::do_break_processing() Put it in appropriate piece of this spanner */ Axis_group_spanner * my_broken_l - = (Axis_group_spanner*)find_broken_piece (elt->line_l()); + = dynamic_cast (find_broken_piece (elt->line_l())); my_broken_l->add_element (elt); } } diff --git a/lily/include/lyric-performer.hh b/lily/include/lyric-performer.hh index 29a5f92390..df77b0f028 100644 --- a/lily/include/lyric-performer.hh +++ b/lily/include/lyric-performer.hh @@ -17,17 +17,15 @@ class Lyric_performer : public Performer { public: TRANSLATOR_CLONE(Lyric_performer); - DECLARE_MY_RUNTIME_TYPEINFO; - Lyric_performer(); - ~Lyric_performer(); + DECLARE_MY_RUNTIME_TYPEINFO; protected: - void do_print() const; - virtual bool do_try_request (Request* req_l); - virtual void do_process_requests(); + void do_print() const; + virtual bool do_try_request (Request* req_l); + virtual void do_process_requests(); private: - Array lreq_arr_; + Array lreq_arr_; }; #endif // LYRIC_PERFOMER_HH diff --git a/lily/lyric-performer.cc b/lily/lyric-performer.cc index 43fe0f2634..e8c8892339 100644 --- a/lily/lyric-performer.cc +++ b/lily/lyric-performer.cc @@ -16,20 +16,12 @@ IMPLEMENT_IS_TYPE_B1(Lyric_performer,Performer); ADD_THIS_TRANSLATOR(Lyric_performer); -Lyric_performer::Lyric_performer() -{ -} - -Lyric_performer::~Lyric_performer() -{ -} - void Lyric_performer::do_print() const { #ifndef NPRINT if (lreq_arr_.size()) - lreq_arr_[ 0 ]->print(); + lreq_arr_[0]->print(); #endif } @@ -37,18 +29,18 @@ void Lyric_performer::do_process_requests() { if (lreq_arr_.size() && lreq_arr_[0]->text_str_.length_i()) - play (new Audio_text (Audio_text::LYRIC, lreq_arr_[ 0 ]->text_str_)); + play (new Audio_text (Audio_text::LYRIC, lreq_arr_[0]->text_str_)); lreq_arr_.clear(); } bool Lyric_performer::do_try_request (Request* req_l) { - Musical_req* m_l = dynamic_cast (req_l); - if (!m_l || ! dynamic_cast (m_l)) - return false; - lreq_arr_.push (dynamic_cast (m_l)); - - return true; + if (Lyric_req *lr = dynamic_cast (req_l)) + { + lreq_arr_.push (lr); + return true; + } + return false; } diff --git a/lily/midi-item.cc b/lily/midi-item.cc index 362508ee64..7ae9551f7d 100644 --- a/lily/midi-item.cc +++ b/lily/midi-item.cc @@ -399,6 +399,7 @@ Midi_note::Midi_note (Audio_item* audio_item_l) : Midi_item (audio_item_l) { dynamic_byte_ = 0x7f; + assert (dynamic_cast (audio_item_l)); } Moment diff --git a/lily/midi-walker.cc b/lily/midi-walker.cc index 81489c2ad0..90477a3009 100644 --- a/lily/midi-walker.cc +++ b/lily/midi-walker.cc @@ -48,10 +48,10 @@ Midi_walker::do_start_note (Midi_note* note_p) Moment stop_mom = note_p->duration() + ptr ()->audio_column_l_->at_mom (); for (int i=0; i < stop_note_queue.size(); i++) { - if (stop_note_queue[ i ].val->pitch_i() == note_p->pitch_i ()) + if (stop_note_queue[i].val->pitch_i() == note_p->pitch_i ()) { - if (stop_note_queue[ i ].key < stop_mom) - stop_note_queue[ i ].ignore_b_ = true; + if (stop_note_queue[i].key < stop_mom) + stop_note_queue[i].ignore_b_ = true; else { // skip the stopnote delete note_p; @@ -111,9 +111,9 @@ Midi_walker::process() return; p->channel_i_ = track_l_->number_i_; - if (p->name() != Midi_note::static_name ()) - output_event (ptr()->audio_column_l_->at_mom (), p); + if (Midi_item *mi = dynamic_cast(p)) + do_start_note (mi); else - do_start_note ((Midi_note*)p); + output_event (ptr()->audio_column_l_->at_mom (), p); }