diff options
author | David Robillard <d@drobilla.net> | 2012-07-29 14:52:45 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-07-29 14:52:45 +0000 |
commit | 05d03c23f1fec952ad9c03208d301c3cf182d4ab (patch) | |
tree | 89ad6061bf9faacb904cb83c1d78af2712cbbd80 /src | |
parent | a30b5e886557659fed57d788e3cf164c7d81dc1d (diff) | |
download | blop.lv2-05d03c23f1fec952ad9c03208d301c3cf182d4ab.tar.gz blop.lv2-05d03c23f1fec952ad9c03208d301c3cf182d4ab.tar.bz2 blop.lv2-05d03c23f1fec952ad9c03208d301c3cf182d4ab.zip |
Add missing file (fix #848).
git-svn-id: http://svn.drobilla.net/lad/trunk/plugins/blop.lv2@4567 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r-- | src/include/uris.h | 51 |
1 files changed, 51 insertions, 0 deletions
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 */ |