]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.20
authorfred <fred>
Sun, 24 Mar 2002 19:26:57 +0000 (19:26 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:26:57 +0000 (19:26 +0000)
hdr/misc.hh
src/mylexer.cc
src/notehead.cc
src/pcol.cc
src/texslur.cc

index 376f048c0ecb2b83260f9e0eda0994a2b6a8f139..fa8787674814708e5495751e033da6e94ebc15f3 100644 (file)
@@ -2,16 +2,22 @@
 #define MISC_HH
 
 #include "real.hh"
+#include "moment.hh"
 
-Real wholes(int dur, int dots);
+Moment wholes(int dur, int dots);
     
 double log_2(double x) ;
 int intlog2(int d);
 inline int
-ABS(int i)
-{
+abs(int i){
     return (i < 0)?-i:i;
 }
+inline int
+sign(int i) {
+    if (i<0) return -1;
+    else if (i) return 1;
+    else return 0;
+}
 
 
 #endif
index 0a912e33897147bd0cdff691a89962061cef796e..699a46d9faceee80fe2a55883af9c88770502c63 100644 (file)
@@ -1,3 +1,4 @@
+#include "interval.hh"
 #include "identparent.hh"
 #include "associter.hh"
 #include "lexer.hh"
index 88cb621181307e9f3f328d39a465af37218363cd..203c5928300ba70ce5dfd5ba5b80b982a7907a68 100644 (file)
@@ -1,3 +1,5 @@
+#include "misc.hh"
+
 #include "notehead.hh"
 #include "dimen.hh" 
 #include "debug.hh"
@@ -60,7 +62,7 @@ Notehead::brew_molecole()
     output->translate(Offset(x_dir * p->note_width(),0));
     bool streepjes = (position<-1)||(position > staff_size+1);
     if (streepjes) {
-       int dir = sgn(position);
+       int dir = sign(position);
        int s =(position<-1) ? -((-position)/2): (position-staff_size)/2;
        Symbol str = p->lookup_->streepjes(s);
        Molecule sm;
index 951be6fa5f612e38f109962f1f066674bf015b03..7dc4c22c5ab3dbc3696a93f70e50938409881dc3 100644 (file)
@@ -43,7 +43,7 @@ PCol::print() const
     } else if (daddy) {
        mtor<<'\n' << ((this == daddy->prebreak) ? "prebreak" : "postbreak");
     }
-    mtor << "extent: " << width().min << ", " << width().max << "\n";
+    mtor << "extent: " << width().str() << "\n";
     mtor << "}\n";
 #endif 
 }
index eab9822940842a201bc1660efc10047fc42371b8..a58a2cf94ca6169529e7d37f340ec8f18022cb2d 100644 (file)
@@ -1,5 +1,5 @@
 #include <math.h>
-
+#include "misc.hh"
 #include "lookup.hh"
 #include "molecule.hh"
 #include "dimen.hh"
@@ -39,7 +39,7 @@ Lookup::half_slur_middlepart(Real &dx, int dir)
 
     Symbol s;
     
-    s.dim.y = Interval(MIN(0,0), MAX(0,0));
+    s.dim.y = Interval(min(0,0), max(0,0));
     s.dim.x = Interval(0,dx);
 
     String f =  String("\\hslurchar");
@@ -81,7 +81,7 @@ Lookup::half_slur(int dy, Real &dx, int dir, int xpart)
        
     Symbol s;
     s.dim.x = Interval(0,dx);
-    s.dim.y = Interval(MIN(0,dy), MAX(0,dy));
+    s.dim.y = Interval(min(0,dy), max(0,dy));
 
 
     String f = String("\\hslurchar");
@@ -111,7 +111,7 @@ Symbol
 Lookup::slur (int dy , Real &dx, int dir)
 {                              // ugh. assuming pt here.
     assert(dx >=0);
-    int y_sign = sgn(dy);
+    int y_sign = sign(dy);
 
     bool large = dy > 16;
 
@@ -142,7 +142,7 @@ Lookup::slur (int dy , Real &dx, int dir)
     
     Symbol s;
     s.dim.x = Interval(0,dx);
-    s.dim.y = Interval(MIN(0,dy), MAX(0,dy));
+    s.dim.y = Interval(min(0,dy), max(0,dy));
 
     String f = String("\\slurchar") + direction_char(y_sign);
 
@@ -173,7 +173,7 @@ Symbol
 Lookup::big_slur(int dy , Real &dx, int dir)
 {
     assert(dx >= convert_dimen(24,"pt"));
-    Real slur_extra =ABS(dy)  /2.0 + 2; 
+    Real slur_extra =abs(dy)  /2.0 + 2; 
     int l_dy = int(Real (dy)/2 + slur_extra*dir);
     int r_dy =  dy - l_dy;