]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.30
authorfred <fred>
Sun, 24 Mar 2002 19:31:02 +0000 (19:31 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:31:02 +0000 (19:31 +0000)
src/dimen.cc
src/lookup.cc

index eb53756b45201a60689f3cbb1cda4045edf4d2a5..93077bd87b5b92e81ee4d05fd4739683ff2b5fa0 100644 (file)
@@ -15,7 +15,6 @@ parse_dimen(String dim)
     return convert_dimen(dim.fvalue(), unit); 
 }
 
-const Real CM_TO_PT=72/2.54;
 
 Real
 convert_dimen(Real quant, String unit)
@@ -27,7 +26,7 @@ convert_dimen(Real quant, String unit)
     if (unit == "mm")
        return quant*CM_TO_PT/10;
     if (unit == "in")
-       return quant * 72;
+       return quant * INCH_TO_PT;
     error ("unknown length unit: `" + unit+"'");
 }
 
index be3466e092458ed7e92ba204d29c410e1b7fd188..96932e00234d9546ad894b8f5bfe8a878499f47b 100644 (file)
@@ -42,7 +42,7 @@ Lookup::text(String style, String text, int dir)
     return s;
 }
 
-/****************/
+/* *************** */
 
 Real
 Lookup::internote()
@@ -137,7 +137,21 @@ Lookup::streepjes(int i)
     return ret;
 }
 
-
+Symbol
+Lookup::hairpin(Real &wid, bool decresc)
+{
+    int idx = rint(wid / 6 PT);
+    if(!idx) idx ++;
+    wid = idx*6 PT;
+    String idxstr = (decresc)? "decrescendosym" : "crescendosym";
+    Symbol ret=(*symtables_)("param")->lookup(idxstr);
+       
+    Array<String> a;
+    a.push(idx);
+    ret.tex = substitute_args(ret.tex, a);
+    ret.dim.x = Interval(0,wid);
+    return ret;
+}
 
 Symbol
 Lookup::linestaff(int lines, Real wid) 
@@ -162,9 +176,8 @@ Symbol
 Lookup::meter(Array<Scalar> 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
+    s.dim.x = Interval( 0 PT, 10 PT);
+    s.dim.y = Interval(0, 20 PT);      // todo
     String src = (*symtables_)("param")->lookup("meter").tex;
     s.tex = substitute_args(src,a);
     return s;