]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.14
authorfred <fred>
Tue, 3 Dec 1996 00:12:57 +0000 (00:12 +0000)
committerfred <fred>
Tue, 3 Dec 1996 00:12:57 +0000 (00:12 +0000)
src/staff.cc

index 9b65539de543ebac7caba75c343feaed35fba6ca..521d31635dbdb5a6d848bcb38ecde545a9c99913 100644 (file)
@@ -2,51 +2,23 @@
 #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*
@@ -80,6 +52,7 @@ Staff::get_col(Real w, bool mus)
        if (sc == i->score_column)
            return i;
     }
+
     /* post: *sc > *->score_column || !i.ok() */
     Staff_column* newst = create_col(sc);
 
@@ -108,11 +81,6 @@ Staff::get_col(Real w, bool mus)
 }
 
 
-void
-Staff::add_voice(Voice *v)
-{
-    voices.bottom().add(v);
-}
 
 /*
     put all stuff grouped vertically in the Staff_cols
@@ -120,9 +88,9 @@ Staff::add_voice(Voice *v)
 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);
@@ -159,8 +127,8 @@ Real
 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;
 }
@@ -171,13 +139,11 @@ Staff::print() const
 {
 #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
 }