2024-04-14 16:17:19 +02:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* lv2_plugin.h */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* This file is part of Drummer. */
|
|
|
|
/* */
|
|
|
|
/* Drummer is free software: you can redistribute it and/or modify it */
|
|
|
|
/* under the terms of the GNU General Public License as published by */
|
|
|
|
/* the Free Software Foundation, either version 3 of the License, or */
|
|
|
|
/* (at your option) any later version. */
|
|
|
|
/* */
|
|
|
|
/* Drummer is distributed in the hope that it will be useful, */
|
|
|
|
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
|
|
|
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
|
|
|
/* GNU General Public License for more details. */
|
|
|
|
/* */
|
|
|
|
/* You should have received a copy of the GNU General Public License */
|
|
|
|
/* along with Drummer. If not, see <https://www.gnu.org/licenses/>. */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
2024-04-21 20:16:18 +02:00
|
|
|
|
|
|
|
|
2024-04-14 16:17:19 +02:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* Includes */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2022-03-27 11:33:37 +02:00
|
|
|
|
|
|
|
#ifndef _LV2_PLUGIN_H_
|
|
|
|
#define _LV2_PLUGIN_H_
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* Global definitions */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
// lv2 stuff
|
|
|
|
|
2024-04-03 14:10:45 +02:00
|
|
|
#define DRD_DRUMMER_URI "http://rx3.org/AlkorZ3/drummer"
|
2023-07-28 01:14:53 +02:00
|
|
|
|
2022-04-20 12:37:32 +02:00
|
|
|
#define DRD_GAIN_MIN -60.0f
|
|
|
|
#define DRD_GAIN_MAX 6.0f
|
|
|
|
#define DRD_VELOCITY_MIN 0
|
|
|
|
#define DRD_VELOCITY_MAX 127
|
|
|
|
|
|
|
|
#define DRD_DB3SCALE -0.8317830986718104f
|
|
|
|
#define DRD_DB3SCALEPO 1.8317830986718104f
|
|
|
|
|
|
|
|
// taken from lv2 example amp plugin
|
|
|
|
#define DRD_DB_CO(g) ( ( g) > DRD_GAIN_MIN ? powf( 10.0f, ( g) * 0.05f) : 0.0f)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define DRD_PORT_NUMBER_MAX 32
|
|
|
|
|
|
|
|
#define DRD_REQ_BUF_SIZE 10
|
2022-03-27 11:33:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
DRD_LV2_CONTROL = 0,
|
|
|
|
DRD_LV2_MASTER_LEFT,
|
|
|
|
DRD_LV2_MASTER_RIGHT,
|
|
|
|
DRD_LV2_LEFT_00,
|
|
|
|
DRD_LV2_RIGHT_00,
|
|
|
|
DRD_LV2_LEFT_01,
|
|
|
|
DRD_LV2_RIGHT_01,
|
|
|
|
DRD_LV2_LEFT_02,
|
|
|
|
DRD_LV2_RIGHT_02,
|
|
|
|
DRD_LV2_LEFT_03,
|
|
|
|
DRD_LV2_RIGHT_03,
|
|
|
|
DRD_LV2_LEFT_04,
|
|
|
|
DRD_LV2_RIGHT_04,
|
|
|
|
DRD_LV2_LEFT_05,
|
|
|
|
DRD_LV2_RIGHT_05,
|
|
|
|
DRD_LV2_LEFT_06,
|
|
|
|
DRD_LV2_RIGHT_06,
|
|
|
|
DRD_LV2_LEFT_07,
|
|
|
|
DRD_LV2_RIGHT_07,
|
|
|
|
DRD_LV2_LEFT_08,
|
|
|
|
DRD_LV2_RIGHT_08,
|
|
|
|
DRD_LV2_LEFT_09,
|
|
|
|
DRD_LV2_RIGHT_09,
|
|
|
|
DRD_LV2_LEFT_10,
|
|
|
|
DR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
|
|
DRD_LV2_PAN_00,
|
|
|
|
DRD_LV2_PAN_01,
|
|
|
|
DRD_LV2_PAN_02,
|
|
|
|
DRD_LV2_PAN_03,
|
|
|
|
DRD_LV2_PAN_04,
|
|
|
|
DRD_LV2_PAN_05,
|
|
|
|
DRD_LV2_PAN_06,
|
|
|
|
DRD_LV2_PAN_07,
|
|
|
|
DRD_LV2_PAN_08,
|
|
|
|
DRD_LV2_PAN_09,
|
|
|
|
DRD_LV2_PAN_10,
|
|
|
|
DRD_LV2_PAN_11,
|
|
|
|
DRD_LV2_PAN_12,
|
|
|
|
DRD_LV2_PAN_13,
|
|
|
|
DRD_LV2_PAN_14,
|
|
|
|
DRD_LV2_PAN_15,
|
|
|
|
DRD_LV2_PAN_16,
|
|
|
|
DRD_LV2_PAN_17,
|
|
|
|
DRD_LV2_PAN_18,
|
|
|
|
DRD_LV2_PAN_19,
|
|
|
|
DRD_LV2_PAN_20,
|
|
|
|
DRD_LV2_PAN_21,
|
|
|
|
DRD_LV2_PAN_22,
|
|
|
|
DRD_LV2_PAN_23,
|
|
|
|
DRD_LV2_PAN_24,
|
|
|
|
DRD_LV2_PAN_25,
|
|
|
|
DRD_LV2_PAN_26,
|
|
|
|
DRD_LV2_PAN_27,
|
|
|
|
DRD_LV2_PAN_28,
|
|
|
|
DRD_LV2_PAN_29,
|
|
|
|
DRD_LV2_PAN_30,
|
|
|
|
DRD_LV2_PAN_31,
|
2022-03-27 11:33:37 +02:00
|
|
|
DRD_LV2_CORE_EVENT,
|
|
|
|
DRD_LV2_NUM_PORTS
|
|
|
|
} DRT_Port_Index;
|
|
|
|
|
|
|
|
|
2024-04-10 23:53:45 +02:00
|
|
|
/*
|
2023-07-28 01:14:53 +02:00
|
|
|
typedef struct DRT_Drummer_URIS
|
2022-03-27 11:33:37 +02:00
|
|
|
{
|
2023-07-28 01:14:53 +02:00
|
|
|
LV2_URID Atom_Object;
|
2022-05-11 12:52:37 +02:00
|
|
|
|
2023-07-28 01:14:53 +02:00
|
|
|
LV2_URID String_URId;
|
|
|
|
LV2_URID Bool_URId;
|
|
|
|
LV2_URID Int_URId;
|
2024-04-10 10:05:11 +02:00
|
|
|
LV2_URID Long_URId;
|
|
|
|
LV2_URID Tuple_URId;
|
2023-07-28 01:14:53 +02:00
|
|
|
|
|
|
|
LV2_URID Midi_Event;
|
|
|
|
|
|
|
|
LV2_URID Atom_EventTransfer;
|
2022-05-11 12:52:37 +02:00
|
|
|
|
2024-04-10 23:53:45 +02:00
|
|
|
LV2_URID UI_Msg;
|
|
|
|
|
2024-04-10 10:05:11 +02:00
|
|
|
LV2_URID UI_Enable;
|
|
|
|
LV2_URID UI_Disable;
|
|
|
|
|
2024-04-10 23:53:45 +02:00
|
|
|
LV2_URID Kit_Update_Request;
|
|
|
|
LV2_URID Kit_Update_Reply;
|
2024-04-08 10:01:34 +02:00
|
|
|
|
2023-07-28 01:14:53 +02:00
|
|
|
LV2_URID Velocity_Ignore_Flag_Toggle;
|
|
|
|
LV2_URID Note_Off_Ignore_Flag_Toggle;
|
|
|
|
|
|
|
|
|
2022-05-11 12:52:37 +02:00
|
|
|
// LV2_URID kit_path;
|
|
|
|
// LV2_URID get_state;
|
|
|
|
// LV2_URID midi_info;
|
|
|
|
// LV2_URID sample_trigger;
|
|
|
|
// LV2_URID channel_id;
|
|
|
|
// LV2_URID velocity_toggle;
|
|
|
|
// LV2_URID note_off_toggle;
|
|
|
|
// LV2_URID zero_position;
|
|
|
|
// LV2_URID sample_add;
|
|
|
|
// LV2_URID sample_remove;
|
2022-03-27 11:33:37 +02:00
|
|
|
} DRT_Drummer_URIS;
|
2024-04-10 23:53:45 +02:00
|
|
|
*/
|
2022-03-27 11:33:37 +02:00
|
|
|
|
2023-07-28 01:14:53 +02:00
|
|
|
typedef struct DRT_Sample
|
2022-04-20 12:37:32 +02:00
|
|
|
{
|
|
|
|
DRT_Instrument *Instrument_Ptr;
|
|
|
|
DRT_Layer *Layer_Ptr;
|
|
|
|
float *Data_Ptr;
|
|
|
|
uint32_t Limit;
|
|
|
|
SF_INFO *SF_Info_Ptr;
|
|
|
|
int Data_Offset;
|
|
|
|
char Active;
|
|
|
|
uint32_t Offset;
|
|
|
|
float Velocity;
|
2022-04-29 20:48:54 +02:00
|
|
|
bool Sustained;
|
2022-04-20 12:37:32 +02:00
|
|
|
} DRT_Sample;
|
|
|
|
|
2022-05-11 12:52:37 +02:00
|
|
|
|
|
|
|
|
2022-04-20 12:37:32 +02:00
|
|
|
typedef struct DRT_LV2_Base
|
|
|
|
{
|
2022-03-27 11:33:37 +02:00
|
|
|
// Ports
|
|
|
|
float *Master_Left;
|
|
|
|
float *Master_Right;
|
|
|
|
float **Left;
|
|
|
|
float **Right;
|
|
|
|
LV2_Atom_Sequence *Control_Port;
|
|
|
|
LV2_Atom_Sequence *Core_Event_Port;
|
|
|
|
|
|
|
|
LV2_Atom_Forge Forge;
|
2022-04-20 12:37:32 +02:00
|
|
|
|
|
|
|
// params
|
2022-05-11 12:52:37 +02:00
|
|
|
// int Channel;
|
|
|
|
// int Channel_Nb;
|
2022-04-20 12:37:32 +02:00
|
|
|
int Zero_Position;
|
|
|
|
float **Gains;
|
|
|
|
float **Pans;
|
|
|
|
|
2022-04-29 20:48:54 +02:00
|
|
|
bool Sustain;
|
|
|
|
|
2022-04-20 12:37:32 +02:00
|
|
|
// URIs
|
|
|
|
LV2_URID_Map *Map_Ptr;
|
|
|
|
DRT_Drummer_URIS URIS;
|
|
|
|
|
2022-05-14 23:53:23 +02:00
|
|
|
// Logger
|
|
|
|
LV2_Log_Logger Logger;
|
|
|
|
|
2022-04-20 12:37:32 +02:00
|
|
|
// Kit info
|
2024-04-10 23:53:45 +02:00
|
|
|
DRT_Kit *Kit_Ptr;
|
|
|
|
DRT_Kit_Id Kit_Id;
|
|
|
|
DRT_Kit_Id Kit_Id_New;
|
2022-04-20 12:37:32 +02:00
|
|
|
uint8_t Bank_Id_LSB;
|
|
|
|
uint8_t Bank_Id_MSB;
|
|
|
|
uint8_t Program_Id;
|
|
|
|
uint8_t Bank_Id_LSB_New;
|
|
|
|
uint8_t Bank_Id_MSB_New;
|
|
|
|
uint8_t Program_Id_New;
|
2024-04-13 09:54:07 +02:00
|
|
|
int Kit_Updated_Flag;
|
2022-04-20 12:37:32 +02:00
|
|
|
char *Current_Path;
|
|
|
|
char **Request_Buf;
|
|
|
|
int CurReq;
|
|
|
|
|
|
|
|
// Samples
|
|
|
|
DRT_Sample Samples[DRD_PORT_NUMBER_MAX];
|
|
|
|
uint8_t Sample_Number;
|
|
|
|
|
|
|
|
|
|
|
|
// Loading Thread Stuff
|
|
|
|
pthread_mutex_t Load_Mutex;
|
|
|
|
pthread_cond_t Load_Cond;
|
|
|
|
pthread_t Load_Thread;
|
2022-03-27 11:33:37 +02:00
|
|
|
} DRT_LV2_Base;
|
|
|
|
|
|
|
|
|
2022-04-20 12:37:32 +02:00
|
|
|
/*
|
2022-03-27 11:33:37 +02:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
// Ports
|
|
|
|
float *master_left;
|
|
|
|
float *master_right;
|
|
|
|
float **left;
|
|
|
|
float **right;
|
|
|
|
LV2_Atom_Sequence *control_port;
|
|
|
|
LV2_Atom_Sequence *core_event_port;
|
|
|
|
|
|
|
|
LV2_Atom_Forge forge;
|
|
|
|
|
|
|
|
// params
|
|
|
|
int channel;
|
|
|
|
bool ignore_velocity;
|
|
|
|
bool ignore_note_off;
|
|
|
|
int channel_nb;
|
|
|
|
int zero_position;
|
|
|
|
float **gains;
|
|
|
|
float **pans;
|
|
|
|
float *baseNote;
|
|
|
|
double rate;
|
|
|
|
|
|
|
|
// URIs
|
|
|
|
LV2_URID_Map *map;
|
|
|
|
drmr_uris uris;
|
|
|
|
|
|
|
|
// Kit info
|
|
|
|
char *current_path;
|
|
|
|
char **request_buf;
|
|
|
|
int curReq;
|
|
|
|
|
|
|
|
// Samples
|
|
|
|
drmr_sample *samples;
|
|
|
|
uint8_t num_samples;
|
|
|
|
|
|
|
|
// loading thread stuff
|
|
|
|
pthread_mutex_t load_mutex;
|
|
|
|
pthread_cond_t load_cond;
|
|
|
|
pthread_t load_thread;
|
|
|
|
} DrMr;
|
2022-04-20 12:37:32 +02:00
|
|
|
*/
|
2022-03-27 11:33:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2024-04-21 20:16:18 +02:00
|
|
|
/* DRD DATA & API definition */
|
2022-03-27 11:33:37 +02:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
2024-04-21 20:16:18 +02:00
|
|
|
# ifdef _LV2_PLUGIN_C_
|
|
|
|
# define DRD_LV2_DATA
|
|
|
|
# define DRD_LV2_API
|
|
|
|
# else
|
|
|
|
# define DRD_LV2_DATA extern
|
|
|
|
# define DRD_LV2_API extern
|
|
|
|
# endif
|
|
|
|
|
|
|
|
|
2022-03-27 11:33:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2024-04-21 20:16:18 +02:00
|
|
|
/* Public Data */
|
2022-03-27 11:33:37 +02:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
2024-04-21 20:16:18 +02:00
|
|
|
|
2022-03-27 11:33:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2024-04-21 20:16:18 +02:00
|
|
|
/* Public Prototypes */
|
2022-03-27 11:33:37 +02:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
2024-04-21 20:16:18 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ifdef _LV2_PLUGIN_C_
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-14 23:53:23 +02:00
|
|
|
/*----------------------------------------------------------------------------*/
|
2024-04-21 20:16:18 +02:00
|
|
|
/* Private Definitions */
|
2022-05-14 23:53:23 +02:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
2024-04-21 20:16:18 +02:00
|
|
|
#define DRD_MODULE_NAME "lv2"
|
|
|
|
#define LGD_MODULE_NAME "lv2"
|
2022-05-14 23:53:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-10 23:53:45 +02:00
|
|
|
/*----------------------------------------------------------------------------*/
|
2024-04-21 20:16:18 +02:00
|
|
|
/* DRG_LV2_Base */
|
2024-04-10 23:53:45 +02:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
2024-04-21 20:16:18 +02:00
|
|
|
DRT_LV2_Base DRG_LV2_Base;
|
|
|
|
|
2024-04-10 23:53:45 +02:00
|
|
|
|
|
|
|
|
2024-04-21 20:16:18 +02:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* Private Prototypes */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2024-04-10 23:53:45 +02:00
|
|
|
|
2022-04-20 12:37:32 +02:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
2022-05-14 23:53:23 +02:00
|
|
|
static void *DR_LV2_Load_Thread();
|
2022-04-20 12:37:32 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
2022-05-14 23:53:23 +02:00
|
|
|
static inline LV2_Atom *DR_LV2_Message_Midi_Info_Build( uint8_t *);
|
2022-04-20 12:37:32 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2023-07-28 01:14:53 +02:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
DRT_Status DR_UI_Port_Notify( LV2_URID, float);
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-20 12:37:32 +02:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
2022-05-14 23:53:23 +02:00
|
|
|
DRT_Status DR_LV2_Kit_Samples_Load( DRT_Kit *);
|
2022-04-20 12:37:32 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
2022-05-14 23:53:23 +02:00
|
|
|
DRT_Status DR_LV2_CurKit_Samples_Load();
|
2022-04-20 12:37:32 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
static inline void DR_Layer_To_Sample( DRT_Sample *, float);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
2022-05-14 23:53:23 +02:00
|
|
|
static inline void DR_Sample_Trigger( int, uint8_t *const, uint32_t);
|
2022-04-20 12:37:32 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
2022-05-14 23:53:23 +02:00
|
|
|
static inline void DR_Sample_Untrigger( int, uint32_t);
|
2022-04-20 12:37:32 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-29 20:48:54 +02:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
2022-05-14 23:53:23 +02:00
|
|
|
static inline void DR_Sample_UnSustain( uint32_t);
|
2022-04-29 20:48:54 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-20 12:37:32 +02:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
static LV2_Handle DR_LV2_Instantiate(const LV2_Descriptor *, double, const char *, const LV2_Feature * const *);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
static void DR_LV2_Connect_Port( LV2_Handle, uint32_t, void *);
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-11 12:52:37 +02:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
static void DR_LV2_Activate( LV2_Handle);
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-20 12:37:32 +02:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
static void DR_LV2_Run( LV2_Handle, uint32_t);
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-11 12:52:37 +02:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
static void DR_LV2_DeActivate( LV2_Handle);
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-20 12:37:32 +02:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
static void DR_LV2_Cleanup( LV2_Handle);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
static LV2_State_Status DR_LV2_Save_State( LV2_Handle, LV2_State_Store_Function, void *, uint32_t, const LV2_Feature *const *);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
static LV2_State_Status DR_LV2_Restore_State( LV2_Handle, LV2_State_Retrieve_Function, void *, uint32_t, const LV2_Feature *const *);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
static const void *DR_LV2_Extension_Data( const char *);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
LV2_SYMBOL_EXPORT const LV2_Descriptor *lv2_descriptor( uint32_t);
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-14 23:53:23 +02:00
|
|
|
|
|
|
|
|
2023-07-28 01:14:53 +02:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* Post Private Definitions */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* DRG_LV2_Descritor */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
static const LV2_Descriptor DRG_LV2_Descriptor =
|
|
|
|
{
|
|
|
|
DRD_DRUMMER_URI,
|
|
|
|
DR_LV2_Instantiate,
|
|
|
|
DR_LV2_Connect_Port,
|
|
|
|
DR_LV2_Activate,
|
|
|
|
DR_LV2_Run,
|
|
|
|
DR_LV2_DeActivate,
|
|
|
|
DR_LV2_Cleanup,
|
|
|
|
DR_LV2_Extension_Data
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-21 20:16:18 +02:00
|
|
|
# else // ifdef _LV2_PLUGIN_C_
|
2022-05-14 23:53:23 +02:00
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* Public Prototypes */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
2024-04-10 23:53:45 +02:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* DR_LV2_Map_URIS */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
//extern inline void DR_LV2_Map_URIS( LV2_URID_Map *, DRT_Drummer_URIS *);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-14 23:53:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-21 20:16:18 +02:00
|
|
|
# endif // ifdef _LV2_PLUGIN_C_
|
2022-03-27 11:33:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
#endif // ifndef _LV2_PLUGIN_H_
|
|
|
|
|