2 pitch-interval.cc -- implement Pitch_interval
4 source file of the GNU LilyPond music typesetter
6 (c) 2004--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
9 #include "pitch-interval.hh"
11 #include "interval.tcc"
13 Pitch_interval::Pitch_interval (Pitch p1, Pitch p2)
16 elem_ref (RIGHT) = p2;
19 Pitch_interval::Pitch_interval ()
21 elem_ref (LEFT) = Pitch (100, 0, 0);
22 elem_ref (RIGHT) = Pitch (-100, 0, 0);
26 Pitch_interval::is_empty () const
28 return elem (LEFT) > elem (RIGHT);
32 Pitch_interval::add_point (Pitch p)
34 if (elem_ref (LEFT) > p)
36 if (elem_ref (RIGHT) < p)