2024-04-14 16:17:19 +02:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* lv2_util.c */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* 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-10 23:53:45 +02:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* Includes */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
#define _LV2_UTILS_C_
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <drummer.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/* DR_LV2_Log_Write */
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
/*
|
|
|
|
DRT_Status DR_LV2_Log_Write( DRT_Log_Type_Id Log_Type_Id, char *Out_Fmt, va_list Args)
|
|
|
|
{
|
|
|
|
LV2_URID type;
|
|
|
|
|
|
|
|
|
|
|
|
switch( Log_Type_Id)
|
|
|
|
{
|
|
|
|
case DRD_LOG_TYPE_ID_TRACE:
|
|
|
|
{
|
|
|
|
type = DRG_LV2_Base.Logger.Trace;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case DRD_LOG_TYPE_ID_INFO:
|
|
|
|
{
|
|
|
|
type = DRG_LV2_Base.Logger.Note;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case DRD_LOG_TYPE_ID_WARNING:
|
|
|
|
{
|
|
|
|
type = DRG_LV2_Base.Logger.Warning;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case DRD_LOG_TYPE_ID_ERROR:
|
|
|
|
case DRD_LOG_TYPE_ID_UNKNOWN:
|
|
|
|
default:
|
|
|
|
{
|
|
|
|
type = DRG_LV2_Base.Logger.Error;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if( lv2_log_vprintf( &(DRG_LV2_Base.Logger), type, Out_Fmt, Args) == 0)
|
|
|
|
{
|
|
|
|
fprintf( stderr, "LV2 logger error...\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
return( DRS_OK);
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
2024-04-14 16:17:19 +02:00
|
|
|
/* DR_LV2_Map_URIS */
|
2024-04-10 23:53:45 +02:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
void DR_LV2_Map_URIS( LV2_URID_Map *Map_Ptr, DRT_Drummer_URIS *URIS)
|
|
|
|
{
|
|
|
|
URIS->Atom_Object = Map_Ptr->map( Map_Ptr->handle, LV2_ATOM__Object);
|
|
|
|
|
|
|
|
URIS->String_URId = Map_Ptr->map( Map_Ptr->handle, LV2_ATOM__String);
|
|
|
|
URIS->Bool_URId = Map_Ptr->map( Map_Ptr->handle, LV2_ATOM__Bool);
|
|
|
|
URIS->Int_URId = Map_Ptr->map( Map_Ptr->handle, LV2_ATOM__Int);
|
|
|
|
URIS->Long_URId = Map_Ptr->map( Map_Ptr->handle, LV2_ATOM__Long);
|
|
|
|
URIS->Tuple_URId = Map_Ptr->map( Map_Ptr->handle, LV2_ATOM__Tuple);
|
|
|
|
|
|
|
|
URIS->Midi_Event = Map_Ptr->map( Map_Ptr->handle, "http://lv2plug.in/ns/ext/midi#MidiEvent");
|
|
|
|
|
|
|
|
URIS->Atom_EventTransfer = Map_Ptr->map( Map_Ptr->handle, LV2_ATOM__eventTransfer);
|
|
|
|
|
|
|
|
URIS->UI_Msg = Map_Ptr->map( Map_Ptr->handle, DRD_DRUMMER_URI "#uimsg");
|
|
|
|
|
|
|
|
URIS->UI_Enable = Map_Ptr->map( Map_Ptr->handle, DRD_DRUMMER_URI "#uienable");
|
|
|
|
URIS->UI_Disable = Map_Ptr->map( Map_Ptr->handle, DRD_DRUMMER_URI "#uidisable");
|
|
|
|
|
|
|
|
URIS->Kit_Update_Request = Map_Ptr->map( Map_Ptr->handle, DRD_DRUMMER_URI "#kitupdaterequest");
|
|
|
|
URIS->Kit_Update_Reply = Map_Ptr->map( Map_Ptr->handle, DRD_DRUMMER_URI "#kitupdatereply");
|
|
|
|
|
|
|
|
URIS->Velocity_Ignore_Flag_Toggle = Map_Ptr->map( Map_Ptr->handle, DRD_DRUMMER_URI "#velocitytoggle");
|
|
|
|
URIS->Note_Off_Ignore_Flag_Toggle = Map_Ptr->map( Map_Ptr->handle, DRD_DRUMMER_URI "#noteofftoggle");
|
|
|
|
|
|
|
|
/*
|
|
|
|
URIS->kit_path = Map_Ptr->map( Map_Ptr->handle, DRD_DRUMMER_URI "#kitpath");
|
|
|
|
URIS->get_state = Map_Ptr->map( Map_Ptr->handle, DRD_DRUMMER_URI "#getstate");
|
|
|
|
URIS->midi_info = Map_Ptr->map( Map_Ptr->handle, DRD_DRUMMER_URI "#midiinfo");
|
|
|
|
URIS->sample_trigger = Map_Ptr->map( Map_Ptr->handle, DRD_DRUMMER_URI "#sampletrigger");
|
|
|
|
URIS->velocity_toggle = Map_Ptr->map( Map_Ptr->handle, DRD_DRUMMER_URI "#velocitytoggle");
|
|
|
|
URIS->note_off_toggle = Map_Ptr->map( Map_Ptr->handle, DRD_DRUMMER_URI "#noteofftoggle");
|
|
|
|
URIS->channel_id = Map_Ptr->map( Map_Ptr->handle, DRD_DRUMMER_URI "#channelid");
|
|
|
|
URIS->zero_position = Map_Ptr->map( Map_Ptr->handle, DRD_DRUMMER_URI "#zeroposition");
|
|
|
|
URIS->sample_add = Map_Ptr->map( Map_Ptr->handle, DRD_DRUMMER_URI "#sampleadd");
|
|
|
|
URIS->sample_remove = Map_Ptr->map( Map_Ptr->handle, DRD_DRUMMER_URI "#sampleremove");
|
|
|
|
*/
|
|
|
|
}
|