2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 2004--2010 Han-Wen Nienhuys <hanwen@xs4all.nl>
6 LilyPond is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 LilyPond is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
20 #include "pitch-interval.hh"
22 #include "interval.tcc"
24 Pitch_interval::Pitch_interval (Pitch p1
, Pitch p2
)
30 Pitch_interval::Pitch_interval ()
32 at (LEFT
) = Pitch (100, 0, 0);
33 at (RIGHT
) = Pitch (-100, 0, 0);
37 Pitch_interval::is_empty () const
39 return at (LEFT
) > at (RIGHT
);
43 Pitch_interval::add_point (Pitch p
)
45 Drul_array
<bool> expansions(false,false);
46 if (at (LEFT
).tone_pitch () > p
.tone_pitch ())
49 expansions
[LEFT
] = true;
51 if (at (RIGHT
).tone_pitch () < p
.tone_pitch ())
54 expansions
[RIGHT
] = true;
60 Pitch_lexicographic_interval::Pitch_lexicographic_interval (Pitch p1
, Pitch p2
)
66 Pitch_lexicographic_interval::Pitch_lexicographic_interval ()
68 at (LEFT
) = Pitch (100, 0, 0);
69 at (RIGHT
) = Pitch (-100, 0, 0);
73 Pitch_lexicographic_interval::is_empty () const
75 return at (LEFT
) > at (RIGHT
);
79 Pitch_lexicographic_interval::add_point (Pitch p
)
81 Drul_array
<bool> expansions(false,false);
85 expansions
[LEFT
] = true;
90 expansions
[RIGHT
] = true;