X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Ftemplate5.cc;h=3584173cc6424ac21267bc675aecbe57fbc4f283;hb=5b2bdf8c532aa1b4aa8626f6847938f2ef4ba1be;hp=1c1d15d1f6879ae02d559bffb804c178833dd654;hpb=75eebcb49e52d296b1da3e1074e0825d2c780db4;p=lilypond.git diff --git a/lily/template5.cc b/lily/template5.cc index 1c1d15d1f6..3584173cc6 100644 --- a/lily/template5.cc +++ b/lily/template5.cc @@ -3,10 +3,12 @@ source file of the GNU LilyPond music typesetter - (c) 1997--2006 Han-Wen Nienhuys + (c) 1997--2008 Han-Wen Nienhuys */ #include "moment.hh" +#include "real.hh" +#include "interval.hh" #include "interval.tcc" @@ -19,11 +21,41 @@ Interval_t::infinity () return infty; } + template<> -String +string Interval_t::T_to_string (Rational a) { return a.to_string (); } template INTERVAL__INSTANTIATE (Rational); + + +template<> +Moment +Interval_t::infinity () +{ + Moment infty; + + infty.main_part_.set_infinite (1); + return infty; +} + + +template<> +string +Interval_t::T_to_string (Moment a) +{ + return a.to_string (); +} + +template INTERVAL__INSTANTIATE (Moment); + +template<> +Real +Interval_t::linear_combination (Real x) const +{ + Drul_array da (at (LEFT), at (RIGHT)); + return ::linear_combination (da, x); +}