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) 2004--2015 Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 Copyright (C) 2004--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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 while (hi - lo > 1); | 118 while (hi - lo > 1); |
119 | 119 |
120 return lo; | 120 return lo; |
121 } | 121 } |
122 | 122 |
123 void | 123 void |
124 Quote_iterator::construct_children () | 124 Quote_iterator::construct_children () |
125 { | 125 { |
126 Music_wrapper_iterator::construct_children (); | 126 Music_wrapper_iterator::construct_children (); |
127 | 127 |
| 128 Context *cue_context = 0; |
| 129 |
128 SCM name = get_music ()->get_property ("quoted-context-type"); | 130 SCM name = get_music ()->get_property ("quoted-context-type"); |
129 SCM id = get_music ()->get_property ("quoted-context-id"); | |
130 | |
131 if (scm_is_symbol (name)) | 131 if (scm_is_symbol (name)) |
132 { | 132 { |
133 Context *cue_context = | 133 SCM id = get_music ()->get_property ("quoted-context-id"); |
134 get_outlet ()->find_create_context (get_music ()->origin (), | 134 std::string c_id = robust_scm2string (id, ""); |
135 name, robust_scm2string (id, ""), | 135 cue_context = get_outlet ()->find_create_context (name, c_id, SCM_EOL); |
136 SCM_EOL); | 136 if (!cue_context) |
137 quote_outlet_.set_context (cue_context); | 137 { |
| 138 Input *origin = get_music ()->origin (); |
| 139 origin->warning (_f ("cannot find or create context: %s", |
| 140 Context::diagnostic_id (name, c_id).c_str ())); |
| 141 } |
138 } | 142 } |
139 else | 143 |
140 quote_outlet_.set_context (get_outlet ()->get_default_interpreter ()); | 144 if (!cue_context) |
| 145 cue_context = get_outlet ()->get_default_interpreter (); |
| 146 quote_outlet_.set_context (cue_context); |
141 | 147 |
142 event_vector_ = get_music ()->get_property ("quoted-events"); | 148 event_vector_ = get_music ()->get_property ("quoted-events"); |
143 | 149 |
144 /* | 150 /* |
145 We have to delay initting event_idx_ , since we have to | 151 We have to delay initting event_idx_ , since we have to |
146 take starting grace notes into account. Those may offset | 152 take starting grace notes into account. Those may offset |
147 event_idx_. | 153 event_idx_. |
148 */ | 154 */ |
149 event_idx_ = -1; | 155 event_idx_ = -1; |
150 } | 156 } |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 } | 288 } |
283 quote_outlet_.get_context ()->event_source ()->broadcast (ev); | 289 quote_outlet_.get_context ()->event_source ()->broadcast (ev); |
284 } | 290 } |
285 } | 291 } |
286 | 292 |
287 event_idx_++; | 293 event_idx_++; |
288 } | 294 } |
289 } | 295 } |
290 | 296 |
291 IMPLEMENT_CTOR_CALLBACK (Quote_iterator); | 297 IMPLEMENT_CTOR_CALLBACK (Quote_iterator); |
OLD | NEW |