On 15/10/14 20:17, Paul Davis wrote:
The problem seems to be different implementations of instantiate().
In Harry's
example, the methods that (AFAIU) LV2 expects :
- instantiate()
- connect_port()
- activate()
- run()
- deactivate()
- cleanup()
- extension_data()
Are declared explicitely, using static.
Like this :
static LV2_Handle
instantiate(const
LV2_Descriptor* descriptor,
double rate,
const char* bundle_path,
const LV2_Feature* const* features)
{
SinSynth* self = (SinSynth*)malloc(sizeof(SinSynth));
// store the sample rate in "self" so we can retrieve it
in run()
self->sample_rate = rate;
// initialize the phase so we start at the beginning of
the wave
self->phase = 0.f;
return self;
}
void
connect_port(LV2_Handle
instance,
uint32_t port,
void* data)
{
SinSynth* self=(SinSynth*)instance;
switch (port) {
case AMP_FREQ:
self->freq = (float*)data;
break;
case AMP_MIDI:
self->MidiIn = data;
break;
case AMP_OUTPUT:
self->output = (float*)data;
break;
}
}
static void
activate(LV2_Handle instance)
{
}
(...)
Whereas in so-404, they are somehow "surcharged", like this :
void runSO_404( LV2_Handle arg, uint32_t nframes );
LV2_Handle instantiateSO_404(const LV2_Descriptor
*descriptor,double s_rate, const char *path,const LV2_Feature *
const* features);
void cleanupSO_404(LV2_Handle instance);
void connectPortSO_404(LV2_Handle instance, uint32_t port,
void *data_location);
static LV2_Descriptor kis_Descriptor= {
.URI="https://bitbucket.org/xaccrocheur/kis",
.instantiate=instantiateSO_404,
.connect_port=connectPortSO_404,
.activate=NULL,
.run=runSO_404,
.deactivate=NULL,
.cleanup=cleanupSO_404,
.extension_data=NULL,
};
So apparently instead of being declared thusly:
LV2_Handle
instantiateSO_404(const LV2_Descriptor* descriptor,
double s_rate,
const char *path,
const LV2_Feature * const* features)
{...}
Either my instantiate method return value should be static, or my
"mandatory" methods should be declared explicitely. I tried to adapt
them, but failed so far.
Please excuse my sub-newbie mistakes.
--Phil
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev