Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#1110 closed Bug Report (invalid)

lilv_state_restore only finds the first state value

Reported by: falkTX Owned by: David Robillard
Priority: minor Component: Lilv
Keywords: Cc:


I'm still investigating this, but thought I would report in case someone else has an idea of what's going on.

When I call lilv_state_restore with this preset: the plugin only able to retrieve 1 property out of all of those.

My investigation leads me to believe lilv retrieve_callback is broken. (in src/state.c)

The plugin in question I'm testing this with is the 'States' example from Build and copy the bin/*.lv2 folders to ~/.lv2, run jalv.gtk and switch presets. See that it only restores the value of the first block.

Change History (4)

comment:1 Changed 6 years ago by David Robillard

This preset makes no sense. The preset has a bunch of states, each of which has just one property, so only the first state is used.

What generated it?

comment:2 Changed 6 years ago by falkTX

An exporter tool I made for DPF. This is not a real plugin, just an example one to be able to try out different things.

I've always believed LV2 allowed different state values in a single preset, is this not the case?

comment:3 Changed 6 years ago by David Robillard

Resolution: invalid
Status: newclosed

state:state points to a single object which contains all the state (i.e. keys and values).

You are pointing to a bunch of independent states, each of which has only one property. Lilv/hosts/etc do not look for multiple states since this doesn't make sense.

There needs to be only one state:state, and all the properties must be on it.

comment:4 Changed 6 years ago by falkTX

Ah, I see it now after saving a patch with jalv. The contents should be like this:

	state:state [
		<urn:distrho:top-left> "true" ;
		<urn:distrho:top-center> "false" ;
		<urn:distrho:top-right> "false" ;
		<urn:distrho:middle-left> "false" ;
		<urn:distrho:middle-center> "true" ;
		<urn:distrho:middle-right> "false" ;
		<urn:distrho:bottom-left> "false" ;
		<urn:distrho:bottom-center> "false" ;
		<urn:distrho:bottom-right> "true" ;
	] .

Sorry for the noise.

Note: See TracTickets for help on using tickets.