2 duration.cc -- implement Duration, Plet,
4 source file of the LilyPond music typesetter
6 (c) 1997--1999 Jan Nieuwenhuizen <janneke@gnu.org>
7 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 UGH. Duration is broken.
17 #include "source-file.hh"
19 #include "rational.hh"
20 #include "duration.hh"
21 #include "duration-convert.hh"
22 #include "duration-iter.hh"
25 int Duration::division_1_i_s
= 384 * 4;
36 Duration::duration_type_b (int t
)
39 ugh. Assuming behavior of conversion funcs on broken input.
41 return t
== Duration_convert::type2_i (Duration_convert::i2_type (t
));
45 Duration::compress (Rational m
)
47 plet_
.iso_i_
*= m
.num_i ();
48 plet_
.type_i_
*= m
.den_i ();
52 Duration::length_mom () const
54 return Duration_convert::dur2_mom (*this);
58 Duration::set_plet (int i
, int t
)
66 Duration::set_plet (Duration d)
68 plet_.iso_i_ = d.plet_.iso_i_;
69 plet_.type_i_ = d.plet_.type_i_;
74 Duration::set_ticks (int ticks_i
)
76 assert (durlog_i_
<10);
82 Duration::str () const
84 return Duration_convert::dur2_str (*this);
91 return !plet_
.unit_b ();