From 4735422eafdf2ddfeefe3ef3610f764d23153706 Mon Sep 17 00:00:00 2001 From: fred Date: Sat, 5 Oct 1996 14:46:39 +0000 Subject: [PATCH] lilypond-0.0.1 --- staff.hh | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 staff.hh diff --git a/staff.hh b/staff.hh new file mode 100644 index 0000000000..49439f373b --- /dev/null +++ b/staff.hh @@ -0,0 +1,78 @@ +#ifndef STAFF_HH +#define STAFF_HH + +#include "score.hh" +#include "voice.hh" +#include "command.hh" + +struct Staff_column { + Score_column *score_column; + + /// fields to collect data vertically. + svec v_elts; + svec s_commands; + + Staff_column(Score_column*s); + bool mus() const ; + Mtime when() const; + void add(Voice_element*ve); + /**************************************************************** + VIRTUAL + ****************************************************************/ + virtual void process_requests()=0; + virtual void process_commands()=0; + virtual ~Staff_column() { } +}; + + +/// base class for a collection of voices. +struct Staff { + /// synchronous horizontal stuff + PointerList voices; + + /// commands in chronological order + PointerList commands; + PointerList cols; + + /// indirections to the Score and PScore + Score *score_; + PScore *pscore_; + + void add_voice(Voice *v); + void add_staff_column(Staff_column *sp); + + + /// interpret all requests and add items to #destination#. + void process(); + /** + 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 add_commands(PointerListconst & sv); + /** + add all commands from sv. + + PRE + sv is time-ordered. + */ + virtual Staff_column * create_col(Score_column * )=0; + + void OK() const; + void print() const; + Mtime last() const; + void clean_cols() ; + virtual ~Staff() { } +}; +#endif -- 2.39.5