]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.4
authorfred <fred>
Mon, 21 Oct 1996 22:00:58 +0000 (22:00 +0000)
committerfred <fred>
Mon, 21 Oct 1996 22:00:58 +0000 (22:00 +0000)
linestaff.hh
lookupsyms.cc [new file with mode: 0644]
pstaff.hh

index 7ca34f5739aa59d7a3358d92f80d620b06f31e4a..33e9d39f4e0d2409205ebc592fc1a119d4015375 100644 (file)
@@ -1,8 +1,10 @@
 #include "pstaff.hh"
 
 struct Linestaff : PStaff {
-    int nolines;
     
+    int nolines;
+
+    Symbol get_stafsym(Real width)const;
     Linestaff(int);
     
 };
diff --git a/lookupsyms.cc b/lookupsyms.cc
new file mode 100644 (file)
index 0000000..66cbd6d
--- /dev/null
@@ -0,0 +1,91 @@
+#include "lookupsyms.hh"
+#include "debug.hh"
+#include "symtable.hh"
+#include "dimen.hh"
+#include "tex.hh"
+
+Symtables the_sym_tables("symbol.ini");
+
+Symbol
+Lookup::ball(int j)
+{
+    if (j > 4) j = 4;
+    Symtable * st = the_sym_tables("balls");
+    return st->lookup(String(j));
+}
+
+Symbol
+Lookup::rest(int j)
+{
+    return the_sym_tables("rests")->lookup(String(j));
+}
+
+
+ Symbol
+Lookup::bar(String s)
+{
+    return the_sym_tables("bars")->lookup(s);
+}
+ Symbol
+Lookup::dots(int j)
+{
+    if (j>3)
+       error("max 3 dots");
+    return the_sym_tables("dots")->lookup(j);
+}
+
+/****************************************************************/
+// bare bones.
+
+struct Linestaf_symbol : Parametric_symbol {
+    int lines;
+    Linestaf_symbol(int n) { 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);
+    s.dim.y = Interval(0, lines*convert_dimen(5,"pt"));
+    svec<String> a;
+    a.add(lines);
+    a.add(w[0]);
+    s.tex = the_sym_tables("param")->lookup("linestaf").tex;
+    s.tex = substitute_args(s.tex, a);
+    return s;
+}
+
+/****************************************************************
+ */
+
+
+struct Meter_sym:Parametric_symbol {
+
+    Symbol eval(svec<String> a) const{
+       Symbol s;
+       s.dim.x = Interval(0, convert_dimen(10,"pt"));
+       s.dim.y = Interval(0, convert_dimen(10,"pt") ); 
+       String src = the_sym_tables("param")->lookup("meter").tex;
+       s.tex = substitute_args(src,a);
+       return s;
+    }
+};
+/****************************************************************/
+
+Parametric_symbol *
+Lookup::meter(String )
+{
+    return new Meter_sym;
+}
+
+Parametric_symbol *
+Lookup::linestaff(int n)
+{
+    return new Linestaf_symbol(n);
+}
+
index de535a6518230599223d76325ca5390a68efb171..8d17b9dd194c00d72cd0002d148dbd9eaa5fcd2b 100644 (file)
--- a/pstaff.hh
+++ b/pstaff.hh
@@ -3,11 +3,15 @@
 
 #include "list.hh"
 #include "item.hh"
+#include "symbol.hh"
 
 /// items grouped vertically.
 class PStaff {
+
 public:
-    Stretchable_symbol *stafsym;
+    Parametric_symbol *stafsym;
+    virtual Symbol get_stafsym(Real width)const=0; // mayybe overkill
+
     List<const Spanner*> spans;
     List<Item*> its;