Re: [LAD] LV2: Communicate from the DSP to the UI

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Linux Audio Developers <linux-audio-dev@...>, <devel@...>
Date: Tuesday, November 5, 2013 - 5:48 am

--047d7b6da4982f12fc04ea679471
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Mon, Nov 4, 2013 at 6:52 AM, Aur=E9lien Leblond wro=
te:

> Hi Michael,

It sounds logical to me, yeah. Doing it this way could be done by forging
the Blank atom and then writing the float array as raw. You would need to
map a few uris specifically for this to use inside of the blank object.

seems like peak proptocol etc etc.. would could also be used here. I don't
think there's a single host that supports any of those kinds of features
though....

some fake code doing it with an atom object and a raw buffer, I didn't try
to compile any of this let alone try it in a real plugin.

float buffer [bufsize];
uint32_t object_type =3D this->map ("http://myuri#object");
uint32_t prop_type =3D this->map ("http://myuri#prop");

...

ForgeFrame frame;

AtomObject obj (forge.write_blank (frame, 0, object_type));
forge.property_head (prop_type, 0);
forge.write_raw (buffer, sizeof (float) * bufsize);

forge.pop (frame);

and then on the GUI side use an AtomObject::iterator if you want it to look
more like c++.

AtomObject obj (data_from_port_event);
AtomObject::iterator prop =3D obj.begin();

float* buffer =3D 0;
while (prop !=3D obj.end())
{
if (prop->key =3D=3D prop_type) {
buffer =3D LV2_ATOM_BODY (&prop->value);
break;
}

++prop;
}

if (buffer)
do_something_with (buffer);

regular object getting and querying obviously would also work on the GUI
end.

- guiext:notifyType atom:Blank ;

e
);
k
on
k)

--047d7b6da4982f12fc04ea679471
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Mon, Nov 4, 2013 at 6:52 AM, Aur=E9lien Leblond <blab=
lack@gmail.com
> wrote:
Hi Michael,

What I think I should be doing is using Blank Atom to transfer the
data from DSP to UI, right?It so=
unds logical to me, yeah. =A0Doing it this way could be done by forging the=
Blank atom and then writing the float array as raw. =A0 You would need to =
map a few uris specifically for this to use inside of the blank object.
=A0seems like peak proptocol etc etc.. would could al=
so be used here. =A0I don't think there's a single host that suppor=
ts any of those kinds of features though....
some fake code doing it with an atom object and a raw buffer, I didn't =
try to compile any of this let alone try it in a real plugin.float buffer [bufsize];
uint32_t object_type =3D this->map ("http://myuri#object");uint32_t prop_=
type =A0 =3D this->map ("http://myuri=
#prop
");
...ForgeFrame frame;
AtomObject obj (forge.write_blank (frame, 0=
, object_type));forge.property_head (prop_type, 0);<=
div style>forge.write_raw (buffer, sizeof (float) * bufsize);
forge.pop (frame);=
and then on the GUI side use an AtomObject::iterator i=
f you want it to look more like c++. =A0
AtomObject obj (data_from_port_event);AtomObject::iterator=
prop =3D obj.begin();float* buffer =
=3D 0;while (prop !=3D obj.end()){<=
div style>
=A0 =A0if (prop->key =3D=3D prop_type) {=A0 =A0 =A0 buf=
fer =3D LV2_ATOM_BODY (&prop->value);=A0 =A0 =A0 br=
eak;=A0 =A0}=A0 ++pr=
op;}
if (buffer)=A0 =A0 do_some=
thing_with (buffer);regular object getting and querying obviously would also work on the GU=
I end.

- guiext:notifyType atom:Blank ;
- atom:supports atom:Audio ;
- on the DSP side, use the AtomForge write_raw method to write the
array of floats

Is that the right way to go or is there anything else I should consider?

As the the lv2 scope plugin has 2 inputs that need to be represented
in the GUI, I was wondering if I can pass the 2 arrays of floats in
one go through only one Atom.

can pass my own object, but I'm not sure how to approach that via LVTK<=
br>
(or via LV2 itself for that matter).

Once again thanks in advance for your help,

Aur=E9lien

On Mon, Oct 28, 2013 at 8:30 PM, Michael Fisher <mfisher31@gmail.com> wrote:

it, like creating new
se =A0to provide a
=A0 or something
=A0ctor will call
m sequence so get the size
uence*) p (p_notify);
aseq->atom.size);
me, 0);
event added
t have a link to
=A0Sorry, I can't
any means a
something
I'm
v2
ine in
et on
omething

>

.net/plugins/avw/scope>
lt;<<<< NEED THIS (i think)
ere
) =A0The
o

--047d7b6da4982f12fc04ea679471--

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[LAD] LV2: Communicate from the DSP to the UI, Aurélien Leblond, (Mon Oct 28, 2:00 pm)
Re: [LAD] LV2: Communicate from the DSP to the UI, Michael Fisher, (Mon Oct 28, 2:52 pm)
Re: [LAD] LV2: Communicate from the DSP to the UI, Aurélien Leblond, (Mon Oct 28, 3:24 pm)
Re: [LAD] LV2: Communicate from the DSP to the UI, Michael Fisher, (Mon Oct 28, 4:58 pm)
Re: [LAD] LV2: Communicate from the DSP to the UI, Michael Fisher, (Mon Oct 28, 8:30 pm)
Re: [LAD] LV2: Communicate from the DSP to the UI, Aurélien Leblond, (Mon Nov 4, 12:52 pm)
Re: [LAD] LV2: Communicate from the DSP to the UI, Michael Fisher, (Tue Nov 5, 5:48 am)
Re: [LAD] [LV2] LV2: Communicate from the DSP to the UI, David Robillard, (Wed Nov 6, 4:45 am)
Re: [LAD] LV2: Communicate from the DSP to the UI, Robin Gareus, (Wed Nov 6, 3:33 am)
Re: [LAD] LV2: Communicate from the DSP to the UI, David Robillard, (Wed Nov 6, 4:41 am)
Re: [LAD] LV2: Communicate from the DSP to the UI, Aurélien Leblond, (Wed Nov 6, 3:21 pm)
Re: [LAD] LV2: Communicate from the DSP to the UI, David Robillard, (Sat Nov 9, 7:09 pm)
Re: [LAD] LV2: Communicate from the DSP to the UI, Robin Gareus, (Wed Nov 6, 11:49 pm)
Re: [LAD] LV2: Communicate from the DSP to the UI, David Robillard, (Sat Nov 9, 7:10 pm)
Re: [LAD] [LV2] LV2: Communicate from the DSP to the UI, David Robillard, (Sun Nov 10, 6:58 pm)
Re: [LAD] [LV2] LV2: Communicate from the DSP to the UI, Aurélien Leblond, (Sun Nov 10, 8:05 am)