lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to create a restricted symbols context property


From: Urs Liska
Subject: Re: How to create a restricted symbols context property
Date: Mon, 18 Jan 2016 18:24:14 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0


Am 18.01.2016 um 11:31 schrieb Urs Liska:
> I have created a new boolean context property by
> - adding an entry in define-context-properties.scm
> - setting the default in engraver-init.ly
> - retrieving it in a class's (Beaming_option) from_context method
>
> However, I would like to add another context property (and modify the
> added one) from boolean to accepting one out of a list of symbols.
> Skimming the source code I couldn't really find how I achieve that.
>
> I assume that I have to define a custom predicate for my property that
> throws an (which?) error the argument is not in the list of accepted
> symbols.
> Is that right? And if so, where should I define that?

I have now managed to handle what I need by adding a Scheme predicate
and a C++ enum.

However, I am quite sure that they are not implemented at appropriate
locations:

The Scheme predicate at the top of define-context-properties.scm
The C++ enum directly in the .hh file where it is used.

Where should I put them?

Best
Urs



reply via email to

[Prev in Thread] Current Thread [Next in Thread]