Use the C++ version of the LV2 libraries

This commit is contained in:
Aleks Rutins 2023-04-14 11:22:48 -04:00
parent 391f9e9a0b
commit c226177453
5 changed files with 23 additions and 54 deletions

View file

@ -1,42 +1,6 @@
#include <lv2/core/lv2.h>
#include "plugin.hh"
using Dynamite::Plugin;
using Dynamite::Drive;
static LV2_Handle
instantiate(const LV2_Descriptor* descriptor,
double rate,
const char* bundle_path,
const LV2_Feature* const* features)
{
return new Plugin;
}
static void
cleanup(LV2_Handle instance)
{
delete (Plugin *)instance;
}
static const void*
extension_data(const char *uri)
{
return nullptr;
}
static const LV2_Descriptor descriptor = {
"https://github.com/aleksrutins/dynamite",
instantiate,
(void (*)(LV2_Handle, uint32_t, void*)) &Plugin::connect_port,
(void (*)(LV2_Handle)) &Plugin::activate,
(void (*)(LV2_Handle, uint32_t)) &Plugin::run,
(void (*)(LV2_Handle)) &Plugin::deactivate,
cleanup,
extension_data
};
LV2_SYMBOL_EXPORT
const LV2_Descriptor*
lv2_descriptor(uint32_t index) {
return index == 0 ? &descriptor : nullptr;
}
static int _ = Drive::register_class("https://github.com/aleksrutins/dynamite");