LEFT | RIGHT |
(no file at all) | |
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) 2011 Mike Solomon <mike@apollinemike.com> | 4 Copyright (C) 2011 Mike Solomon <mike@apollinemike.com> |
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 11 matching lines...) Expand all Loading... |
22 | 22 |
23 #include "align-interface.hh" | 23 #include "align-interface.hh" |
24 #include "bar-line.hh" | 24 #include "bar-line.hh" |
25 #include "context.hh" | 25 #include "context.hh" |
26 #include "grob.hh" | 26 #include "grob.hh" |
27 #include "item.hh" | 27 #include "item.hh" |
28 #include "pointer-group-interface.hh" | 28 #include "pointer-group-interface.hh" |
29 #include "span-bar.hh" | 29 #include "span-bar.hh" |
30 #include "engraver.hh" | 30 #include "engraver.hh" |
31 | 31 |
| 32 /* |
| 33 Note that span bar stubs exist for pure height calculations ONLY. |
| 34 They should never be visually present on the page and should never |
| 35 be engraved in contexts where BarLines are engraved. |
| 36 */ |
| 37 |
32 class Span_bar_stub_engraver : public Engraver | 38 class Span_bar_stub_engraver : public Engraver |
33 { | 39 { |
34 vector<Grob *> spanbars_; | 40 vector<Grob *> spanbars_; |
35 map<Grob *, Context *> axis_groups_; | 41 map<Grob *, Context *> axis_groups_; |
36 | 42 |
37 public: | 43 public: |
38 TRANSLATOR_DECLARATIONS (Span_bar_stub_engraver); | 44 TRANSLATOR_DECLARATIONS (Span_bar_stub_engraver); |
39 protected: | 45 protected: |
40 DECLARE_ACKNOWLEDGER (span_bar); | 46 DECLARE_ACKNOWLEDGER (span_bar); |
41 DECLARE_ACKNOWLEDGER (hara_kiri_group_spanner); | 47 DECLARE_ACKNOWLEDGER (hara_kiri_group_spanner); |
42 void process_acknowledged (); | 48 void process_acknowledged (); |
43 }; | 49 }; |
44 | 50 |
45 Span_bar_stub_engraver::Span_bar_stub_engraver () | 51 Span_bar_stub_engraver::Span_bar_stub_engraver () |
46 { | 52 { |
47 } | 53 } |
48 | 54 |
49 void | 55 void |
50 Span_bar_stub_engraver::acknowledge_span_bar (Grob_info i) | 56 Span_bar_stub_engraver::acknowledge_span_bar (Grob_info i) |
51 { | 57 { |
52 spanbars_.push_back (i.grob ()); | 58 spanbars_.push_back (i.grob ()); |
53 } | 59 } |
54 | |
55 // note that this can get out of hand if there are lots of vertical axis groups.
.. | |
56 | 60 |
57 void | 61 void |
58 Span_bar_stub_engraver::acknowledge_hara_kiri_group_spanner (Grob_info i) | 62 Span_bar_stub_engraver::acknowledge_hara_kiri_group_spanner (Grob_info i) |
59 { | 63 { |
60 axis_groups_[i.grob ()] = i.context (); | 64 axis_groups_[i.grob ()] = i.context (); |
61 } | 65 } |
62 | 66 |
63 void | 67 void |
64 Span_bar_stub_engraver::process_acknowledged () | 68 Span_bar_stub_engraver::process_acknowledged () |
65 { | 69 { |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 reverse (y_parents); // from bottom to top | 115 reverse (y_parents); // from bottom to top |
112 reverse (keep_extent); // from bottom to top | 116 reverse (keep_extent); // from bottom to top |
113 for (vsize j = 0; j < affected_contexts.size (); j++) | 117 for (vsize j = 0; j < affected_contexts.size (); j++) |
114 { | 118 { |
115 Item *it = new Item (updated_grob_properties (affected_contexts[j], ly
_symbol2scm ("SpanBarStub"))); | 119 Item *it = new Item (updated_grob_properties (affected_contexts[j], ly
_symbol2scm ("SpanBarStub"))); |
116 it->set_parent (spanbars_[i], X_AXIS); | 120 it->set_parent (spanbars_[i], X_AXIS); |
117 Grob_info gi = make_grob_info (it, spanbars_[i]->self_scm ()); | 121 Grob_info gi = make_grob_info (it, spanbars_[i]->self_scm ()); |
118 gi.rerouting_daddy_context_ = affected_contexts[j]; | 122 gi.rerouting_daddy_context_ = affected_contexts[j]; |
119 announce_grob (gi); | 123 announce_grob (gi); |
120 if (!keep_extent[j]) | 124 if (!keep_extent[j]) |
121 it->set_property ("Y-extent", ly_interval2scm (Interval (infinity_f,
-infinity_f))); | 125 it->suicide ();//it->set_property ("Y-extent", ly_interval2scm (Inte
rval (infinity_f, -infinity_f))); |
122 } | 126 } |
123 } | 127 } |
124 spanbars_.clear (); | 128 spanbars_.clear (); |
125 } | 129 } |
126 | 130 |
127 #include "translator.icc" | 131 #include "translator.icc" |
128 | 132 |
129 ADD_ACKNOWLEDGER (Span_bar_stub_engraver, span_bar); | 133 ADD_ACKNOWLEDGER (Span_bar_stub_engraver, span_bar); |
130 ADD_ACKNOWLEDGER (Span_bar_stub_engraver, hara_kiri_group_spanner); | 134 ADD_ACKNOWLEDGER (Span_bar_stub_engraver, hara_kiri_group_spanner); |
131 ADD_TRANSLATOR (Span_bar_stub_engraver, | 135 ADD_TRANSLATOR (Span_bar_stub_engraver, |
132 /* doc */ | 136 /* doc */ |
133 "Make stubs for span bars in all contexts that the span bars cro
ss.", | 137 "Make stubs for span bars in all contexts that the span bars cro
ss.", |
134 | 138 |
135 /* create */ | 139 /* create */ |
136 "SpanBarStub ", | 140 "SpanBarStub ", |
137 | 141 |
138 /* read */ | 142 /* read */ |
139 "", | 143 "", |
140 | 144 |
141 /* write */ | 145 /* write */ |
142 "" | 146 "" |
143 ); | 147 ); |
LEFT | RIGHT |