LEFT | RIGHT |
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--2011 Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 Copyright (C) 1999--2011 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 26 matching lines...) Expand all Loading... |
37 } | 37 } |
38 | 38 |
39 SCM | 39 SCM |
40 Spring::equal_p (SCM a, SCM b) | 40 Spring::equal_p (SCM a, SCM b) |
41 { | 41 { |
42 return a == b ? SCM_BOOL_T : SCM_BOOL_F; | 42 return a == b ? SCM_BOOL_T : SCM_BOOL_F; |
43 } | 43 } |
44 | 44 |
45 LY_DEFINE (ly_make_spring, "ly:make-spring", | 45 LY_DEFINE (ly_make_spring, "ly:make-spring", |
46 2, 0, 0, (SCM ideal, SCM min_dist), | 46 2, 0, 0, (SCM ideal, SCM min_dist), |
47 "Make a spring. @code{ideal} is the ideal distance of the " | 47 "Make a spring. @var{ideal} is the ideal distance of the" |
48 "spring, and @code{min-dist} is the minimum distance.") | 48 " spring, and @var{min-dist} is the minimum distance.") |
49 { | 49 { |
50 LY_ASSERT_TYPE (scm_is_number, ideal, 1); | 50 LY_ASSERT_TYPE (scm_is_number, ideal, 1); |
51 LY_ASSERT_TYPE (scm_is_number, min_dist, 2); | 51 LY_ASSERT_TYPE (scm_is_number, min_dist, 2); |
52 | 52 |
53 Spring s (scm_to_double (ideal), scm_to_double (min_dist)); | 53 Spring s (scm_to_double (ideal), scm_to_double (min_dist)); |
54 | 54 |
55 return s.smobbed_copy (); | 55 return s.smobbed_copy (); |
56 } | 56 } |
57 | 57 |
| 58 LY_DEFINE (ly_spring_set_inverse_compress_strength_x, "ly:spring-set-inverse-com
press-strength!", |
| 59 2, 0, 0, (SCM spring, SCM strength), |
| 60 "Set the inverse compress @var{strength} of @var{spring}.") |
| 61 { |
| 62 LY_ASSERT_SMOB (Spring, spring, 1); |
| 63 LY_ASSERT_TYPE (scm_is_number, strength, 2); |
| 64 |
| 65 Spring *s = unsmob_spring (spring); |
| 66 s->set_inverse_compress_strength (scm_to_double (strength)); |
| 67 return s->smobbed_copy (); |
| 68 } |
| 69 |
| 70 LY_DEFINE (ly_spring_set_inverse_stretch_strength_x, "ly:spring-set-inverse-stre
tch-strength!", |
| 71 2, 0, 0, (SCM spring, SCM strength), |
| 72 "Set the inverse stretch @var{strength} of @var{spring}.") |
| 73 { |
| 74 LY_ASSERT_SMOB (Spring, spring, 1); |
| 75 LY_ASSERT_TYPE (scm_is_number, strength, 2); |
| 76 |
| 77 Spring *s = unsmob_spring (spring); |
| 78 s->set_inverse_stretch_strength (scm_to_double (strength)); |
| 79 return s->smobbed_copy (); |
| 80 } |
| 81 |
| 82 IMPLEMENT_TYPE_P (Spring, "ly:spring?"); |
LEFT | RIGHT |