#include "dimen.hh"
#include "tex.hh"
+Real
+Lookup::internote()
+{
+ return ball(4).dim.y.length()/2;
+}
+
void
Lookup::parse(Text_db&t)
{
{
return (*symtables_)("rests")->lookup(String(j));
}
+
Symbol
Lookup::accidental(int j)
{
return (*symtables_)("clefs")->lookup(s);
}
- Symbol
+Symbol
Lookup::dots(int j)
{
if (j>3)
assert(i);
int arg;
- String idx ;
- if (i<0) {
+ String idx;
+
+ if (i < 0) {
idx = "botlines";
arg = -i;
- }else {
+ } else {
arg = i;
idx = "toplines";
}
/****************************************************************/
-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(0,"pt"),
- convert_dimen(10,"pt"));
- s.dim.y = Interval(0, convert_dimen(20,"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);
+Symbol
+Lookup::meter(svec<String> a)
+{
+ Symbol s;
+ s.dim.x = Interval( convert_dimen(0,"pt"),
+ convert_dimen(10,"pt"));
+ s.dim.y = Interval(0, convert_dimen(20,"pt") ); // todo
+ String src = (*symtables_)("param")->lookup("meter").tex;
+ s.tex = substitute_args(src,a);
+ return s;
+}
- String src = (*symtables_)("param")->lookup("stem").tex;
- s.tex = substitute_args(src,a);
- return s;
- }
-};
-Parametric_symbol *
-Lookup::meter(String )
+Symbol
+Lookup::stem(Real y1,Real y2)
{
- return new Meter_sym(symtables_);
+ assert(y1 <= y2);
+ Symbol s;
+
+ s.dim.x = Interval(0,0);
+ s.dim.y = Interval(y1,y2);
+
+ svec<String> a;
+ a.add(print_dimen(y1));
+ a.add(print_dimen(y2));
+
+ String src = (*symtables_)("param")->lookup("stem").tex;
+ s.tex = substitute_args(src,a);
+ return s;
}
+
Parametric_symbol *
Lookup::linestaff(int n)
{
return new Linestaf_symbol(n,symtables_);
}
-Parametric_symbol*
-Lookup::stem()
-{
- return new Stem_sym(symtables_);
-}