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) 1997--2012 Jan Nieuwenhuizen <janneke@gnu.org> | 4 Copyright (C) 1997--2012 Jan Nieuwenhuizen <janneke@gnu.org> |
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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 MAKE_SCHEME_CALLBACK (Volta_bracket_interface, print, 1); | 45 MAKE_SCHEME_CALLBACK (Volta_bracket_interface, print, 1); |
46 SCM | 46 SCM |
47 Volta_bracket_interface::print (SCM smob) | 47 Volta_bracket_interface::print (SCM smob) |
48 { | 48 { |
49 Spanner *me = unsmob_spanner (smob); | 49 Spanner *me = unsmob_spanner (smob); |
50 Spanner *orig_span = dynamic_cast<Spanner *> (me->original ()); | 50 Spanner *orig_span = dynamic_cast<Spanner *> (me->original ()); |
51 bool broken_first_bracket = orig_span && (orig_span->broken_intos_[0] | 51 bool broken_first_bracket = orig_span && (orig_span->broken_intos_[0] |
52 == (Spanner *)me); | 52 == (Spanner *)me); |
53 | 53 |
54 Output_def *layout = me->layout (); | 54 Output_def *layout = me->layout (); |
55 //Real half_space = 0.5; | |
56 | 55 |
57 Item *bound = dynamic_cast<Spanner *> (me)->get_bound (LEFT); | 56 Item *bound = dynamic_cast<Spanner *> (me)->get_bound (LEFT); |
58 | 57 |
59 /* | 58 /* |
60 If the volta bracket appears after a line-break, make | 59 If the volta bracket appears after a line-break, make |
61 it start after the prefatory matter. | 60 it start after the prefatory matter. |
62 */ | 61 */ |
63 Real left = 0.; | 62 Real left = 0.; |
64 if (bound->break_status_dir () == RIGHT) | 63 if (bound->break_status_dir () == RIGHT) |
65 { | 64 { |
(...skipping 19 matching lines...) Expand all Loading... |
85 Interval (1.0, 1.0)); | 84 Interval (1.0, 1.0)); |
86 Drul_array<Real> flare = robust_scm2interval (me->get_property ("bracket-flare
"), | 85 Drul_array<Real> flare = robust_scm2interval (me->get_property ("bracket-flare
"), |
87 Interval (0, 0)); | 86 Interval (0, 0)); |
88 Drul_array<Real> shorten = robust_scm2interval (me->get_property ("shorten-pai
r"), | 87 Drul_array<Real> shorten = robust_scm2interval (me->get_property ("shorten-pai
r"), |
89 Interval (0, 0)); | 88 Interval (0, 0)); |
90 | 89 |
91 scale_drul (&edge_height, - Real (get_grob_direction (me))); | 90 scale_drul (&edge_height, - Real (get_grob_direction (me))); |
92 | 91 |
93 Interval empty; | 92 Interval empty; |
94 Offset start; | 93 Offset start; |
95 start[X_AXIS] = me->spanner_length () - left; // - half_space; | 94 start[X_AXIS] = me->spanner_length () - left; |
96 | 95 |
97 /* | 96 /* |
98 ugh, Tuplet_bracket should use Horizontal_bracket, not the other way around. | 97 ugh, Tuplet_bracket should use Horizontal_bracket, not the other way around. |
99 */ | 98 */ |
100 Stencil total | 99 Stencil total |
101 = Tuplet_bracket::make_bracket (me, Y_AXIS, start, | 100 = Tuplet_bracket::make_bracket (me, Y_AXIS, start, |
102 edge_height, empty, flare, shorten); | 101 edge_height, empty, flare, shorten); |
103 | 102 |
104 if (!orig_span || broken_first_bracket) | 103 if (!orig_span || broken_first_bracket) |
105 { | 104 { |
(...skipping 26 matching lines...) Expand all Loading... |
132 Grob *endbar = bars.size () ? bars.back () : 0; | 131 Grob *endbar = bars.size () ? bars.back () : 0; |
133 SCM glyph = endbar ? endbar->get_property ("glyph-name") : SCM_EOL; | 132 SCM glyph = endbar ? endbar->get_property ("glyph-name") : SCM_EOL; |
134 | 133 |
135 string str; | 134 string str; |
136 if (scm_is_string (glyph)) | 135 if (scm_is_string (glyph)) |
137 str = ly_scm2string (glyph); | 136 str = ly_scm2string (glyph); |
138 else | 137 else |
139 str = "|"; | 138 str = "|"; |
140 | 139 |
141 no_vertical_end |= ly_scm2bool (scm_call_1 (ly_lily_module_constant ("volta-br
acket::calc-hook-visibility"), | 140 no_vertical_end |= ly_scm2bool (scm_call_1 (ly_lily_module_constant ("volta-br
acket::calc-hook-visibility"), |
142 ly_string2scm (str))); | 141 ly_string2scm (str))); |
143 | 142 |
144 if (no_vertical_end || no_vertical_start) | 143 if (no_vertical_end || no_vertical_start) |
145 { | 144 { |
146 Drul_array<Real> edge_height = robust_scm2interval (me->get_property ("edg
e-height"), | 145 Drul_array<Real> edge_height = robust_scm2interval (me->get_property ("edg
e-height"), |
147 Interval (1.0, 1.0)); | 146 Interval (1.0, 1.0)); |
148 if (no_vertical_start) | 147 if (no_vertical_start) |
149 edge_height[LEFT] = 0.0; | 148 edge_height[LEFT] = 0.0; |
150 | 149 |
151 if (no_vertical_end) | 150 if (no_vertical_end) |
152 edge_height[RIGHT] = 0.0; | 151 edge_height[RIGHT] = 0.0; |
(...skipping 16 matching lines...) Expand all Loading... |
169 ADD_INTERFACE (Volta_bracket_interface, | 168 ADD_INTERFACE (Volta_bracket_interface, |
170 "Volta bracket with number.", | 169 "Volta bracket with number.", |
171 | 170 |
172 /* properties */ | 171 /* properties */ |
173 "bars " | 172 "bars " |
174 "thickness " | 173 "thickness " |
175 "height " | 174 "height " |
176 "shorten-pair " | 175 "shorten-pair " |
177 ); | 176 ); |
178 | 177 |
LEFT | RIGHT |