Re: [frogs] chord_name_engraver - help with c++ ... |
[ Thread Index |
Date Index
| More lilynet.net/frogs Archives
]
On 7/5/11 11:30 AM, "Wols Lists" <antlists@xxxxxxxxxxxxxxx> wrote:
> On 05/07/11 01:15, Wols Lists wrote:
>>> And I'd recommend the code be something like
>>>>
>>>> SCM capo_pitch = get_property ("capoPitch");
>>>> bool capo = false;
>>>> if !(capo_pitch == SCM_EOL)
>>>> capo = (Pitch::compare (unsmob_pitch (capo_pitch), Pitch()) != 0)
>>>>
>>>> Note -- I haven't tested this code. But I think it follows the general
>>>> trend.
>>>>
>>>> HTH,
>>>>
>> Thanks - it helps A LOT.
>>
>> I'd found this - as you can see from my other email - and was trying to
>> go down this exact path, but it was still blowing up on me. I'll use
>> this and it should tell me where I'm going wrong. But it's quarter past
>> one in the morning and my wife will not be happy if I'm not in bed soon,
>> so I'll carry on tomorrow :-)
>>
>> Thanks again,
>> Cheers,
>> Wol
>>
> Next step - that code compiles okay. But it doesn't work when run ...
>
> I'm getting the following errors:
>
> Interpreting music...
> warning: cannot find property type-check for `capoVertical'
> (translation-type?). perhaps a typing error?
> warning: doing assignment anyway
> warning: cannot find property type-check for `capoPitch'
> (translation-type?). perhaps a typing error?
> warning: doing assignment anyway
>
> But I've added capoVertical and capoPitch to the ADD_TRANSLATOR section,
> and I've added them to define-context-properties.scm. So why can't it
> find it? Or is it that I've installed 2.15 locally, and it's finding the
> scheme code for 2.14 or 2.12? Unlikely, I would have thought, wouldn't
> that cause a crash?
Actually, it's not likely that the scheme code would cause a crash.
If I were wanting to check this out, I'd put a Scheme display statement at
the top of scm/context-properties.scm.
>
> Is there a C++ function that will dump the contents of a scheme variable
> to stdout?
Look in the Contributor's Guide, section 10.6.2 Debugging C++ code, to see
display functions used in the debugger. You should be able to call
ly_display_scm on a smob from C++.
If you could post a patch set on Rietveld, we might be able to give you
better advice.
HTH,
Carl
---
----
Join the Frogs!