aboutsummaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-05-31 06:03:45 +0000
committerDavid Robillard <d@drobilla.net>2012-05-31 06:03:45 +0000
commit8b46fd1ff51b29cded517c9c2d166611e8c453fc (patch)
tree14a338294d302e663818570796bb5311297a9748 /src/include
parent9529f203c09d6dc8f4c2f12c3add9ec906f4bdba (diff)
downloadblop.lv2-8b46fd1ff51b29cded517c9c2d166611e8c453fc.tar.gz
blop.lv2-8b46fd1ff51b29cded517c9c2d166611e8c453fc.tar.bz2
blop.lv2-8b46fd1ff51b29cded517c9c2d166611e8c453fc.zip
Blip => Blop. I give up trying to give ports new names.
git-svn-id: http://svn.drobilla.net/lad/trunk/plugins/blop.lv2@4484 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/include')
-rw-r--r--src/include/common.h6
-rw-r--r--src/include/interpolate.h8
-rw-r--r--src/include/lp4pole_filter.h6
-rw-r--r--src/include/math_func.h2
-rw-r--r--src/include/uris.h51
-rw-r--r--src/include/wavedata.h14
-rw-r--r--src/include/wdatutil.h6
7 files changed, 72 insertions, 21 deletions
diff --git a/src/include/common.h b/src/include/common.h
index 0f30aa1..26a405a 100644
--- a/src/include/common.h
+++ b/src/include/common.h
@@ -17,8 +17,8 @@
along with this software. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef blip_common_h
-#define blip_common_h
+#ifndef blop_common_h
+#define blop_common_h
#include "math_func.h"
@@ -51,4 +51,4 @@ f_clip (float x, float a, float b)
return 0.5f * (FABSF (x - a) + a + b - FABSF (x - b));
}
-#endif /* blip_common_h */
+#endif /* blop_common_h */
diff --git a/src/include/interpolate.h b/src/include/interpolate.h
index 5fba16a..304a817 100644
--- a/src/include/interpolate.h
+++ b/src/include/interpolate.h
@@ -1,8 +1,8 @@
-#ifndef blip_interpolate_h
-#define blip_interpolate_h
+#ifndef blop_interpolate_h
+#define blop_interpolate_h
#include "lv2/lv2plug.in/ns/lv2core/lv2.h"
-#include "blip_config.h"
+#include "blop_config.h"
#include "math_func.h"
/**
@@ -72,4 +72,4 @@ f_lerp (float value,
return value;
}
-#endif /* blip_interpolate_h */
+#endif /* blop_interpolate_h */
diff --git a/src/include/lp4pole_filter.h b/src/include/lp4pole_filter.h
index adc5cba..a6b27f1 100644
--- a/src/include/lp4pole_filter.h
+++ b/src/include/lp4pole_filter.h
@@ -30,8 +30,8 @@
along with this software. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef blip_lp4pole_filter_h
-#define blip_lp4pole_filter_h
+#ifndef blop_lp4pole_filter_h
+#define blop_lp4pole_filter_h
#include "lv2/lv2plug.in/ns/lv2core/lv2.h"
#include "common.h"
@@ -134,4 +134,4 @@ lp4pole_run(LP4PoleFilter* lpf,
return lpf->out4;
}
-#endif /* blip_lp4pole_filter_h */
+#endif /* blop_lp4pole_filter_h */
diff --git a/src/include/math_func.h b/src/include/math_func.h
index 2e4b6e4..60f7ce0 100644
--- a/src/include/math_func.h
+++ b/src/include/math_func.h
@@ -7,7 +7,7 @@
#define math_func_h
#include <math.h>
-#include "blip_config.h"
+#include "blop_config.h"
#ifndef M_PI
# define M_PI 3.14159265358979323846 /* pi */
diff --git a/src/include/uris.h b/src/include/uris.h
new file mode 100644
index 0000000..538bd05
--- /dev/null
+++ b/src/include/uris.h
@@ -0,0 +1,51 @@
+/*
+ Common URIs used by plugins.
+ Copyright 2012 David Robillard
+
+ This 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.
+
+ This software 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 this software. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef blop_uris_h
+#define blop_uris_h
+
+#include <string.h>
+#include "lv2/lv2plug.in/ns/ext/urid/urid.h"
+#include "lv2/lv2plug.in/ns/lv2core/lv2.h"
+
+typedef struct {
+ LV2_URID lv2_CVPort;
+ LV2_URID lv2_ControlPort;
+} URIs;
+
+static inline void
+map_uris(URIs* uris,
+ const LV2_Feature* const* features)
+{
+ LV2_URID_Map* map = NULL;
+ for (int i = 0; features[i]; ++i) {
+ if (!strcmp(features[i]->URI, LV2_URID__map)) {
+ map = (LV2_URID_Map*)features[i]->data;
+ break;
+ }
+ }
+
+ if (map) {
+ uris->lv2_ControlPort = map->map(map->handle, LV2_CORE__ControlPort);
+ uris->lv2_CVPort = map->map(map->handle, LV2_CORE__CVPort);
+ } else {
+ memset(uris, 0, sizeof(*uris));
+ }
+}
+
+#endif /* blop_uris_h */
diff --git a/src/include/wavedata.h b/src/include/wavedata.h
index 9bd313c..9d24823 100644
--- a/src/include/wavedata.h
+++ b/src/include/wavedata.h
@@ -17,19 +17,19 @@
along with this software. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef blip_wavedata_h
-#define blip_wavedata_h
+#ifndef blop_wavedata_h
+#define blop_wavedata_h
#include "lv2/lv2plug.in/ns/lv2core/lv2.h"
-#include "blip_config.h"
+#include "blop_config.h"
#include "math_func.h"
#include "interpolate.h"
#include "common.h"
/* Functions identifying wavedata dlls */
-#define BLOP_DLSYM_SAWTOOTH "blip_get_sawtooth"
-#define BLOP_DLSYM_SQUARE "blip_get_square"
-#define BLOP_DLSYM_PARABOLA "blip_get_parabola"
+#define BLOP_DLSYM_SAWTOOTH "blop_get_sawtooth"
+#define BLOP_DLSYM_SQUARE "blop_get_square"
+#define BLOP_DLSYM_PARABOLA "blop_get_parabola"
/*
* Structure holding a single segment of sample data
@@ -191,4 +191,4 @@ wavedata_get_table(Wavedata* w,
} /* extern "C" { */
#endif
-#endif /* blip_wavedata_h */
+#endif /* blop_wavedata_h */
diff --git a/src/include/wdatutil.h b/src/include/wdatutil.h
index 931a7f3..a084c7a 100644
--- a/src/include/wdatutil.h
+++ b/src/include/wdatutil.h
@@ -17,8 +17,8 @@
along with this software. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef blip_wdatutil_h
-#define blip_wdatutil_h
+#ifndef blop_wdatutil_h
+#define blop_wdatutil_h
#include <stdio.h>
#include "lv2/lv2plug.in/ns/lv2core/lv2.h"
@@ -138,4 +138,4 @@ int wavedata_write(Wavedata* w,
} /* extern "C" { */
#endif
-#endif /* blip_wdatutil_h */
+#endif /* blop_wdatutil_h */