[LV2] Sending a port event from worker response - ingen problem
d at drobilla.net
Mon Jan 21 19:35:32 PST 2013
On Tue, 2013-01-15 at 14:13 +0000, Joe Button wrote:
> Hi there
> I'm having trouble getting my plugin to send a notification from its
> worker response function to its UI. It seems to work in jalv.gtk and
> ardour, but not in ingen. This could be ingen's fault, but is more
> likely to be mine as I'm dabbling in forces I don't really understand.
> The response function is here:
> It writes an atom structure created by the worker to an atom forge which
> is connected to the UI notification port.
> In jalv.gtk and ardour, the full atom structure is received at the UI's
> notification port. However ingen seems to get a structure with the
> preset_list vector missing. ie. this:
> exits with "No preset list found".
> Any hints?
Your preset list atom is corrupt, it kills jalv -d too (perhaps the
forge could check for this...)
Some thread safety issues aside (using plugin->forge and notify buffer
outside the process context), the problem is you are attempting to
construct a vector of non-constant size objects. You can not do this,
the vector is a compact headerless representation for sending things
like actual vectors of floats, one immediately after the other with no
Atom headers in-between (like an audio buffer). See the documentation
Specifically, in this line:
You are saying each element of the vector has size
sizeof(LV2_Atom_Tuple), which is way, way off. You can use Tuple for a
sequence of variable sized objects. Another option is an object with
Blank values like [ :bank 1 ; :program 1 ; rdfs:label "foo ]. Soon we
will have a vocabulary for that so the host can understand it and you
will not need a custom UI for what you are doing here, for now just use
whatever. The easy fix to is to do basically the same thing you are
doing except with a Tuple, not a vector.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 836 bytes
Desc: This is a digitally signed message part
More information about the Devel