parser.
* input/regression/quote.ly: new file.
* lily/parser.yy (command_element): \quote DURATION NAME: support
cue notes.
* lily/quote-iterator.cc (class Quote_iterator): new file.
2004-02-21 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * lily/parser.yy (command_element): extract quoted vector in
+ parser.
+
* input/regression/quote.ly: new file.
* lily/sequential-iterator.cc (process): only process if moment >= 0.
\score {
\notes \relative c'' {
- \set Score.quotes = \musicQuotes
-
c8 d8 \quote 2 "bla" es8 gis
}
}
$$ = skip;
}
| QUOTE duration_length STRING {
- Music * quote = MY_MAKE_MUSIC("QuoteMusic");
- quote->set_mus_property ("duration", $2);
- quote->set_mus_property ("quoted-name", $3);
+ SCM tab = THIS->lexer_->lookup_identifier ("musicQuotes");
+ SCM evs = SCM_EOL;
+ if (scm_hash_table_p (tab) == SCM_BOOL_T)
+ {
+ SCM key = $3; // use symbol?
+ evs = scm_hash_ref (tab, key, SCM_BOOL_F);
+ }
+ Music * quote = 0;
+ if (scm_vector_p (evs) == SCM_BOOL_T)
+ {
+ quote = MY_MAKE_MUSIC("QuoteMusic");
+ quote->set_mus_property ("duration", $2);
+ quote->set_mus_property ("quoted-events", evs);
+ } else {
+ THIS->here_input ().warning (_f ("Can\'t find music."));
+ quote = MY_MAKE_MUSIC ("Event");
+ }
quote->set_spot (THIS->here_input ());
$$ = quote;
}
void
Quote_iterator::construct_children ()
{
- SCM tab = get_outlet()->get_property ("quotes");
- if (scm_hash_table_p (tab) != SCM_BOOL_T)
- {
- get_music ()->origin ()->warning ("Context property `quotes' unset; cannot process quote.");
- return ;
- }
-
- SCM name = get_music ()->get_mus_property ("quoted-name");
SCM dur = get_music ()->get_mus_property ("duration");
-
if (!unsmob_duration (dur))
return ;
Moment stop = now + unsmob_duration (dur)->get_length ();
start_moment_ = now;
-
- event_vector_ = scm_hash_ref (tab, name, SCM_BOOL_F);
+ event_vector_ = get_music ()->get_mus_property ("quoted-events");
if (scm_vector_p (event_vector_) == SCM_BOOL_T)
{
event_idx_ = binsearch_scm_vector (event_vector_, now.smobbed_copy (), &moment_less);
end_idx_ = binsearch_scm_vector (event_vector_, stop.smobbed_copy (), &moment_less);
}
- else
- get_music ()->origin ()->warning ("Can't find requested source");
}
"The function to run with \\applycontext. It must take a single argument, being the context.")
(property-operations ,list?
"Do these operations for instantiating the context.")
- (predicate ,procedure? "the predicate of a \\outputproperty")
- (quoted-name ,string? "The name of the voice to be quoted")
+ (predicate ,procedure? "the predicate of a \\outputproperty.")
+ (quoted-events ,vector? "A vector of with moment/event-list entries.")
(type ,symbol? "The type of this music object. Determines iteration in some cases.")
(types ,list? "The types of this music
object; determines by what engraver this music expression is