]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.28
authorfred <fred>
Sun, 24 Mar 2002 19:30:37 +0000 (19:30 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:30:37 +0000 (19:30 +0000)
hdr/staffelem.hh
src/beam.cc
src/inputscore.cc
src/inputstaff.cc

index c7751b6ecc9a7652fffa948c15add5c05abf521d..ba3df695bfe4a99655842c35846c3593e4c8c403 100644 (file)
@@ -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<Staff_elem*> 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<Staff_elem*> 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<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
index 52080a39ab4091da451fdbb6483fd02d4f215677..02e3d3d94fd1f74d73962ec25d9418f5c547873f 100644 (file)
@@ -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
index a5d4a31007679d9ee94906bb1656c7a78c0ccf86..ef684047c4e06e210d9474288fa2b02b9afc5e8d 100644 (file)
@@ -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<Staff*> 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;
 }
index 6cbed389569050bb0a56fda358be1f0ac0ade584..8a56643f5c8aeffc7f86c198e48a1e5fb57102c4 100644 (file)
@@ -23,6 +23,7 @@ Input_staff::add(Array<Input_command*> &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;
 }