OLD | NEW |
1 /* | 1 /* |
2 This file is part of LilyPond, the GNU music typesetter. | 2 This file is part of LilyPond, the GNU music typesetter. |
3 | 3 |
4 Copyright (C) 1999--2015 Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 Copyright (C) 1999--2015 Han-Wen Nienhuys <hanwen@xs4all.nl> |
5 | 5 |
6 LilyPond is free software: you can redistribute it and/or modify | 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 | 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 | 8 the Free Software Foundation, either version 3 of the License, or |
9 (at your option) any later version. | 9 (at your option) any later version. |
10 | 10 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 { | 52 { |
53 scm_puts ("#<Mom ", port); | 53 scm_puts ("#<Mom ", port); |
54 string str = to_string (); | 54 string str = to_string (); |
55 scm_puts ((char *)str.c_str (), port); | 55 scm_puts ((char *)str.c_str (), port); |
56 scm_puts (">", port); | 56 scm_puts (">", port); |
57 | 57 |
58 return 1; | 58 return 1; |
59 } | 59 } |
60 | 60 |
61 SCM | 61 SCM |
62 Moment::as_scheme () const | |
63 { | |
64 return scm_list_5 (ly_symbol2scm ("ly:make-moment"), | |
65 scm_from_int64 (main_part_.num ()), | |
66 scm_from_int64 (main_part_.den ()), | |
67 scm_from_int64 (grace_part_.num ()), | |
68 scm_from_int64 (grace_part_.den ())); | |
69 } | |
70 | |
71 SCM | |
72 Moment::equal_p (SCM a, SCM b) | 62 Moment::equal_p (SCM a, SCM b) |
73 { | 63 { |
74 Moment *m1 = unsmob<Moment> (a); | 64 Moment *m1 = unsmob<Moment> (a); |
75 Moment *m2 = unsmob<Moment> (b); | 65 Moment *m2 = unsmob<Moment> (b); |
76 | 66 |
77 return (*m1 == *m2) ? SCM_BOOL_T : SCM_BOOL_F; | 67 return (*m1 == *m2) ? SCM_BOOL_T : SCM_BOOL_F; |
78 } | 68 } |
79 | 69 |
80 int | 70 int |
81 compare (Moment const &a, Moment const &b) | 71 compare (Moment const &a, Moment const &b) |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 return d; | 181 return d; |
192 else | 182 else |
193 return *p; | 183 return *p; |
194 } | 184 } |
195 | 185 |
196 bool | 186 bool |
197 moment_less (SCM a, SCM b) | 187 moment_less (SCM a, SCM b) |
198 { | 188 { |
199 return *unsmob<Moment> (a) < *unsmob<Moment> (b); | 189 return *unsmob<Moment> (a) < *unsmob<Moment> (b); |
200 } | 190 } |
OLD | NEW |