X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Finclude%2Fmisc.hh;h=abef7b96c5a9f2093e44dd6971df5617d88071af;hb=c5e0a98b86381797e94c5d01c3c9f5dfc7d11cd6;hp=0e8c148ef061c34d672c76e763cbe5055dd7e772;hpb=1a66290a98e7de8d6d41485b5b71a9f7e1fe35c7;p=lilypond.git diff --git a/lily/include/misc.hh b/lily/include/misc.hh index 0e8c148ef0..abef7b96c5 100644 --- a/lily/include/misc.hh +++ b/lily/include/misc.hh @@ -1,26 +1,44 @@ +/* + misc.hh -- declare miscellaneous functions. + + source file of the GNU LilyPond music typesetter + + (c) 2005--2007 Han-Wen Nienhuys +*/ + #ifndef MISC_HH #define MISC_HH -#include "lily-proto.hh" -#include "real.hh" -#include "moment.hh" -#include "scalar.hh" -#include "grouping.hh" +#include +using namespace std; + +#include "std-vector.hh" +#include "interval.hh" + +double log_2 (double x); +int intlog2 (int d); -Moment wholes (int dur, int dots); -double log_2(double x) ; -int intlog2(int d); inline int -abs (int i){ - return (i < 0)?-i:i; +sign (int i) +{ + if (i < 0) + return -1; + else if (i) + return 1; + else return 0; } -inline int -sign (int i) { - if (i<0) return -1; - else if (i) return 1; - else return 0; + +inline Real +linear_interpolate (Real x, Real x1, Real x2, Real y1, Real y2) +{ + return (x2 - x) / (x2 - x1) * y1 + + (x - x1) / (x2 - x1) * y2; } -Interval itemlist_width (const Array &its); +Real directed_round (Real f, Direction d); + +Real peak_around (Real epsilon, Real threshold, Real x); +string camel_case_to_lisp_identifier (string in); #endif +