From: fred Date: Tue, 3 Dec 1996 00:12:57 +0000 (+0000) Subject: lilypond-0.0.14 X-Git-Tag: release/1.5.59~6687 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=1abb389c68c7e32adfae8e9607b65d84af0102e1;p=lilypond.git lilypond-0.0.14 --- diff --git a/src/staff.cc b/src/staff.cc index 9b65539de5..521d31635d 100644 --- a/src/staff.cc +++ b/src/staff.cc @@ -2,51 +2,23 @@ #include "score.hh" #include "voice.hh" #include "swalker.hh" -#include "getcommand.hh" #include "stcol.hh" #include "sccol.hh" -#include "inputcommands.hh" #include "staffcommands.hh" #include "debug.hh" -Staff::Staff(Staff const&src) -{ - PL_copy(voices,src.voices); - staff_commands_ = src.staff_commands_; - assert(!cols.size()); // cols is a runtime field. - input_commands_ = src.input_commands_; - - score_ = src.score_; - pscore_ = src.pscore_; -} - -void -Staff::add(svec &s) -{ - input_commands_.add(get_reset_command()); - input_commands_.concat(s); -} void Staff::add(PointerList &l) { for (PCursor i(l); i.ok(); i++) voices.bottom().add(i); } + void -Staff::process_input_commands(svec &s, Real l) +Staff::process_commands(Real l) { - Input_commands commands; - for (int i = 0 ; i< s.sz(); i++) - commands.add(new Command(*s[i])); - for (int i = 0 ; i< input_commands_.sz(); i++) - commands.add(input_commands_[i]); - commands.truncate(l); - commands.print(); - - staff_commands_ = commands.parse(); - staff_commands_->clean(l); - commands.print(); - print(); + if (staff_commands_) + staff_commands_->clean(l); } Paperdef* @@ -80,6 +52,7 @@ Staff::get_col(Real w, bool mus) if (sc == i->score_column) return i; } + /* post: *sc > *->score_column || !i.ok() */ Staff_column* newst = create_col(sc); @@ -108,11 +81,6 @@ Staff::get_col(Real w, bool mus) } -void -Staff::add_voice(Voice *v) -{ - voices.bottom().add(v); -} /* put all stuff grouped vertically in the Staff_cols @@ -120,9 +88,9 @@ Staff::add_voice(Voice *v) void Staff::setup_staffcols() { - for (PCursor vc(voices); vc.ok(); vc++) { - Real now = vc->start; - for (PCursor ve(vc->elts); ve.ok(); ve++) { + for (PCursor i(voices); i.ok(); i++) { + Real now = i->start; + for (PCursor ve(i->elts); ve.ok(); ve++) { Staff_column *sc=get_col(now,true); sc->add(ve); @@ -159,8 +127,8 @@ Real Staff::last() const { Real l = 0.0; - for (PCursor vc(voices); vc.ok(); vc++) { - l = MAX(l, vc->last()); + for (PCursor i(voices); i.ok(); i++) { + l = MAX(l, i->last()); } return l; } @@ -171,13 +139,11 @@ Staff::print() const { #ifndef NPRINT mtor << "Staff {\n"; - for (PCursor vc(voices); vc.ok(); vc++) { - vc->print(); + for (PCursor i(voices); i.ok(); i++) { + i->print(); } if (staff_commands_) staff_commands_->print(); - for (int i =0; i print(); mtor <<"}\n"; #endif }