summaryrefslogtreecommitdiffstats
path: root/bindings
diff options
context:
space:
mode:
Diffstat (limited to 'bindings')
-rw-r--r--bindings/python/Makefile2
-rw-r--r--bindings/python/conf.py8
-rw-r--r--bindings/python/index.rst4
-rw-r--r--bindings/python/lilv.py11
-rwxr-xr-xbindings/python/lv2_apply.py3
-rwxr-xr-xbindings/python/lv2_list.py3
-rwxr-xr-xbindings/python/lv2_list_presets.py3
-rw-r--r--bindings/python/meson.build9
-rw-r--r--bindings/test/bindings_test_plugin.c84
-rw-r--r--bindings/test/python/test_api.py13
10 files changed, 78 insertions, 62 deletions
diff --git a/bindings/python/Makefile b/bindings/python/Makefile
index e63c124..32f199d 100644
--- a/bindings/python/Makefile
+++ b/bindings/python/Makefile
@@ -1,5 +1,7 @@
# Makefile for Sphinx documentation
#
+# Copyright 2016 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: 0BSD OR ISC
# You can set these variables from the command line.
SPHINXOPTS =
diff --git a/bindings/python/conf.py b/bindings/python/conf.py
index 576919e..4fc0911 100644
--- a/bindings/python/conf.py
+++ b/bindings/python/conf.py
@@ -1,4 +1,8 @@
# -*- coding: utf-8 -*-
+
+# Copyright 2016-2024 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: 0BSD OR ISC
+
#
# Lilv documentation build configuration file, created by
# sphinx-quickstart on Sun Sep 4 18:25:58 2016.
@@ -56,9 +60,9 @@ copyright = u'2016, David Robillard'
# built documents.
#
# The short X.Y version.
-version = '0.24.2'
+version = '0.24.27'
# The full version, including alpha/beta/rc tags.
-release = '0.24.2'
+release = '0.24.27'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/bindings/python/index.rst b/bindings/python/index.rst
index 4616054..b44fa08 100644
--- a/bindings/python/index.rst
+++ b/bindings/python/index.rst
@@ -1,3 +1,7 @@
+..
+ Copyright 2016 David Robillard <d@drobilla.net>
+ SPDX-License-Identifier: ISC
+
Lilv Python Documentation
=========================
diff --git a/bindings/python/lilv.py b/bindings/python/lilv.py
index 45b8e05..100b3d1 100644
--- a/bindings/python/lilv.py
+++ b/bindings/python/lilv.py
@@ -1,9 +1,12 @@
"""Lilv Python interface"""
+# Copyright 2016-2022 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: ISC
+
__author__ = "David Robillard"
-__copyright__ = "Copyright 2016-2020 David Robillard"
+__copyright__ = "Copyright 2016-2024 David Robillard"
__license__ = "ISC"
-__version__ = "0.24.7"
+__version__ = "0.24.27"
__maintainer__ = "David Robillard"
__email__ = "d@drobilla.net"
__status__ = "Production"
@@ -1460,6 +1463,10 @@ class Instance(Structure):
self.get_descriptor().connect_port(
self.get_handle(), port_index, data
)
+ elif isinstance(data, Structure):
+ self.get_descriptor().connect_port(
+ self.get_handle(), port_index, cast(byref(data), c_void_p)
+ )
elif type(data) == numpy.ndarray:
self.get_descriptor().connect_port(
self.get_handle(),
diff --git a/bindings/python/lv2_apply.py b/bindings/python/lv2_apply.py
index 4c7d9b4..bb95682 100755
--- a/bindings/python/lv2_apply.py
+++ b/bindings/python/lv2_apply.py
@@ -1,6 +1,9 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
+# Copyright 2011-2016 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: ISC
+
import math
import lilv
import sys
diff --git a/bindings/python/lv2_list.py b/bindings/python/lv2_list.py
index babe1b4..1bb233c 100755
--- a/bindings/python/lv2_list.py
+++ b/bindings/python/lv2_list.py
@@ -1,5 +1,8 @@
#!/usr/bin/env python
+# Copyright 2007-2011 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: ISC
+
import lilv
world = lilv.World()
diff --git a/bindings/python/lv2_list_presets.py b/bindings/python/lv2_list_presets.py
index 4e0c9b1..a6439d6 100755
--- a/bindings/python/lv2_list_presets.py
+++ b/bindings/python/lv2_list_presets.py
@@ -1,6 +1,9 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
+# Copyright 2019-2020 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: ISC
+
import sys
import lilv
diff --git a/bindings/python/meson.build b/bindings/python/meson.build
new file mode 100644
index 0000000..1cffd71
--- /dev/null
+++ b/bindings/python/meson.build
@@ -0,0 +1,9 @@
+# Copyright 2021-2022 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: 0BSD OR ISC
+
+pymod = import('python')
+py = pymod.find_installation('python3', required: get_option('bindings_py'))
+
+if py.found()
+ py.install_sources(files('lilv.py'))
+endif
diff --git a/bindings/test/bindings_test_plugin.c b/bindings/test/bindings_test_plugin.c
index 1945c0d..0397db4 100644
--- a/bindings/test/bindings_test_plugin.c
+++ b/bindings/test/bindings_test_plugin.c
@@ -1,19 +1,6 @@
-/*
- Copyright 2006-2019 David Robillard <d@drobilla.net>
- Copyright 2006 Steve Harris <steve@plugin.org.uk>
-
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted, provided that the above
- copyright notice and this permission notice appear in all copies.
-
- THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-*/
+// Copyright 2006-2019 David Robillard <d@drobilla.net>
+// Copyright 2006 Steve Harris <steve@plugin.org.uk>
+// SPDX-License-Identifier: ISC
/**
LV2 headers are based on the URI of the specification they come from, so a
@@ -22,7 +9,7 @@
replacing `http:/` with `lv2` any header in the specification bundle can be
included, in this case `lv2.h`.
*/
-#include "lv2/core/lv2.h"
+#include <lv2/core/lv2.h>
/** Include standard C headers */
#include <stdint.h>
@@ -42,10 +29,10 @@
should be defined for readability.
*/
typedef enum {
- TEST_CONTROL_IN = 0,
- TEST_CONTROL_OUT = 1,
- TEST_AUDIO_IN = 2,
- TEST_AUDIO_OUT = 3
+ TEST_CONTROL_IN = 0,
+ TEST_CONTROL_OUT = 1,
+ TEST_AUDIO_IN = 2,
+ TEST_AUDIO_OUT = 3
} PortIndex;
/**
@@ -54,7 +41,7 @@ typedef enum {
every instance method. In this simple plugin, only port buffers need to be
stored, since there is no additional instance data. */
typedef struct {
- float* buf;
+ float* buf;
} Test;
/**
@@ -73,9 +60,14 @@ instantiate(const LV2_Descriptor* descriptor,
const char* bundle_path,
const LV2_Feature* const* features)
{
- Test* test = (Test*)malloc(sizeof(Test));
+ (void)descriptor;
+ (void)rate;
+ (void)bundle_path;
+ (void)features;
+
+ Test* test = (Test*)malloc(sizeof(Test));
- return (LV2_Handle)test;
+ return (LV2_Handle)test;
}
/**
@@ -87,10 +79,11 @@ instantiate(const LV2_Descriptor* descriptor,
context as run().
*/
static void
-connect_port(LV2_Handle instance,
- uint32_t port,
- void* data)
+connect_port(LV2_Handle instance, uint32_t port, void* data)
{
+ (void)instance;
+ (void)port;
+ (void)data;
}
/**
@@ -105,12 +98,15 @@ connect_port(LV2_Handle instance,
static void
activate(LV2_Handle instance)
{
+ (void)instance;
}
/** Process a block of audio (audio thread, must be RT safe). */
static void
run(LV2_Handle instance, uint32_t n_samples)
{
+ (void)instance;
+ (void)n_samples;
}
/**
@@ -127,6 +123,7 @@ run(LV2_Handle instance, uint32_t n_samples)
static void
deactivate(LV2_Handle instance)
{
+ (void)instance;
}
/**
@@ -138,7 +135,7 @@ deactivate(LV2_Handle instance)
static void
cleanup(LV2_Handle instance)
{
- free(instance);
+ free(instance);
}
/**
@@ -154,7 +151,9 @@ cleanup(LV2_Handle instance)
static const void*
extension_data(const char* uri)
{
- return NULL;
+ (void)uri;
+
+ return NULL;
}
/**
@@ -162,22 +161,20 @@ extension_data(const char* uri)
statically to avoid leaking memory and non-portable shared library
constructors and destructors to clean up properly.
*/
-static const LV2_Descriptor descriptor = {
- TEST_URI,
- instantiate,
- connect_port,
- activate,
- run,
- deactivate,
- cleanup,
- extension_data
-};
+static const LV2_Descriptor descriptor = {TEST_URI,
+ instantiate,
+ connect_port,
+ activate,
+ run,
+ deactivate,
+ cleanup,
+ extension_data};
/**
The lv2_descriptor() function is the entry point to the plugin library. The
host will load the library and call this function repeatedly with increasing
indices to find all the plugins defined in the library. The index is not an
- indentifier, the URI of the returned descriptor is used to determine the
+ identifier, the URI of the returned descriptor is used to determine the
identify of the plugin.
This method is in the ``discovery'' threading class, so no other functions
@@ -187,10 +184,5 @@ LV2_SYMBOL_EXPORT
const LV2_Descriptor*
lv2_descriptor(uint32_t index)
{
- switch (index) {
- case 0:
- return &descriptor;
- default:
- return NULL;
- }
+ return index ? NULL : &descriptor;
}
diff --git a/bindings/test/python/test_api.py b/bindings/test/python/test_api.py
index 8d3a94a..d70dbe6 100644
--- a/bindings/test/python/test_api.py
+++ b/bindings/test/python/test_api.py
@@ -1,17 +1,6 @@
# Copyright 2016-2020 David Robillard <d@drobilla.net>
# Copyright 2013 Kaspar Emanuel <kaspar.emanuel@gmail.com>
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+# SPDX-License-Identifier: ISC
import lilv
import os