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--2011 Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 Copyright (C) 1997--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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 stem_ = 0; | 57 stem_ = 0; |
58 tremolo_ = 0; | 58 tremolo_ = 0; |
59 rhythmic_ev_ = 0; | 59 rhythmic_ev_ = 0; |
60 } | 60 } |
61 | 61 |
62 void | 62 void |
63 Stem_engraver::make_stem (Grob_info gi) | 63 Stem_engraver::make_stem (Grob_info gi) |
64 { | 64 { |
65 /* Announce the cause of the head as cause of the stem. The | 65 /* Announce the cause of the head as cause of the stem. The |
66 stem needs a rhythmic structure to fit it into a beam. */ | 66 stem needs a rhythmic structure to fit it into a beam. */ |
67 stem_ = make_item ("Stem", gi.grob ()->self_scm ()); | 67 stem_ = make_item (to_boolean (get_property ("glissandoStem")) ? "GlissandoSte
m" : "Stem", gi.grob ()->self_scm ()); |
68 Stream_event *ev = unsmob_stream_event (gi.grob ()->get_property ("cause")); | |
69 if (ev) | |
70 if (ly_is_procedure (ev->get_property ("glissando-stem"))) | |
71 stem_->set_property ("glissando-stem", ev->get_property ("glissando-stem")
); | |
72 | 68 |
73 if (tremolo_ev_) | 69 if (tremolo_ev_) |
74 { | 70 { |
75 /* Stem tremolo is never applied to a note by default, | 71 /* Stem tremolo is never applied to a note by default, |
76 it must be requested. But there is a default for the | 72 it must be requested. But there is a default for the |
77 tremolo value: | 73 tremolo value: |
78 | 74 |
79 c4:8 c c: | 75 c4:8 c c: |
80 | 76 |
81 the first and last (quarter) note both get one tremolo flag. */ | 77 the first and last (quarter) note both get one tremolo flag. */ |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 if (!cause) | 128 if (!cause) |
133 return; | 129 return; |
134 Duration *d = unsmob_duration (cause->get_property ("duration")); | 130 Duration *d = unsmob_duration (cause->get_property ("duration")); |
135 if (!d) | 131 if (!d) |
136 return; | 132 return; |
137 | 133 |
138 if (!stem_) | 134 if (!stem_) |
139 make_stem (gi); | 135 make_stem (gi); |
140 | 136 |
141 int ds = Stem::duration_log (stem_); | 137 int ds = Stem::duration_log (stem_); |
142 | 138 int dc = d->duration_log (); |
143 if (ds != d->duration_log ()) | 139 |
| 140 // half notes and quarter notes all have compatible stems. |
| 141 // Longas are done differently (oops?), so we can't unify |
| 142 // them with the other stemmed notes. |
| 143 if (ds == 1) |
| 144 ds = 2; |
| 145 if (dc == 1) |
| 146 dc = 2; |
| 147 // whole notes and brevis both have no stems |
| 148 if (ds == -1) |
| 149 ds = 0; |
| 150 if (dc == -1) |
| 151 dc = 0; |
| 152 |
| 153 if (ds != dc)· |
144 { | 154 { |
145 gi.event_cause ()->origin ()->warning (_f ("adding note head to incompatib
le stem (type = %d/%d)", | 155 gi.event_cause ()->origin ()->warning (_f ("adding note head to incompatib
le stem (type = %d/%d)", |
146 ds < 0 ? 1 << -ds : 1, | 156 ds < 0 ? 1 << -ds : 1, |
147 ds > 0 ? 1 << ds : 1)); | 157 ds > 0 ? 1 << ds : 1)); |
148 gi.event_cause ()->origin ()->warning (_ ("maybe input should specify poly
phonic voices")); | 158 gi.event_cause ()->origin ()->warning (_ ("maybe input should specify poly
phonic voices")); |
149 } | 159 } |
150 | 160 |
151 Stem::add_head (stem_, gi.grob ()); | 161 Stem::add_head (stem_, gi.grob ()); |
152 } | 162 } |
153 | 163 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 "StemTremolo ", | 204 "StemTremolo ", |
195 | 205 |
196 /* read */ | 206 /* read */ |
197 "tremoloFlags " | 207 "tremoloFlags " |
198 "stemLeftBeamCount " | 208 "stemLeftBeamCount " |
199 "stemRightBeamCount ", | 209 "stemRightBeamCount ", |
200 | 210 |
201 /* write */ | 211 /* write */ |
202 "" | 212 "" |
203 ); | 213 ); |
LEFT | RIGHT |