Carla icon indicating copy to clipboard operation
Carla copied to clipboard

LV2 state in .carxp doesn't appear to be portable

Open swesterfeld opened this issue 1 year ago • 0 comments

I've been looking into how Carla serializes the LV2 state, and for SpectMorph for instance I use something like

    float f_volume = self->project.volume();
    store (handle, self->uris.spectmorph_volume,
           (void*)&f_volume, sizeof (float),
           self->uris.atom_Float,
           LV2_STATE_IS_POD);

in my state save function. Ardour stores this like this:

<http://spectmorph.org/plugins/spectmorph#volume> "-6.0"^^xsd:float

in its .ttl file. However, Carla stores it like this:

   <CustomData>
    <Type>http://lv2plug.in/ns/ext/atom#Float</Type>
    <Key>http://spectmorph.org/plugins/spectmorph#volume</Key>
    <Value>AADAwA==</Value>
   </CustomData>

If I am not mistaken then the Carla version will break if opened on a machine with a different endianess, whereas the Ardour version will work. Not sure if you want to fix it though, but I thought I'd at least report it.

swesterfeld avatar Dec 13 '23 16:12 swesterfeld