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

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Aurélien Leblond <blablack@...>
Cc: <devel@...>, Linux Audio Developers <linux-audio-dev@...>
Date: Monday, October 28, 2013 - 2:52 pm

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

On Mon, Oct 28, 2013 at 9:00 AM, Aur=E9lien Leblond wro=
te:

> >> In my lv2 plugin, I need to communicate information from the DSP to

d
The map object is 'just there' for when you need it, like creating new
forges ;) I've always wondered if it made more sense to provide a
accessor method to it for clarity Plugin::get_urid_map() const or
something like that.

That looks right for creating a forge, AtomForge's ctor will call
lv2_atom_forge_init
when the map is passed in (just like you do above)

> void Scope::run(uint32_t nframes)

Still nothing happening on the GUI end ay? Could I just have a link to the
full source code? I'm better debugging hands on. Sorry, I can't recall
the git address to your plugin set.

Forging atoms (in a way that actually works) isn't by any means a straight
forward process.

>

1) AtomForge inherits LV2_Atom_Forge directly. This makes it possible to
use this class as if it were a regular c-typed forge.. e.g ...

AtomForge* forge =3D new AtomForge (this->p_map);
lv2_atom_forge_float (forge, 45.0f);

.... would work. It makes it possible to do custom forging using the
normal LV2 Atom API if wanted

2) By inheriting and adding to it keeps all of your forge'ing related code
organized into one place. Its a nice thing to do if you're not into
writing the same lines of code over and over again.

So I suppose its a personal preference kind of thing. Personally, once I
discover how to write a particular atom type correctly, I like to save it
and not have to figure it all out again.

But I had a look at the code, I still need to understand how to work

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

On Mon, Oct 28, 2013 at 9:00 AM, Aur=E9lien Leblond <bla=
black@gmail.com
> wrote:

cate information from the DSP to
ple (no

> he, he, yeah it can get a little confusing... maybe this will help.

e information
br>
ank object needed)

> Your ttl file has =A0atom:Float =A0as the buffer type. =A0I've nev=
er used

9;t need a
oat

Ok, so I changed my code the way you proposed (with switching in the
ttl to Sequence), but still don't manage to make it work.
I'm wondering if there isn't something wrong with the way I setup t=
he
Forge in the first place. I'm a bit confused with the way to interact
wiith the map object in LVTK.

=A0 =A0Scope::Scope(double rate) : Plugin<Scope, URID<true>,
Options<true>>(p_n_ports)
=A0 =A0{
=A0 =A0 =A0 =A0m_forge =3D new AtomForge(p_map);
=A0 =A0}
The map object is 'just there'=
for when you need it, like creating new forges ;) =A0I've always wonde=
red if it made more sense =A0to provide a accessor method to it for clarity=
=A0 Plugin::get_urid_map() const =A0 or something like that.
That looks right for creating a forge, AtomForge's =
=A0ctor will call lv2_atom_forge_initwhen the map is passed in (=
just like you do above)=A0

=A0 =A0void Scope::run(uint32_t nframes)
=A0 =A0{
=A0 =A0 =A0 =A0// you're sending things in an atom sequence so get the =
size information
=A0 =A0 =A0 =A0// from the port buffer

=A0 =A0 =A0 LV2_Atom_Sequence* aseq =3D (LV2_Atom_Sequence*) p (p_notify);<=
br>
=A0 =A0 =A0 m_forge->set_buffer ((uint8_t*) aseq, aseq->atom.size);

=A0 =A0 =A0 =A0m_forge->sequence_head(m_notify_frame, 0);

=A0 =A0 =A0 =A0// sequences need a timestamp for each event added
=A0 =A0 =A0 =A0m_forge->frame_time(0);

=A0 =A0 =A0 =A0m_forge->write_float(1604);
=A0 =A0}
Still nothing happening on the GUI end=
ay? =A0Could I just have a link to the full source code? =A0I'm better=
debugging hands on. =A0Sorry, I can't recall the git address to your p=
lugin set.
Forging atoms (in a way that actually works) isn't =
by any means a straight forward process.=A0=

> I recommend, if you want to use LVTK to do atom forging, that you subc=
lass

with a
ebin.com/C1LYtXpv =A0-- =A0the code in there uses small uses the
not using c++11

Could you tell me the advantages of doing that?1) =A0AtomForge inherits LV2_Atom_Forge directly. =A0This makes it=
possible to use this class as if it were a regular c-typed forge.. =A0 =A0=
e.g ...
=A0 =A0=A0 =A0 AtomForge* forge =3D new AtomForge (this-&gt=
;p_map);=A0 =A0 lv2_atom_forge_float (forge, 45.0f);<=
br>.... would work. =A0It makes it possible to do custom forging=
using the normal LV2 Atom API if wanted
2) =A0By inheriting and adding to it keeps all of your =
forge'ing related code organized into one place. =A0Its a nice thing to=
do if you're not into writing the same lines of code over and over aga=
in.
So I suppose its a personal preference kind of thing. =
=A0Personally, once I discover how to write a particular atom type correctl=
y, I like to save it and not have to figure it all out again.

But I had a look at the code, I still need to understand how to work
with LV2_URID_Map in LVTK (I cannot find any examples using it).

--047d7b86c74829962504e9ce3e4a--

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)