]> git.donarmstrong.com Git - lilypond.git/blob - lily/grob-pitch-tuple.cc
Merge branch 'jneeman' of git+ssh://jneem@git.sv.gnu.org/srv/git/lilypond into jneeman
[lilypond.git] / lily / grob-pitch-tuple.cc
1 /*
2   grob-pitch-tuple.cc -- implement Grob_pitch_tuple
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 2001--2006  Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
8
9 #include "grob-pitch-tuple.hh"
10
11 #include "music.hh"
12
13 int compare (Grob_pitch_tuple const &a, Grob_pitch_tuple const &b)
14 {
15   return Grob_pitch_tuple::time_compare (a, b);
16 }
17
18 Grob_pitch_tuple::Grob_pitch_tuple ()
19 {
20   head_ = 0;
21   end_ = 0;
22 }
23
24 Grob_pitch_tuple::Grob_pitch_tuple (Grob *h, Music *m, Moment mom)
25 {
26   head_ = h;
27   pitch_ = *unsmob_pitch (m->get_property ("pitch"));
28   end_ = mom;
29 }
30
31 /*
32   signed compare, should use pitch<?
33 */
34 int
35 Grob_pitch_tuple::pitch_compare (Grob_pitch_tuple const &h1,
36                                  Grob_pitch_tuple const &h2)
37 {
38   return Pitch::compare (h1.pitch_, h2.pitch_);
39 }
40
41 int
42 Grob_pitch_tuple::time_compare (Grob_pitch_tuple const &h1,
43                                 Grob_pitch_tuple const &h2)
44 {
45   return Moment::compare (h1.end_, h2.end_);
46 }