Re: [LAD] [ANN] lv2-c++-tools 1.0.0

From: Pau Arumí Albó <parumi@email-addr-hidden>
Date: Wed Apr 16 2008 - 19:36:54 EEST

(answering to LAD only)

Luthman va escriure:

> This is a development tool, but I'm sending it to the LAU list as well
> in case there are any not-yet-hackers who would like to start writing
> effects or synths. It's easy, I promise. Here's the code you would need
> to write for a simple gain effect:
>
>
> #include <lv2plugin.hpp>
> #include "gain.peg"
>
> class Gain : public LV2::Plugin<Gain> {
> public:
> Gain(double rate) : LV2::Plugin<Gain>(p_n_ports) { }
> void run(uint32_t nframes) {
> for (uint32_t i = 0; i < nframes; ++i)
> p(p_out)[i] = p(p_gain) * p(p_in);
> }
> };
>
> static int _ = Gain::register_class("http://my.plugin/");

This is simple indeed.
However, this code brings me some questions. Are all variables (p,
p_out, p_in, p_gain) declared as Plugin base class members?
It does not make much sense to me that "p_gain" is a generic
control/member?
What about p_n_ports? Seems undefined to me.
( Also i assume that p(p_in) should be p(p_in)[i] )

Hmmm, i smell that gain.peg might be the answer to some of this
questions. Could you explain what goes in there?

Thanks,
Pau

_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev
Received on Wed Apr 16 20:15:17 2008

This archive was generated by hypermail 2.1.8 : Wed Apr 16 2008 - 20:15:17 EEST