]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.5
authorfred <fred>
Tue, 29 Oct 1996 18:58:39 +0000 (18:58 +0000)
committerfred <fred>
Tue, 29 Oct 1996 18:58:39 +0000 (18:58 +0000)
mtime.hh [deleted file]
rhythmstaf.cc
rhythmstaf.hh
staff.cc
staff.hh

diff --git a/mtime.hh b/mtime.hh
deleted file mode 100644 (file)
index ef01d23..0000000
--- a/mtime.hh
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef MTIME_HH
-#define MTIME_HH
-
-#include "real.hh"
-
-typedef Real Mtime;
-
-#endif
index d2a85d62cee60f9ceb7d0fe5b0b0554ddd129dfc..0b9e90e229edcbd740b3e5041f41c593ddda0936 100644 (file)
@@ -17,11 +17,13 @@ Rhythmic_column::Rhythmic_column(Score_column*s, Rhythmic_staff *rs)
     staff_ = rs;
 }
 
-
+Rhythmic_staff::Rhythmic_staff()
+{
+    theline = new Linestaff(1);
+}
 void
 Rhythmic_staff::set_output(PScore* ps )
 {
-    theline = new Linestaff(1);
     pscore_ = ps;
     pscore_->add(theline);
 }
@@ -30,7 +32,7 @@ Rhythmic_staff::set_output(PScore* ps )
 void
 Rhythmic_column::process_commands( )
 {
-    int breakstat = BREAK_END;
+    int breakstat = BREAK_END - BREAK_PRE;
     for (int i = 0 ; i < s_commands.sz(); i++) {
        Command *com = s_commands[i];
        switch (com->code){
@@ -41,7 +43,7 @@ Rhythmic_column::process_commands( )
        case BREAK_POST:
        case BREAK_END:
            score_column->set_breakable();
-           breakstat = com->code;
+           breakstat = com->code- BREAK_PRE;
            break;
            
        case TYPESET:
@@ -77,7 +79,6 @@ Rhythmic_column::process_requests()
                the_note = rq;
            }
            break;
-               
        }
 }
 
@@ -136,7 +137,7 @@ Rhythmic_column::typeset_req(Request *rq)
        m->add_right(dm);
     }
     i->output=m;
-    staff_->pscore_->typeset_item(i, score_column->pcol, staff_->theline,0 );
+    staff_->pscore_->typeset_item(i, score_column->pcol, staff_->theline );
 }
 
 void
index 8e362146e33d96ee5bf76c0840a7fe0a07f25962..69b61ec4877914133efd83c93c1e24c0851bfcf0 100644 (file)
@@ -32,11 +32,14 @@ struct Rhythmic_column : Staff_column {
 struct Rhythmic_staff : Staff {
     /// indirection to the PStaff.
     PStaff *theline;
+
+    /****************/
     void set_output(PScore *);
     void process_commands( PCursor<Command*> &where);
 
     void grant_requests();
     Staff_column * create_col(Score_column*);
+    Rhythmic_staff();
 };
 
 
index 0827c953f015cc38bec5910e35c2abf0ef22beca..7dd2666dc9ff02167982979b81158457d0096484 100644 (file)
--- a/staff.cc
+++ b/staff.cc
@@ -17,7 +17,7 @@ Staff::clean_cols()
 }
 
 Staff_column *
-Staff::get_col(Mtime w, bool mus)
+Staff::get_col(Real w, bool mus)
 {
     Score_column* sc = score_->find_col(w,mus);
     assert(sc->when == w);
@@ -65,7 +65,7 @@ Staff::setup_staffcols()
     
     for (PCursor<Voice*> vc(voices); vc.ok(); vc++) {
 
-       Mtime now = vc->start;
+       Real now = vc->start;
        for (PCursor<Voice_element *> ve(vc->elts); ve.ok(); ve++) {
 
            Staff_column *sc=get_col(now,true);
@@ -130,9 +130,9 @@ Staff::OK() const
 }
 
 
-Mtime
+Real
 Staff::last() const {
-    Mtime l = 0.0;
+    Real l = 0.0;
     for (PCursor<Voice*> vc(voices); vc.ok(); vc++) {
        l = MAX(l, vc->last());
     }
@@ -154,3 +154,9 @@ Staff::print() const
     #endif
 }
 
+Staff::Staff()
+{
+    score_ =0;
+    pscore_=0;
+    
+}
index cca8c35266412d745ca8397dc92c174bcbfdf507..3d39c6e78bdb89dc047436a264398bb1d888f121 100644 (file)
--- a/staff.hh
+++ b/staff.hh
@@ -19,6 +19,8 @@ struct Staff {
     Score *score_;
     PScore *pscore_;
 
+    /****************************************************************/
+    
     void add_voice(Voice *v);
     void add_staff_column(Staff_column *sp);
 
@@ -28,18 +30,13 @@ struct Staff {
     /**
     This routines calls virtual functions from Staff, to delegate the
     interpretation of requests to a derived class of Staff */
-
-    
-    /****************************************************************
-      VIRTUALS
-    ****************************************************************/
-    
     void setup_staffcols();
 
-    virtual void set_output(PScore * destination)=0;
-    virtual void grant_requests()=0;
-    
-    Staff_column * get_col(Mtime,bool);
+    void OK() const;
+    void print() const;
+    Real last() const;
+    void clean_cols() ;
+    Staff_column * get_col(Real,bool);
 
     void add_commands(PointerList<Command* >const & sv);
     /**
@@ -48,12 +45,21 @@ struct Staff {
     PRE
     sv is time-ordered.
     */
+
+    Staff();
+    /**
+      Should construct with Score as arg, but this isn't known during parsing.      
+      */
+    /****************************************************************
+      VIRTUALS
+    ****************************************************************/
+    
+    virtual void set_output(PScore * destination)=0;
+    virtual void grant_requests()=0;    
     virtual Staff_column * create_col(Score_column * )=0;
+    virtual ~Staff() { }
 
-    void OK() const;
-    void print() const;
-    Mtime last() const;
-    void clean_cols() ;
-    virtual ~Staff() { } 
 };
 #endif
+
+