#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<Command*> &s)
-{
- input_commands_.add(get_reset_command());
- input_commands_.concat(s);
-}
void
Staff::add(PointerList<Voice*> &l)
{
for (PCursor<Voice*> i(l); i.ok(); i++)
voices.bottom().add(i);
}
+
void
-Staff::process_input_commands(svec<Command*> &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*
if (sc == i->score_column)
return i;
}
+
/* post: *sc > *->score_column || !i.ok() */
Staff_column* newst = create_col(sc);
}
-void
-Staff::add_voice(Voice *v)
-{
- voices.bottom().add(v);
-}
/*
put all stuff grouped vertically in the Staff_cols
void
Staff::setup_staffcols()
{
- for (PCursor<Voice*> vc(voices); vc.ok(); vc++) {
- Real now = vc->start;
- for (PCursor<Voice_element *> ve(vc->elts); ve.ok(); ve++) {
+ for (PCursor<Voice*> i(voices); i.ok(); i++) {
+ Real now = i->start;
+ for (PCursor<Voice_element *> ve(i->elts); ve.ok(); ve++) {
Staff_column *sc=get_col(now,true);
sc->add(ve);
Staff::last() const
{
Real l = 0.0;
- for (PCursor<Voice*> vc(voices); vc.ok(); vc++) {
- l = MAX(l, vc->last());
+ for (PCursor<Voice*> i(voices); i.ok(); i++) {
+ l = MAX(l, i->last());
}
return l;
}
{
#ifndef NPRINT
mtor << "Staff {\n";
- for (PCursor<Voice*> vc(voices); vc.ok(); vc++) {
- vc->print();
+ for (PCursor<Voice*> i(voices); i.ok(); i++) {
+ i->print();
}
if (staff_commands_)
staff_commands_->print();
- for (int i =0; i <input_commands_.sz(); i++)
- input_commands_[i]->print();
mtor <<"}\n";
#endif
}