X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Ftemplate5.cc;h=b669abb8994ef59bdbc51216cff3752c293233cb;hb=d03883358e67bb40a80a49dfc703db69dd362f25;hp=d2581833b634cc307a29a2a19e29c883c81fdccb;hpb=bf898a6f737ebdd6a749ea0a14d1056a3566a10e;p=lilypond.git diff --git a/lily/template5.cc b/lily/template5.cc index d2581833b6..b669abb899 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--2007 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<> -Std_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); +}