]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.10
authorfred <fred>
Sun, 17 Nov 1996 23:51:24 +0000 (23:51 +0000)
committerfred <fred>
Sun, 17 Nov 1996 23:51:24 +0000 (23:51 +0000)
hdr/swalker.hh
src/swalker.cc

index c00923ff99079c65d471b4ae2bdfb8b5253e03eb..da132dd9d6275c51fb0e26548ea8c241275f78a4 100644 (file)
@@ -17,13 +17,19 @@ struct Staff_walker : public PCursor<Staff_column*> {
     int break_status;
     
     /****************/
+
     int priority() const;              // Command
     Real when() const;    
     virtual ~Staff_walker();
     Staff_walker(Staff*, PScore*);
     void process() ;
-    virtual void process_command(Command *)=0;
+    void process_command(Command *);
+    void operator++(int);
+    /// every time ++ is called
+    virtual void reset()=0;
     virtual void process_requests()=0;
+    virtual void do_TYPESET_command(Command*)=0;
+    virtual void do_INTERPRET_command(Command*)=0 ;
 };
 /**
   manage run-time info when walking staffcolumns such as: key,
index db48fd1f8241e6d98683def24109780c0d380ef7..54872ec83bae2f88266064d5d3329742a0a19d50 100644 (file)
@@ -1,6 +1,7 @@
 #include "request.hh"
 #include "swalker.hh"
 #include "stcol.hh"
+#include "sccol.hh"
 
 Staff_walker::~Staff_walker() {}
 
@@ -30,3 +31,34 @@ Staff_walker::process()
     process_requests();
 }
 
+
+void
+Staff_walker::process_command(Command*com)
+{
+    switch (com->code){
+    case BREAK_PRE:
+    case BREAK_MIDDLE:
+    case BREAK_POST:
+    case BREAK_END:
+       (*this)->score_column->set_breakable();
+       break_status = com->code- BREAK_PRE;
+       break;
+    case INTERPRET:
+       do_INTERPRET_command(com);
+       break;
+       
+    case TYPESET:
+       do_TYPESET_command(com);
+       break;
+   
+    default :
+       break;
+    }
+}
+
+void
+Staff_walker::operator++(int i)
+{
+    PCursor<Staff_column*>::operator++(i);
+    reset();
+}