# sourcefiles to be shipped. Also for dependencies
hdr= qlp.hh linespace.hh qlpsolve.hh\
- pcol.hh proto.hh pstaff.hh line.hh\
+ pcol.hh proto.hh pstaff.hh scoreline.hh staffline.hh\
const.hh glob.hh molecule.hh boxes.hh pscore.hh item.hh tex.hh\
request.hh voice.hh command.hh staff.hh linestaff.hh \
tstream.hh rhythmstaff.hh\
parseconstruct.hh debug.hh globvars.hh keyword.hh\
misc.hh score.hh notename.hh lexer.hh symtable.hh\
- symbol.hh main.hh dimen.hh paper.hh lookupsyms.hh\
+ symbol.hh main.hh dimen.hh paper.hh lookup.hh\
sccol.hh stcol.hh scommands.hh melodicstaff.hh\
identifier.hh simplestaff.hh spanner.hh stem.hh\
- notehead.hh
+ notehead.hh leastsquares.hh beam.hh rest.hh\
+ swalker.hh bar.hh meter.hh
mycc= qlp.cc qlpsolve.cc \
- break.cc linespace.cc molecule.cc line.cc\
- pscore.cc tex.cc item.cc pcol.cc staff.cc rhythmstaff.cc\
- score.cc note.cc main.cc misc.cc \
+ break.cc linespace.cc molecule.cc staffline.cc\
+ pscore.cc tex.cc item.cc pcol.cc staff.cc \
+ rhythmstaff.cc score.cc note.cc main.cc misc.cc\
symbol.cc request.cc notename.cc voice.cc\
keyword.cc linestaff.cc table.cc command.cc\
warn.cc debug.cc symtable.cc boxes.cc\
pstaff.cc tstream.cc\
calcideal.cc scores.cc identifier.cc \
- dimen.cc paper.cc lookupsyms.cc scommands.cc\
+ dimen.cc paper.cc lookup.cc scommands.cc\
sccol.cc stcol.cc getcommands.cc simplestaff.cc\
melodicstaff.cc simpleprint.cc stem.cc\
- spanner.cc notehead.cc\
+ spanner.cc notehead.cc leastsquares.cc beam.cc\
+ texbeam.cc rest.cc swalker.cc scoreline.cc\
+ simplewalker.cc bar.cc meter.cc\
template1.cc template2.cc template3.cc\
version.cc
\ No newline at end of file
--- /dev/null
+dist:
+ ln Makefile $(DDIR)/objects/
\ No newline at end of file
--- /dev/null
+#include "linestaff.hh"
+#include "symbol.hh"
+#include "lookup.hh"
+#include "dimen.hh"
+#include "paper.hh"
+#include "pscore.hh"
+
+Linestaff::Linestaff(int l, PScore *s)
+ : PStaff(s)
+{
+ nolines = l;
+ stafsym = s->paper_->lookup_->linestaff(l);
+}
+
+Symbol
+Linestaff::get_stafsym(Real width)const
+{
+ String w(print_dimen(width));
+ return stafsym->eval(w);
+}
--- /dev/null
+#include "lookup.hh"
+#include "debug.hh"
+#include "symtable.hh"
+#include "dimen.hh"
+#include "tex.hh"
+
+void
+Lookup::parse(Text_db&t)
+{
+ symtables_->read(t) ;
+}
+
+Lookup::Lookup()
+{
+ symtables_ = new Symtables;
+}
+
+Lookup::~Lookup()
+{
+ delete symtables_;
+}
+
+Symbol
+Lookup::ball(int j)
+{
+ if (j > 4)
+ j = 4;
+
+ Symtable * st = (*symtables_)("balls");
+ return st->lookup(String(j));
+}
+
+Symbol
+Lookup::rest(int j)
+{
+ return (*symtables_)("rests")->lookup(String(j));
+}
+
+
+Symbol
+Lookup::bar(String s)
+{
+ return (*symtables_)("bars")->lookup(s);
+}
+ Symbol
+Lookup::dots(int j)
+{
+ if (j>3)
+ error("max 3 dots");
+ return (*symtables_)("dots")->lookup(j);
+}
+
+Symbol
+Lookup::flag(int j)
+{
+ return (*symtables_)("flags")->lookup(j);
+}
+
+Symbol
+Lookup::streepjes(int i)
+{
+ assert(i);
+
+ int arg;
+ String idx ;
+ if (i<0) {
+ idx = "botlines";
+ arg = -i;
+ }else {
+ arg = i;
+ idx = "toplines";
+ }
+ Symbol ret = (*symtables_)("streepjes")->lookup(idx);
+
+ svec<String> a;
+ a.add(arg);
+ ret.tex = substitute_args(ret.tex, a);
+
+ return ret;
+}
+
+/****************************************************************/
+// bare bones.
+
+struct Linestaf_symbol : Parametric_symbol {
+ int lines;
+ Linestaf_symbol(int n, Symtables*s): Parametric_symbol(s) { lines = n;}
+ Symbol eval(svec<String>)const;
+};
+
+
+Symbol
+Linestaf_symbol::eval(svec<String> w)const
+{
+ Real wid = w[0].fvalue();
+
+ Symbol s;
+ s.dim.x = Interval(0,wid);
+ Real dy=(lines-1)*convert_dimen(5,"pt"); // TODO!
+ s.dim.y = Interval(0,dy);
+ svec<String> a;
+ a.add(lines);
+ a.add(w[0]);
+ s.tex = (*symtables_)("param")->lookup("linestaf").tex;
+ s.tex = substitute_args(s.tex, a);
+ return s;
+}
+
+/****************************************************************/
+
+
+struct Meter_sym:Parametric_symbol {
+
+ Meter_sym(Symtables*s) : Parametric_symbol(s){ }
+ Symbol eval(svec<String> a) const{
+ Symbol s;
+ s.dim.x = Interval( convert_dimen(-5,"pt"),
+ convert_dimen(5,"pt"));
+ s.dim.y = Interval(0, convert_dimen(10,"pt") ); // todo
+ String src = (*symtables_)("param")->lookup("meter").tex;
+ s.tex = substitute_args(src,a);
+ return s;
+ }
+};
+/****************************************************************/
+
+struct Stem_sym:Parametric_symbol {
+
+ Stem_sym(Symtables*s) : Parametric_symbol(s) { }
+ Symbol eval(svec<String> a) const {
+ Real y1 = a[0].fvalue();
+ Real y2 = a[1].fvalue();
+ assert(y1 <= y2);
+ Symbol s;
+ s.dim.x = Interval(0,0);
+ s.dim.y = Interval(y1,y2);
+
+ String src = (*symtables_)("param")->lookup("stem").tex;
+ s.tex = substitute_args(src,a);
+ return s;
+ }
+};
+
+Parametric_symbol *
+Lookup::meter(String )
+{
+ return new Meter_sym(symtables_);
+}
+
+Parametric_symbol *
+Lookup::linestaff(int n)
+{
+ return new Linestaf_symbol(n,symtables_);
+}
+
+Parametric_symbol*
+Lookup::stem()
+{
+ return new Stem_sym(symtables_);
+}
--- /dev/null
+#include "lookup.hh"
+#include "request.hh"
+#include "beam.hh"
+#include "pscore.hh"
+#include "paper.hh"
+#include "simplestaff.hh"
+#include "molecule.hh"
+#include "sccol.hh"
+#include "stem.hh"
+#include "notehead.hh"
+#include "rest.hh"
+#include "debug.hh"
+#include "bar.hh"
+#include "meter.hh"
+
+Item *
+Simple_staff::get_TYPESET_item(Command *com)
+{
+ Item *s;
+ if (com -> args[0] == "BAR" ) {
+ s = new Bar(com->args[1]);
+ } else if (com->args[0] == "METER") {
+ svec<String> arg( com->args);
+ arg.del(0);
+ s = new Meter(arg);
+ } else
+ assert(false);
+
+ return s;
+}
+
+void
+Simple_column::typeset_item(Item *i, int breakst)
+{
+ assert(i);
+ // ugh
+ staff_->pscore_->typeset_item(i, score_column->pcol,
+ staff_->theline,breakst);
+}
+
+void
+Simple_staff::set_output(PScore* ps )
+{
+ pscore_ = ps;
+ pscore_->add(theline);
+}
+
+
+Rest*
+Simple_staff::get_rest(Rest_req*rq)
+{
+ int b = rq->rhythmic()->balltype;
+ int d = rq->rhythmic()->dots;
+ return new Rest(b, d);
+}