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