From 49086b9386d0ceaf4981bfde9b78a1083057e3fd Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 24 Mar 2002 19:30:37 +0000 Subject: [PATCH] lilypond-0.0.28 --- hdr/staffelem.hh | 9 +++++++-- src/beam.cc | 12 +++++------- src/inputscore.cc | 3 ++- src/inputstaff.cc | 6 ++++-- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/hdr/staffelem.hh b/hdr/staffelem.hh index c7751b6ecc..ba3df695bf 100644 --- a/hdr/staffelem.hh +++ b/hdr/staffelem.hh @@ -15,12 +15,12 @@ struct Staff_elem { 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 dependencies; /// the pstaff it is in PStaff *pstaff_l_; @@ -43,6 +43,8 @@ struct Staff_elem { 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. @@ -57,6 +59,8 @@ protected: /// do calculations after determining horizontal spacing virtual void do_post_processing(); + Array dependants; + private: /// member: the symbols Molecule *output; // should scrap, and use temp var? @@ -67,6 +71,7 @@ private: This is needed, because #output# may still be NULL. */ + Array 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 diff --git a/src/beam.cc b/src/beam.cc index 52080a39ab..02e3d3d94f 100644 --- a/src/beam.cc +++ b/src/beam.cc @@ -34,7 +34,7 @@ Stem_info::Stem_info(const Stem*s) idealy = max(dir*s->top, dir*s->bot); miny = max(dir*s->minnote, dir*s-> maxnote); assert(miny <= idealy); - no_beams = s->flag; + } /****************/ @@ -43,10 +43,6 @@ Offset 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()); @@ -64,7 +60,7 @@ void Beam::add(Stem*s) { stems.bottom().add(s); - s->dependencies.push(this); + s->add_depedency(this); s->print_flag = false; } @@ -177,7 +173,9 @@ Beam::set_grouping(Rhythmic_grouping def, Rhythmic_grouping cur) Spanner * Beam::do_break_at( PCol *, PCol *) const { - return new Beam(*this); + Beam *beam_p= new Beam(*this); + + return beam_p; } void diff --git a/src/inputscore.cc b/src/inputscore.cc index a5d4a31007..ef684047c4 100644 --- a/src/inputscore.cc +++ b/src/inputscore.cc @@ -36,7 +36,7 @@ Input_score::parse() { 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 parsed_staffs; for (iter_top(staffs_,i); i.ok(); i++) { @@ -60,6 +60,7 @@ Input_score::~Input_score() Input_score::Input_score() { + defined_ch_c_l_=0; paper_= 0; errorlevel_i_ = 0; } diff --git a/src/inputstaff.cc b/src/inputstaff.cc index 6cbed38956..8a56643f5c 100644 --- a/src/inputstaff.cc +++ b/src/inputstaff.cc @@ -23,6 +23,7 @@ Input_staff::add(Array &s) Input_staff::Input_staff(String s) { type= s; + defined_ch_c_l_ = 0; } void @@ -48,7 +49,7 @@ Input_staff::parse(Score*score_l) 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(); @@ -67,11 +68,12 @@ Input_staff::parse(Score*score_l) 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; } -- 2.39.5