21 |
#ifndef LS_PLUGINLV2_H |
#ifndef LS_PLUGINLV2_H |
22 |
#define LS_PLUGINLV2_H |
#define LS_PLUGINLV2_H |
23 |
|
|
24 |
#ifdef HAVE_LV2_PACKAGE |
#include "../../drivers/Plugin.h" |
25 |
|
|
26 |
#include <lv2/lv2plug.in/ns/lv2core/lv2.h> |
#include <lv2/lv2plug.in/ns/lv2core/lv2.h> |
27 |
#include <lv2/lv2plug.in/ns/ext/event/event.h> |
#include <lv2/lv2plug.in/ns/ext/atom/atom.h> |
28 |
#include <lv2/lv2plug.in/ns/ext/state/state.h> |
#include <lv2/lv2plug.in/ns/ext/state/state.h> |
29 |
#include <lv2/lv2plug.in/ns/ext/uri-map/uri-map.h> |
#include <lv2/lv2plug.in/ns/ext/urid/urid.h> |
|
#else |
|
|
#include <lv2.h> |
|
|
#include "lv2_event.h" |
|
|
#include "lv2_state.h" |
|
|
#include "lv2_uri_map.h" |
|
|
#endif |
|
|
#include "../../drivers/Plugin.h" |
|
30 |
|
|
31 |
namespace { |
namespace { |
32 |
|
|
35 |
PluginLv2(const LV2_Descriptor* Descriptor, |
PluginLv2(const LV2_Descriptor* Descriptor, |
36 |
double SampleRate, const char* BundlePath, |
double SampleRate, const char* BundlePath, |
37 |
const LV2_Feature* const* Features); |
const LV2_Feature* const* Features); |
38 |
|
~PluginLv2(); |
39 |
void ConnectPort(uint32_t Port, void* DataLocation); |
void ConnectPort(uint32_t Port, void* DataLocation); |
40 |
void Activate(); |
void Activate(); |
41 |
void Run(uint32_t SampleCount); |
void Run(uint32_t SampleCount); |
50 |
virtual String PathFromState(const String& string); |
virtual String PathFromState(const String& string); |
51 |
|
|
52 |
private: |
private: |
53 |
uint32_t uri_to_id(const char* map, const char* uri) { |
LV2_URID uri_to_id(const char* uri) { |
54 |
return UriMap->uri_to_id(UriMap->callback_data, map, uri); |
return UriMap->map(UriMap->handle, uri); |
55 |
} |
} |
56 |
|
|
57 |
void SetStateFeatures(const LV2_Feature* const* Features); |
void SetStateFeatures(const LV2_Feature* const* Features); |
58 |
|
|
59 |
float* Out[2]; |
float** Out; |
60 |
LV2_Event_Buffer* MidiBuf; |
LV2_Atom_Sequence* MidiBuf; |
61 |
LV2_URI_Map_Feature* UriMap; |
LV2_URID_Map* UriMap; |
62 |
|
LV2_URID MidiEventType; |
63 |
LV2_State_Map_Path* MapPath; |
LV2_State_Map_Path* MapPath; |
64 |
LV2_State_Make_Path* MakePath; |
LV2_State_Make_Path* MakePath; |
65 |
|
|
94 |
static void cleanup(LV2_Handle instance); |
static void cleanup(LV2_Handle instance); |
95 |
static const void* extension_data(const char* uri); |
static const void* extension_data(const char* uri); |
96 |
|
|
97 |
static LV2_State_Status save(LV2_Handle handle, |
static LV2_State_Status save(LV2_Handle handle, |
98 |
LV2_State_Store_Function store, |
LV2_State_Store_Function store, |
99 |
void* data); |
LV2_State_Handle state, uint32_t flags, |
100 |
|
const LV2_Feature* const* features); |
101 |
|
|
102 |
static LV2_State_Status restore(LV2_Handle handle, |
static LV2_State_Status restore(LV2_Handle handle, |
103 |
LV2_State_Retrieve_Function retrieve, |
LV2_State_Retrieve_Function retrieve, |
104 |
void* data); |
LV2_State_Handle state, uint32_t flags, |
105 |
|
const LV2_Feature* const* features); |
106 |
} |
} |
107 |
} |
} |
108 |
|
|