]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.9
authorfred <fred>
Fri, 8 Nov 1996 21:53:58 +0000 (21:53 +0000)
committerfred <fred>
Fri, 8 Nov 1996 21:53:58 +0000 (21:53 +0000)
hdr/swalker.hh [new file with mode: 0644]
src/swalker.cc [new file with mode: 0644]

diff --git a/hdr/swalker.hh b/hdr/swalker.hh
new file mode 100644 (file)
index 0000000..c00923f
--- /dev/null
@@ -0,0 +1,34 @@
+
+/*
+  swalker.hh -- part of LilyPond
+
+  (c) 1996 Han-Wen Nienhuys
+*/
+
+#ifndef SWALKER_HH
+#define SWALKER_HH
+
+#include "staff.hh"
+
+struct Staff_walker : public PCursor<Staff_column*> {
+    Staff * staff_;
+    PScore * pscore_;
+
+    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;
+    virtual void process_requests()=0;
+};
+/**
+  manage run-time info when walking staffcolumns such as: key,
+  meter, pending beams & slurs
+  */
+
+#endif // SWALKER_HH
+
diff --git a/src/swalker.cc b/src/swalker.cc
new file mode 100644 (file)
index 0000000..db48fd1
--- /dev/null
@@ -0,0 +1,32 @@
+#include "request.hh"
+#include "swalker.hh"
+#include "stcol.hh"
+
+Staff_walker::~Staff_walker() {}
+
+Staff_walker::Staff_walker(Staff * s, PScore*ps )
+    : PCursor<Staff_column*> (s->cols)
+{
+    staff_ = s;
+    pscore_ = ps;
+    break_status = BREAK_END - BREAK_PRE;
+}
+
+Real
+Staff_walker::when() const
+{
+    return (* (PCursor<Staff_column*> *) this)->when();
+}
+
+void
+Staff_walker::process()
+{
+    break_status = BREAK_END - BREAK_PRE;
+
+    for (int i = 0 ; i < (*this)->s_commands.sz(); i++) {
+       process_command((*this)->s_commands[i]);
+    }
+
+    process_requests();
+}
+