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 Drul_array
<bool> expansions(false,false);
35 if (at (LEFT
).tone_pitch () > p
.tone_pitch ())
38 expansions
[LEFT
] = true;
40 if (at (RIGHT
).tone_pitch () < p
.tone_pitch ())
43 expansions
[RIGHT
] = true;
49 Pitch_lexicographic_interval::Pitch_lexicographic_interval (Pitch p1
, Pitch p2
)
55 Pitch_lexicographic_interval::Pitch_lexicographic_interval ()
57 at (LEFT
) = Pitch (100, 0, 0);
58 at (RIGHT
) = Pitch (-100, 0, 0);
62 Pitch_lexicographic_interval::is_empty () const
64 return at (LEFT
) > at (RIGHT
);
68 Pitch_lexicographic_interval::add_point (Pitch p
)
70 Drul_array
<bool> expansions(false,false);
74 expansions
[LEFT
] = true;
79 expansions
[RIGHT
] = true;