[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Implement framework for post-fix text (de)cresc spanners
From: |
n . puttock |
Subject: |
Implement framework for post-fix text (de)cresc spanners |
Date: |
Sat, 11 Apr 2009 18:33:47 +0000 |
I never realized this would be so simple, but it strikes me as a bit of
a hack.
In your sample text dynamic spanners, there seems to be an element of
redundancy in the event properties; you could easily junk
'(de)crescendoSpanner and '(de)crescendoText, using 'text only to
trigger the change, though I'm still not sure I like this either:
+ SCM event_text = current_span_event_->get_property
("dynamic-text");
SCM cresc_type = get_property ((start_type + "Spanner").c_str
());
- if (cresc_type == ly_symbol2scm ("text"))
+ if (cresc_type == ly_symbol2scm ("text")
+ || Text_interface::is_markup (event_text))
{
current_spanner_
= make_spanner ("DynamicTextSpanner",
accepted_spanevents_drul_[START]->self_scm ());
- SCM text = get_property ((start_type + "Text").c_str ());
+ SCM text = ((event_text != SCM_EOL)
+ ? event_text
+ : get_property ((start_type + "Text").c_str ()));
if (Text_interface::is_markup (text))
{
current_spanner_->set_property ("text", text);
}
}
http://codereview.appspot.com/39047/diff/1/2
File lily/new-dynamic-engraver.cc (right):
http://codereview.appspot.com/39047/diff/1/2#newcode76
Line 76: SCM spanner_type = evt->get_property (name);
This looks weird to me, since you're taking advantage of the fact that
the event properties you're setting look like context properties. You'd
need a method which does the reverse of camel_case_to_lisp_identifier ()
so that the events would be converted from e.g. crescendo-spanner ->
crescendoSpanner.
http://codereview.appspot.com/39047
- Implement framework for post-fix text (de)cresc spanners,
n . puttock <=