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

From: Michael Fisher <mfisher31@email-addr-hidden>
Date: Sun Oct 27 2013 - 22:18:39 EET

On Sun, Oct 27, 2013 at 2:25 PM, Aurélien Leblond <blablack@email-addr-hiddenwrote:

> Hi everyone,
>
> In my lv2 plugin, I need to communicate information from the DSP to
> the UI, but I don't want to break the DSP/UI separation principle (no
> Instance or Data access). On top of that, I'm using LVTK.
>
> The type of data I'm trying to move is a Vector of Float (buffer type
> Sound in the ttl) - but even basic information on how to transfer a
> Float from the DSP to the UI would be valuable.
>

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

    // you're sending things in an atom sequence so get the size information
    // from the port buffer

    LV2_Atom_Sequence* aseq = (LV2_Atom_Sequence*) p (p_notify);
    m_forge->set_buffer ((uint8_t*) aseq, aseq->atom.size);

    m_forge->sequence_head (m_notify_frame, 0);

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

    m_forge->write_float (1604); //test data i'm trying to move

In my UI, I just want to see if I receive this data
In the port_event method, at the moment the only thing I'm doing is:
    std::cout << port << " - " << format << std::endl;

The port is defined in the TTL as follows:
    a lv2:OutputPort, atom:AtomPort ;
    atom:bufferType atom:Float ;
    atom:supports <http://lv2plug.in/ns/ext/patch#Message> ;
    lv2:index 1 ;
    lv2:symbol "notify" ;
    lv2:name "Notify" ;

> What I have do so far in the DSP (run method)
> m_forge->set_buffer((uint8_t*)p(p_notify), sizeof(float));
> //p_notify being the atom port
> m_forge->sequence_head(m_notify_frame, 0);
>
> ForgeFrame p_frame;
> Atom p_msg = m_forge->write_blank(p_frame, 1, urids.atom_Float);
> m_forge->property_head(urids.atom_value, 0);
> m_forge->write_float(1604); //test data i'm trying to move
> m_forge->pop(p_frame);
>
>
>
> In my UI, I just want to see if I receive this data
> In the port_event method, at the moment the only thing I'm doing is:
> std::cout << port << " - " << format << std::endl;
>
>
>
> The port is defined in the TTL as follows:
> a lv2:OutputPort, atom:AtomPort ;
> atom:bufferType atom:Float ;
> atom:supports <http://lv2plug.in/ns/ext/patch#Message> ;
> lv2:index 1 ;
> lv2:symbol "notify" ;
> lv2:name "Notify" ;
>
>
>
> At the moment, the code compiles and runs without crashing (yeah!),
> but nothing happens (boo!).
> Would you guys have any ideas?
>
> Thanks in advance,
> Aurélien
>

_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Received on Mon Oct 28 00:15:02 2013

This archive was generated by hypermail 2.1.8 : Mon Oct 28 2013 - 00:15:02 EET