On 15/10/14 20:17, Paul Davis wrote:
Wow, now that is a nice tool, thanks (a lot) for the tip!
In my kis.h file, required in my kis.c file, I have this
LV2_Handle instantiateSO_404(const LV2_Descriptor
*descriptor,double s_rate, const char *path,const LV2_Feature *
const* features);
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,
};
And in the kis.c file is a
LV2_Handle instantiateSO_404(const
LV2_Descriptor* descriptor,double s_rate, const char *path,const
LV2_Feature * const* features) {
so_404* so=malloc(sizeof(so_404));
LV2_URI_Map_Feature *map_feature;
const LV2_Feature * const * ft;
for (ft = features; *ft; ft++) {
if (!strcmp((*ft)->URI,
"http://lv2plug.in/ns/ext/uri-map")) {
map_feature = (*ft)->data;
so->midi_event_id = map_feature->uri_to_id(
map_feature->callback_data,
"http://lv2plug.in/ns/ext/event",
"http://lv2plug.in/ns/ext/midi#MidiEvent");
} else if (!strcmp((*ft)->URI,
"http://lv2plug.in/ns/ext/event")) {
so->event_ref = (*ft)->data;
}
}
puts( "SO-404 v.1.2 by 50m30n3 2009-2011" );
so->phase = 0.0;
so->freq = 440.0;
so->tfreq = 440.0;
so->amp = 0.0;
so->env=0.0;
so->vel=0;
so->fcutoff = 0.0;
so->fspeed = 0.0;
so->fpos = 0.0;
so->lastsample = 0.0;
so->noteson = 0;
so->cdelay = s_rate/100;
so->samplerate=s_rate;
so->release = 100;
so->cutoff = 50;
so->envmod = 80;
so->resonance = 100;
so->volume = 100;
so->portamento = 64;
return so;
}
And in the gui file, indeed :
static LV2UI_Descriptor descriptors[]
= {
{KIS_UI_URI, instantiate,
cleanup, port_event, extension_data}
};
const LV2UI_Descriptor * lv2ui_descriptor(uint32_t index) {
printf("lv2ui_descriptor(%u) called\n", (unsigned
int)index);
if (index >= sizeof(descriptors) /
sizeof(descriptors[0])) {
return NULL;
}
return descriptors +
index;
// return NULL;
}
How does that work?
- Is the UI always supposed to return the instantiate handle?
- How is it supposed to return it?
Thanks a lot,
--Phil
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev