fix lv2 logging

This commit is contained in:
Stefano D'Angelo 2024-07-02 05:09:14 +02:00
parent 72d2457826
commit 6c19e01254

View File

@ -46,14 +46,14 @@ typedef struct {
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
#include "lv2/core/lv2.h" #include "lv2/core/lv2.h"
#include "lv2/core/lv2_util.h"
#include "lv2/log/log.h"
#include "lv2/log/logger.h"
#include "lv2/urid/urid.h"
#if DATA_PRODUCT_MIDI_INPUTS_N + DATA_PRODUCT_MIDI_OUTPUTS_N > 0 #if DATA_PRODUCT_MIDI_INPUTS_N + DATA_PRODUCT_MIDI_OUTPUTS_N > 0
# include "lv2/core/lv2_util.h"
# include "lv2/atom/util.h" # include "lv2/atom/util.h"
# include "lv2/atom/atom.h" # include "lv2/atom/atom.h"
# include "lv2/log/log.h"
# include "lv2/log/logger.h"
# include "lv2/midi/midi.h" # include "lv2/midi/midi.h"
# include "lv2/urid/urid.h"
#endif #endif
#ifdef DATA_UI #ifdef DATA_UI
# include "lv2/ui/ui.h" # include "lv2/ui/ui.h"
@ -102,9 +102,9 @@ typedef struct {
#endif #endif
void * mem; void * mem;
char * bundle_path; char * bundle_path;
#if DATA_PRODUCT_MIDI_INPUTS_N + DATA_PRODUCT_MIDI_OUTPUT_N > 0
LV2_URID_Map * map;
LV2_Log_Logger logger; LV2_Log_Logger logger;
LV2_URID_Map * map;
#if DATA_PRODUCT_MIDI_INPUTS_N + DATA_PRODUCT_MIDI_OUTPUTS_N > 0
LV2_URID uri_midi_MidiEvent; LV2_URID uri_midi_MidiEvent;
#endif #endif
} plugin_instance; } plugin_instance;
@ -126,7 +126,6 @@ static LV2_Handle instantiate(const struct LV2_Descriptor * descriptor, double s
if (instance->bundle_path == NULL) if (instance->bundle_path == NULL)
goto err_bundle_path; goto err_bundle_path;
#if DATA_PRODUCT_MIDI_INPUTS_N + DATA_PRODUCT_MIDI_OUTPUT_N > 0
// from https://lv2plug.in/book // from https://lv2plug.in/book
const char* missing = lv2_features_query(features, const char* missing = lv2_features_query(features,
LV2_LOG__log, &instance->logger.log, false, LV2_LOG__log, &instance->logger.log, false,
@ -139,9 +138,8 @@ static LV2_Handle instantiate(const struct LV2_Descriptor * descriptor, double s
goto err_urid; goto err_urid;
} }
#if DATA_PRODUCT_MIDI_INPUTS_N + DATA_PRODUCT_MIDI_OUTPUTS_N > 0
instance->uri_midi_MidiEvent = instance->map->map(instance->map->handle, LV2_MIDI__MidiEvent); instance->uri_midi_MidiEvent = instance->map->map(instance->map->handle, LV2_MIDI__MidiEvent);
#else
(void)features;
#endif #endif
plugin_callbacks cbs = { plugin_callbacks cbs = {