enum Status {
ORPHAN, // not yet added to pstaff
VIRGIN, // added to pstaff
+ PRECALCING,
PRECALCED, // calcs before spacing done
+ POSTCALCING,
POSTCALCED, // after spacing calcs done
OUTPUT, // molecule has been output
} status;
- bool calc_children;
- Array<Staff_elem*> dependencies;
/// the pstaff it is in
PStaff *pstaff_l_;
virtual const char *name() const; // to find out derived classes.
virtual Spanner* spanner() { return 0; }
virtual Item * item() { return 0; }
+ void add_depedency(Staff_elem* );
+ void substitute_dependency(Staff_elem* old, Staff_elem * newdep);
protected:
/// do printing of derived info.
/// do calculations after determining horizontal spacing
virtual void do_post_processing();
+ Array<Staff_elem*> dependants;
+
private:
/// member: the symbols
Molecule *output; // should scrap, and use temp var?
This is needed, because #output# may still be
NULL.
*/
+ Array<Staff_elem*> dependencies;
};
/** Both Spanner and Item are Staff_elem's. Most Staff_elem's depend
on other Staff_elem's, eg, Beam needs to know and set direction of
idealy = max(dir*s->top, dir*s->bot);
miny = max(dir*s->minnote, dir*s-> maxnote);
assert(miny <= idealy);
- no_beams = s->flag;
+
}
/****************/
Beam::center()const
{
assert(status >= POSTCALCED);
- if (calc_children){ // URGGGG!!!
- Beam*me_p = (Beam*)this;
- me_p->do_post_processing();
- }
Real w=(paper()->note_width() + width().length())/2.0;
return Offset(w, (left_pos + w* slope)*paper()->interline());
Beam::add(Stem*s)
{
stems.bottom().add(s);
- s->dependencies.push(this);
+ s->add_depedency(this);
s->print_flag = false;
}
Spanner *
Beam::do_break_at( PCol *, PCol *) const
{
- return new Beam(*this);
+ Beam *beam_p= new Beam(*this);
+
+ return beam_p;
}
void
{
Paperdef* paper_p=new Paperdef(*paper_);
Score *s_p = new Score(paper_p);
- s_p->define_spot_str_ = define_spot_str_;
+ s_p->defined_ch_c_l_= defined_ch_c_l_;
s_p->errorlevel_i_ = errorlevel_i_;
Array<Staff*> parsed_staffs;
for (iter_top(staffs_,i); i.ok(); i++) {
Input_score::Input_score()
{
+ defined_ch_c_l_=0;
paper_= 0;
errorlevel_i_ = 0;
}
Input_staff::Input_staff(String s)
{
type= s;
+ defined_ch_c_l_ = 0;
}
void
error("Unknown staff-type `" + type +"\'");
p->score_l_ = score_l;
- p->define_spot_str_ = define_spot_str_;
+ p->define_spot_str_ = ""; // todo
for (iter_top(music_,i); i.ok(); i++) {
Voice_list vl = i->convert();
Input_staff::Input_staff(Input_staff const&s)
{
+
for (iter_top(s.commands_,i); i.ok(); i++)
commands_.bottom().add(new Input_command(**i));
for (iter_top(s.music_,i); i.ok(); i++)
add(i->clone());
- define_spot_str_ = s.define_spot_str_;
+ defined_ch_c_l_ = s.defined_ch_c_l_;
type = s.type;
}