From: fred Date: Sat, 2 Nov 1996 01:47:00 +0000 (+0000) Subject: lilypond-0.0.6 X-Git-Tag: release/1.5.59~6951 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=5a43ebde7fe090b27fec064dc9b57ddd4a3476e6;p=lilypond.git lilypond-0.0.6 --- diff --git a/melodicstaff.hh b/melodicstaff.hh new file mode 100644 index 0000000000..a91a413659 --- /dev/null +++ b/melodicstaff.hh @@ -0,0 +1,31 @@ +/* + rhythmstaf.hh -- part of LilyPond + + (c) 1996 Han-Wen Nienhuys +*/ + +#ifndef MELODICSTAFF_HH +#define MELODICSTAFF_HH + +#include "simplestaff.hh" + +/// five line staff, no multiple voices +struct Melodic_staff : public Simple_staff +{ + Staff_column * create_col(Score_column*); + virtual void set_output(PScore *); + virtual Melodic_staff*clone()const; +}; + +struct Melodic_column : public Simple_column { + virtual void typeset_req(Request *rq); + virtual void typeset_command(Command *, int brs); + // virtual void typeset_item(Item*, int=1); + Melodic_column(Score_column*s,Simple_staff*rs) : + Simple_column(s,rs) { } +// virtual Melodic_column*clone()const; +}; + +#endif // MELODICSTAFF_HH + + diff --git a/simpleprint.cc b/simpleprint.cc new file mode 100644 index 0000000000..91b7761738 --- /dev/null +++ b/simpleprint.cc @@ -0,0 +1,79 @@ +#include "lookupsyms.hh" +#include "request.hh" +#include "pscore.hh" +#include "paper.hh" +#include "simplestaff.hh" +#include "molecule.hh" +#include "sccol.hh" + +Item * +Simple_column::create_req_item(Request *rq) +{ + Item *i = new Item; + Symbol s; + int dots=0; + + if (rq->note()) + s = staff_->paper()->lookup_->ball(rq->note()->balltype); + else if (rq->rest()) + s = staff_->paper()->lookup_->rest(rq->rest()->balltype); + + if (rq->rhythmic()) + dots=rq->rhythmic()->dots; + + + Molecule *m = new Molecule(Atom(s)); + if (dots) { + Symbol d = staff_->paper()->lookup_->dots(dots); + Molecule dm; + dm.add(Atom(d)); + m->add_right(dm); + } + i->output=m; + return i; +} +Item * +Simple_column::create_command_item(Command *com) +{ + Item *i = new Item; + Symbol s; + + if (com -> args[0] == "BAR" ) { + s = staff_->paper()->lookup_->bar(com->args[1]); + } else if (com->args[0] == "METER") { + Parametric_symbol *p = staff_->paper()->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; + return i; +} + +void +Simple_column::typeset_item(Item *i, int breakst) +{ + // ugh + staff_->pscore_->typeset_item(i, score_column->pcol, + staff_->theline,breakst); +} + +void +Simple_staff::set_output(PScore* ps ) +{ + pscore_ = ps; + pscore_->add(theline); +}