From dda32f5b4d6f2189e6e7f0372c7b66a33d134b64 Mon Sep 17 00:00:00 2001 From: fred Date: Sat, 2 Nov 1996 15:18:26 +0000 Subject: [PATCH] lilypond-0.0.6 --- .dstreamrc | 5 +- rhythmstaf.cc | 165 -------------------------------------------------- rhythmstaf.hh | 48 --------------- 3 files changed, 4 insertions(+), 214 deletions(-) delete mode 100644 rhythmstaf.cc delete mode 100644 rhythmstaf.hh diff --git a/.dstreamrc b/.dstreamrc index fccd8d5c37..7dcded772c 100644 --- a/.dstreamrc +++ b/.dstreamrc @@ -15,4 +15,7 @@ parse_duration 1 parse_pitch 1 Col_configuration 1 Command 1 -Score_commands 1 \ No newline at end of file +Score_commands 1 +Note_req 1 +Rhythmic_req 1 +Rest_req 1 \ No newline at end of file diff --git a/rhythmstaf.cc b/rhythmstaf.cc deleted file mode 100644 index 0b9e90e229..0000000000 --- a/rhythmstaf.cc +++ /dev/null @@ -1,165 +0,0 @@ -#include "request.hh" -#include "debug.hh" -#include "linestaff.hh" -#include "staff.hh" -#include "pstaff.hh" -#include "pscore.hh" -#include "command.hh" -#include "molecule.hh" -#include "rhythmstaf.hh" -#include "lookupsyms.hh" -#include "sccol.hh" - -Rhythmic_column::Rhythmic_column(Score_column*s, Rhythmic_staff *rs) - : Staff_column(s) -{ - the_note = 0; - staff_ = rs; -} - -Rhythmic_staff::Rhythmic_staff() -{ - theline = new Linestaff(1); -} -void -Rhythmic_staff::set_output(PScore* ps ) -{ - pscore_ = ps; - pscore_->add(theline); -} - -// should integrate handling of BREAK commands into Staff_column -void -Rhythmic_column::process_commands( ) -{ - int breakstat = BREAK_END - BREAK_PRE; - for (int i = 0 ; i < s_commands.sz(); i++) { - Command *com = s_commands[i]; - switch (com->code){ - case INTERPRET: - break; - case BREAK_PRE: - case BREAK_MIDDLE: - case BREAK_POST: - case BREAK_END: - score_column->set_breakable(); - breakstat = com->code- BREAK_PRE; - break; - - case TYPESET: - typeset_command ( com , breakstat); - break; - default : - break; - } - - } -} -/** - accept: - - BREAK: all - TYPESET: bar, meter - - */ - - - -void -Rhythmic_column::process_requests() -{ - for (int i = 0 ; i < v_elts.sz(); i ++) - for (PCursor rqc(v_elts[i]->reqs); rqc.ok(); rqc++) { - Request *rq= rqc; - if (rq->rhythmic()){ - if (the_note){ - WARN << "too many notes.\n"; - return; - } - the_note = rq; - } - break; - } -} - - -void -Rhythmic_column::typeset_command(Command *com, int breakst) -{ - Item *i = new Item; - Symbol s; - - if (com -> args[0] == "BAR" ) { - s = Lookup::bar(com->args[1]); - } else if (com->args[0] == "METER") { - Parametric_symbol *p = Lookup::meter("general"); - svec arg( com->args); - arg.del(0); - s = p->eval(arg); - } else - assert(false); - - Molecule * m =new Molecule(Atom(s)); - { - Interval wid; - svec sv(staff_->pscore_-> - select_items(staff_->theline, score_column->pcol)); - for (int j=0; joutput->extent().x); - } - if (!wid.empty()) - m->translate(Offset(wid.max,0)); - } - i->output=m; - staff_->pscore_->typeset_item(i, score_column->pcol, - staff_->theline,breakst); -} - -void -Rhythmic_column::typeset_req(Request *rq) -{ - Item *i = new Item; - Symbol s; - int dots=0; - - if (rq->note()) - s = Lookup::ball(rq->note()->balltype); - if (rq->rhythmic()) - dots=rq->rhythmic()->dots; - if (rq->rest()) - s = Lookup::rest(rq->rest()->balltype); - - Molecule *m = new Molecule(Atom(s)); - if (dots) { - Symbol d = Lookup::dots(dots); - Molecule dm; - dm.add(Atom(d)); - m->add_right(dm); - } - i->output=m; - staff_->pscore_->typeset_item(i, score_column->pcol, staff_->theline ); -} - -void -Rhythmic_staff::grant_requests() -{ - for (PCursor cc(cols); cc.ok(); cc++) { - Rhythmic_column *rp = (Rhythmic_column*)*cc; - if (rp->the_note) - rp->typeset_req( rp->the_note); - } -} - -Staff_column* -Rhythmic_staff::create_col(Score_column*s) -{ - Rhythmic_column *rc = new Rhythmic_column(s,this); - - return rc; -} - -Staff * -get_new_rhythmstaff() -{ - return new Rhythmic_staff; -} diff --git a/rhythmstaf.hh b/rhythmstaf.hh deleted file mode 100644 index 69b61ec487..0000000000 --- a/rhythmstaf.hh +++ /dev/null @@ -1,48 +0,0 @@ -/* - rhythmstaf.hh -- part of LilyPond - - (c) 1996 Han-Wen Nienhuys -*/ - -#ifndef RHYTHMSTAF_HH -#define RHYTHMSTAF_HH -#include "stcol.hh" - -struct Rhythmic_staff; - -/// column of Rhythmic_staff -struct Rhythmic_column : Staff_column { - // mega-stupido. only do notes, one at a time - Request *the_note; - Rhythmic_staff* staff_; - - /****************/ - - void typeset_req(Request *rq); - void take_request(Request *rq); - void typeset_command(Command *, int brs); - void process_commands( ); - void process_requests(); - - Rhythmic_column(Score_column*s,Rhythmic_staff*rs); -}; - - -/// simple percussion staff -struct Rhythmic_staff : Staff { - /// indirection to the PStaff. - PStaff *theline; - - /****************/ - void set_output(PScore *); - void process_commands( PCursor &where); - - void grant_requests(); - Staff_column * create_col(Score_column*); - Rhythmic_staff(); -}; - - -#endif // RHYTHMSTAF_HH - - -- 2.39.5