Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add LV2 header location compatibility
  • Loading branch information
x42 committed May 7, 2023
1 parent bceab2c commit 45f74b3
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 15 deletions.
6 changes: 5 additions & 1 deletion b_chorato/lv2.c
Expand Up @@ -24,7 +24,11 @@

double SampleRateD = 48000.0; // global

#include "lv2/lv2plug.in/ns/lv2core/lv2.h"
#ifdef HAVE_LV2_1_18_6
#include <lv2/core/lv2.h>
#else
#include <lv2/lv2plug.in/ns/lv2core/lv2.h>
#endif

#define B3V_URI "http://gareus.org/oss/lv2/b_chorato"

Expand Down
6 changes: 5 additions & 1 deletion b_overdrive/lv2.c
Expand Up @@ -23,7 +23,11 @@
#include <stdlib.h>
#include <string.h>

#include "lv2/lv2plug.in/ns/lv2core/lv2.h"
#ifdef HAVE_LV2_1_18_6
#include <lv2/core/lv2.h>
#else
#include <lv2/lv2plug.in/ns/lv2core/lv2.h>
#endif

#define B3O_URI "http://gareus.org/oss/lv2/b_overdrive"

Expand Down
6 changes: 5 additions & 1 deletion b_reverb/lv2.c
Expand Up @@ -23,7 +23,11 @@
#include <stdlib.h>
#include <string.h>

#include "lv2/lv2plug.in/ns/lv2core/lv2.h"
#ifdef HAVE_LV2_1_18_6
#include <lv2/core/lv2.h>
#else
#include <lv2/lv2plug.in/ns/lv2core/lv2.h>
#endif

#define B3R_URI "http://gareus.org/oss/lv2/b_reverb"

Expand Down
18 changes: 13 additions & 5 deletions b_synth/lv2.c
Expand Up @@ -45,11 +45,19 @@
#endif

/* LV2 */
#include "lv2/lv2plug.in/ns/ext/atom/util.h"
#include "lv2/lv2plug.in/ns/ext/event/event-helpers.h"
#include "lv2/lv2plug.in/ns/ext/state/state.h"
#include "lv2/lv2plug.in/ns/ext/worker/worker.h"
#include "lv2/lv2plug.in/ns/lv2core/lv2.h"
#ifdef HAVE_LV2_1_18_6
#include <lv2/atom/util.h>
#include <lv2/core/lv2.h>
#include <lv2/event/event-helpers.h>
#include <lv2/state/state.h>
#include <lv2/worker/worker.h>
#else
#include <lv2/lv2plug.in/ns/ext/atom/util.h>
#include <lv2/lv2plug.in/ns/ext/event/event-helpers.h>
#include <lv2/lv2plug.in/ns/ext/state/state.h>
#include <lv2/lv2plug.in/ns/ext/worker/worker.h>
#include <lv2/lv2plug.in/ns/lv2core/lv2.h>
#endif

#include "uris.h"

Expand Down
6 changes: 5 additions & 1 deletion b_synth/ui.c
Expand Up @@ -48,7 +48,11 @@
#include "global_inst.h"
#include <locale.h>

#include "lv2/lv2plug.in/ns/extensions/ui/ui.h"
#ifdef HAVE_LV2_1_18_6
#include <lv2/ui/ui.h>
#else
#include <lv2/lv2plug.in/ns/extensions/ui/ui.h>
#endif
#include "pugl/pugl.h"

#ifdef XTERNAL_UI
Expand Down
18 changes: 13 additions & 5 deletions b_synth/uris.h
Expand Up @@ -20,11 +20,19 @@
#ifndef SB3_URIS_H
#define SB3_URIS_H

#include "lv2/lv2plug.in/ns/ext/atom/atom.h"
#include "lv2/lv2plug.in/ns/ext/atom/forge.h"
#include "lv2/lv2plug.in/ns/ext/midi/midi.h"
#include "lv2/lv2plug.in/ns/ext/patch/patch.h"
#include "lv2/lv2plug.in/ns/ext/urid/urid.h"
#ifdef HAVE_LV2_1_18_6
#include <lv2/atom/atom.h>
#include <lv2/atom/forge.h>
#include <lv2/midi/midi.h>
#include <lv2/patch/patch.h>
#include <lv2/urid/urid.h>
#else
#include <lv2/lv2plug.in/ns/ext/atom/atom.h>
#include <lv2/lv2plug.in/ns/ext/atom/forge.h>
#include <lv2/lv2plug.in/ns/ext/midi/midi.h>
#include <lv2/lv2plug.in/ns/ext/patch/patch.h>
#include <lv2/lv2plug.in/ns/ext/urid/urid.h>
#endif

#define SB3_URI "http://gareus.org/oss/lv2/b_synth"

Expand Down
6 changes: 5 additions & 1 deletion b_whirl/lv2.c
Expand Up @@ -28,7 +28,11 @@
#include "eqcomp.h"
#include "whirl.h"

#include "lv2/lv2plug.in/ns/lv2core/lv2.h"
#ifdef HAVE_LV2_1_18_6
#include <lv2/core/lv2.h>
#else
#include <lv2/lv2plug.in/ns/lv2core/lv2.h>
#endif

#define B3W_URI "http://gareus.org/oss/lv2/b_whirl#simple"
#define B3W_URI_EXT "http://gareus.org/oss/lv2/b_whirl#extended"
Expand Down
4 changes: 4 additions & 0 deletions common.mak
Expand Up @@ -53,6 +53,10 @@ ifeq ($(shell pkg-config --atleast-version=1.8.1 lv2 && echo yes), yes)
override CFLAGS += -DHAVE_LV2_1_8
endif

ifeq ($(shell $(PKG_CONFIG) --atleast-version=1.18.6 lv2 && echo yes), yes)
override CFLAGS += -DHAVE_LV2_1_18_6
endif

IS_OSX=
IS_WIN=
PKG_GL_LIBS=
Expand Down

0 comments on commit 45f74b3

Please sign in to comment.