aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/.clang-tidy4
-rw-r--r--plugins/eg-amp.lv2/amp.c7
-rw-r--r--plugins/eg-amp.lv2/meson.build1
-rw-r--r--plugins/eg-fifths.lv2/fifths.c25
-rw-r--r--plugins/eg-fifths.lv2/meson.build1
-rw-r--r--plugins/eg-fifths.lv2/uris.h8
-rw-r--r--plugins/eg-metro.lv2/meson.build1
-rw-r--r--plugins/eg-metro.lv2/metro.c24
-rw-r--r--plugins/eg-midigate.lv2/meson.build1
-rw-r--r--plugins/eg-midigate.lv2/midigate.c19
-rw-r--r--plugins/eg-params.lv2/meson.build1
-rw-r--r--plugins/eg-params.lv2/params.c27
-rw-r--r--plugins/eg-params.lv2/state_map.h4
-rw-r--r--plugins/eg-sampler.lv2/atom_sink.h6
-rw-r--r--plugins/eg-sampler.lv2/meson.build4
-rw-r--r--plugins/eg-sampler.lv2/peaks.h8
-rw-r--r--plugins/eg-sampler.lv2/sampler.c33
-rw-r--r--plugins/eg-sampler.lv2/sampler_ui.c29
-rw-r--r--plugins/eg-sampler.lv2/uris.h16
-rw-r--r--plugins/eg-scope.lv2/examploscope.c35
-rw-r--r--plugins/eg-scope.lv2/examploscope_ui.c50
-rw-r--r--plugins/eg-scope.lv2/meson.build2
-rw-r--r--plugins/eg-scope.lv2/uris.h6
23 files changed, 161 insertions, 151 deletions
diff --git a/plugins/.clang-tidy b/plugins/.clang-tidy
index 5fc86ab..b327b36 100644
--- a/plugins/.clang-tidy
+++ b/plugins/.clang-tidy
@@ -1,12 +1,14 @@
-# Copyright 2020-2023 David Robillard <d@drobilla.net>
+# Copyright 2020-2025 David Robillard <d@drobilla.net>
# SPDX-License-Identifier: 0BSD OR ISC
Checks: >
-*-narrowing-conversions,
-bugprone-assignment-in-if-condition,
-bugprone-easily-swappable-parameters,
+ -bugprone-multi-level-implicit-pointer-conversion,
-bugprone-suspicious-realloc-usage,
-cert-err33-c,
+ -clang-analyzer-core.NullDereference,
-hicpp-signed-bitwise,
-llvm-header-guard,
-misc-unused-parameters,
diff --git a/plugins/eg-amp.lv2/amp.c b/plugins/eg-amp.lv2/amp.c
index 90a5769..c85d6ab 100644
--- a/plugins/eg-amp.lv2/amp.c
+++ b/plugins/eg-amp.lv2/amp.c
@@ -9,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 <math.h>
@@ -105,7 +105,7 @@ activate(LV2_Handle instance)
{}
/** Define a macro for converting a gain in dB to a coefficient. */
-#define DB_CO(g) ((g) > -90.0f ? powf(10.0f, (g)*0.05f) : 0.0f)
+#define DB_CO(g) ((g) > -90.0f ? powf(10.0f, (g) * 0.05f) : 0.0f)
/**
The `run()` method is the main process function of the plugin. It processes
@@ -196,8 +196,7 @@ static const LV2_Descriptor descriptor = {AMP_URI,
This method is in the ``discovery'' threading class, so no other functions
or methods in this plugin library will be called concurrently with it.
*/
-LV2_SYMBOL_EXPORT
-const LV2_Descriptor*
+LV2_SYMBOL_EXPORT const LV2_Descriptor*
lv2_descriptor(uint32_t index)
{
return index == 0 ? &descriptor : NULL;
diff --git a/plugins/eg-amp.lv2/meson.build b/plugins/eg-amp.lv2/meson.build
index 726038e..2912e3f 100644
--- a/plugins/eg-amp.lv2/meson.build
+++ b/plugins/eg-amp.lv2/meson.build
@@ -11,6 +11,7 @@ module = shared_library(
c_args: c_suppressions,
dependencies: [lv2_dep, m_dep],
gnu_symbol_visibility: 'hidden',
+ implicit_include_directories: false,
install: true,
install_dir: lv2dir / bundle_name,
name_prefix: '',
diff --git a/plugins/eg-fifths.lv2/fifths.c b/plugins/eg-fifths.lv2/fifths.c
index 9f6a388..22d5f8a 100644
--- a/plugins/eg-fifths.lv2/fifths.c
+++ b/plugins/eg-fifths.lv2/fifths.c
@@ -1,16 +1,16 @@
// Copyright 2014-2016 David Robillard <d@drobilla.net>
// SPDX-License-Identifier: ISC
-#include "./uris.h"
+#include "uris.h"
-#include "lv2/atom/atom.h"
-#include "lv2/atom/util.h"
-#include "lv2/core/lv2.h"
-#include "lv2/core/lv2_util.h"
-#include "lv2/log/log.h"
-#include "lv2/log/logger.h"
-#include "lv2/midi/midi.h"
-#include "lv2/urid/urid.h"
+#include <lv2/atom/atom.h>
+#include <lv2/atom/util.h>
+#include <lv2/core/lv2.h>
+#include <lv2/core/lv2_util.h>
+#include <lv2/log/log.h>
+#include <lv2/log/logger.h>
+#include <lv2/midi/midi.h>
+#include <lv2/urid/urid.h>
#include <stdbool.h>
#include <stdint.h>
@@ -90,8 +90,8 @@ cleanup(LV2_Handle instance)
static void
run(LV2_Handle instance, uint32_t sample_count)
{
- Fifths* self = (Fifths*)instance;
- FifthsURIs* uris = &self->uris;
+ Fifths* self = (Fifths*)instance;
+ const FifthsURIs* uris = &self->uris;
// Struct for a 3 byte MIDI event, used for writing notes
typedef struct {
@@ -160,8 +160,7 @@ static const LV2_Descriptor descriptor = {EG_FIFTHS_URI,
cleanup,
extension_data};
-LV2_SYMBOL_EXPORT
-const LV2_Descriptor*
+LV2_SYMBOL_EXPORT const LV2_Descriptor*
lv2_descriptor(uint32_t index)
{
return index == 0 ? &descriptor : NULL;
diff --git a/plugins/eg-fifths.lv2/meson.build b/plugins/eg-fifths.lv2/meson.build
index bba21ce..d0cbc6a 100644
--- a/plugins/eg-fifths.lv2/meson.build
+++ b/plugins/eg-fifths.lv2/meson.build
@@ -11,6 +11,7 @@ module = shared_library(
c_args: c_suppressions,
dependencies: [lv2_dep, m_dep],
gnu_symbol_visibility: 'hidden',
+ implicit_include_directories: false,
install: true,
install_dir: lv2dir / bundle_name,
name_prefix: '',
diff --git a/plugins/eg-fifths.lv2/uris.h b/plugins/eg-fifths.lv2/uris.h
index 7cbbd94..f32a6bd 100644
--- a/plugins/eg-fifths.lv2/uris.h
+++ b/plugins/eg-fifths.lv2/uris.h
@@ -4,10 +4,10 @@
#ifndef FIFTHS_URIS_H
#define FIFTHS_URIS_H
-#include "lv2/atom/atom.h"
-#include "lv2/midi/midi.h"
-#include "lv2/patch/patch.h"
-#include "lv2/urid/urid.h"
+#include <lv2/atom/atom.h>
+#include <lv2/midi/midi.h>
+#include <lv2/patch/patch.h>
+#include <lv2/urid/urid.h>
#define EG_FIFTHS_URI "http://lv2plug.in/plugins/eg-fifths"
diff --git a/plugins/eg-metro.lv2/meson.build b/plugins/eg-metro.lv2/meson.build
index 5d83c9e..ee4016e 100644
--- a/plugins/eg-metro.lv2/meson.build
+++ b/plugins/eg-metro.lv2/meson.build
@@ -11,6 +11,7 @@ module = shared_library(
c_args: c_suppressions,
dependencies: [lv2_dep, m_dep],
gnu_symbol_visibility: 'hidden',
+ implicit_include_directories: false,
install: true,
install_dir: lv2dir / bundle_name,
name_prefix: '',
diff --git a/plugins/eg-metro.lv2/metro.c b/plugins/eg-metro.lv2/metro.c
index f3fe164..e60a33f 100644
--- a/plugins/eg-metro.lv2/metro.c
+++ b/plugins/eg-metro.lv2/metro.c
@@ -1,14 +1,14 @@
// Copyright 2012-2016 David Robillard <d@drobilla.net>
// SPDX-License-Identifier: ISC
-#include "lv2/atom/atom.h"
-#include "lv2/atom/util.h"
-#include "lv2/core/lv2.h"
-#include "lv2/core/lv2_util.h"
-#include "lv2/log/log.h"
-#include "lv2/log/logger.h"
-#include "lv2/time/time.h"
-#include "lv2/urid/urid.h"
+#include <lv2/atom/atom.h>
+#include <lv2/atom/util.h>
+#include <lv2/core/lv2.h>
+#include <lv2/core/lv2_util.h>
+#include <lv2/log/log.h>
+#include <lv2/log/logger.h>
+#include <lv2/time/time.h>
+#include <lv2/urid/urid.h>
#include <math.h>
#include <stdbool.h>
@@ -199,6 +199,7 @@ play(Metro* self, uint32_t begin, uint32_t end)
{
float* const output = self->ports.output;
const uint32_t frames_per_beat = (uint32_t)(60.0f / self->bpm * self->rate);
+ const float attack_den = self->attack_len ? (float)self->attack_len : 1.0f;
if (self->speed == 0.0f) {
memset(output, 0, (end - begin) * sizeof(float));
@@ -209,8 +210,8 @@ play(Metro* self, uint32_t begin, uint32_t end)
switch (self->state) {
case STATE_ATTACK:
// Amplitude increases from 0..1 until attack_len
- output[i] = self->wave[self->wave_offset] * (float)self->elapsed_len /
- (float)self->attack_len;
+ output[i] =
+ self->wave[self->wave_offset] * (float)self->elapsed_len / attack_den;
if (self->elapsed_len >= self->attack_len) {
self->state = STATE_DECAY;
}
@@ -331,8 +332,7 @@ static const LV2_Descriptor descriptor = {
NULL, // extension_data
};
-LV2_SYMBOL_EXPORT
-const LV2_Descriptor*
+LV2_SYMBOL_EXPORT const LV2_Descriptor*
lv2_descriptor(uint32_t index)
{
return index == 0 ? &descriptor : NULL;
diff --git a/plugins/eg-midigate.lv2/meson.build b/plugins/eg-midigate.lv2/meson.build
index 9f0a5ac..fc6010b 100644
--- a/plugins/eg-midigate.lv2/meson.build
+++ b/plugins/eg-midigate.lv2/meson.build
@@ -11,6 +11,7 @@ module = shared_library(
c_args: c_suppressions,
dependencies: [lv2_dep, m_dep],
gnu_symbol_visibility: 'hidden',
+ implicit_include_directories: false,
install: true,
install_dir: lv2dir / bundle_name,
name_prefix: '',
diff --git a/plugins/eg-midigate.lv2/midigate.c b/plugins/eg-midigate.lv2/midigate.c
index db2fdea..b4861db 100644
--- a/plugins/eg-midigate.lv2/midigate.c
+++ b/plugins/eg-midigate.lv2/midigate.c
@@ -1,14 +1,14 @@
// Copyright 2013-2016 David Robillard <d@drobilla.net>
// SPDX-License-Identifier: ISC
-#include "lv2/atom/atom.h"
-#include "lv2/atom/util.h"
-#include "lv2/core/lv2.h"
-#include "lv2/core/lv2_util.h"
-#include "lv2/log/log.h"
-#include "lv2/log/logger.h"
-#include "lv2/midi/midi.h"
-#include "lv2/urid/urid.h"
+#include <lv2/atom/atom.h>
+#include <lv2/atom/util.h>
+#include <lv2/core/lv2.h>
+#include <lv2/core/lv2_util.h>
+#include <lv2/log/log.h>
+#include <lv2/log/logger.h>
+#include <lv2/midi/midi.h>
+#include <lv2/urid/urid.h>
#include <stdbool.h>
#include <stdint.h>
@@ -213,8 +213,7 @@ static const LV2_Descriptor descriptor = {MIDIGATE_URI,
cleanup,
extension_data};
-LV2_SYMBOL_EXPORT
-const LV2_Descriptor*
+LV2_SYMBOL_EXPORT const LV2_Descriptor*
lv2_descriptor(uint32_t index)
{
return index == 0 ? &descriptor : NULL;
diff --git a/plugins/eg-params.lv2/meson.build b/plugins/eg-params.lv2/meson.build
index 00602bc..83c6ef9 100644
--- a/plugins/eg-params.lv2/meson.build
+++ b/plugins/eg-params.lv2/meson.build
@@ -11,6 +11,7 @@ module = shared_library(
c_args: c_suppressions,
dependencies: [lv2_dep, m_dep],
gnu_symbol_visibility: 'hidden',
+ implicit_include_directories: false,
install: true,
install_dir: lv2dir / bundle_name,
name_prefix: '',
diff --git a/plugins/eg-params.lv2/params.c b/plugins/eg-params.lv2/params.c
index af96fc8..9fbaa46 100644
--- a/plugins/eg-params.lv2/params.c
+++ b/plugins/eg-params.lv2/params.c
@@ -3,17 +3,17 @@
#include "state_map.h"
-#include "lv2/atom/atom.h"
-#include "lv2/atom/forge.h"
-#include "lv2/atom/util.h"
-#include "lv2/core/lv2.h"
-#include "lv2/core/lv2_util.h"
-#include "lv2/log/log.h"
-#include "lv2/log/logger.h"
-#include "lv2/midi/midi.h"
-#include "lv2/patch/patch.h"
-#include "lv2/state/state.h"
-#include "lv2/urid/urid.h"
+#include <lv2/atom/atom.h>
+#include <lv2/atom/forge.h>
+#include <lv2/atom/util.h>
+#include <lv2/core/lv2.h>
+#include <lv2/core/lv2_util.h>
+#include <lv2/log/log.h>
+#include <lv2/log/logger.h>
+#include <lv2/midi/midi.h>
+#include <lv2/patch/patch.h>
+#include <lv2/state/state.h>
+#include <lv2/urid/urid.h>
#include <stdbool.h>
#include <stdint.h>
@@ -320,7 +320,7 @@ save(LV2_Handle instance,
LV2_State_Status st = LV2_STATE_SUCCESS;
for (unsigned i = 0; i < N_PROPS; ++i) {
- StateMapItem* prop = &self->props[i];
+ const StateMapItem* prop = &self->props[i];
store_prop(self, map_path, &st, store, handle, prop->urid, prop->value);
}
@@ -512,8 +512,7 @@ static const LV2_Descriptor descriptor = {EG_PARAMS_URI,
cleanup,
extension_data};
-LV2_SYMBOL_EXPORT
-const LV2_Descriptor*
+LV2_SYMBOL_EXPORT const LV2_Descriptor*
lv2_descriptor(uint32_t index)
{
return (index == 0) ? &descriptor : NULL;
diff --git a/plugins/eg-params.lv2/state_map.h b/plugins/eg-params.lv2/state_map.h
index 2a29e09..c81ea29 100644
--- a/plugins/eg-params.lv2/state_map.h
+++ b/plugins/eg-params.lv2/state_map.h
@@ -1,8 +1,8 @@
// Copyright 2016 David Robillard <d@drobilla.net>
// SPDX-License-Identifier: ISC
-#include "lv2/atom/atom.h"
-#include "lv2/urid/urid.h"
+#include <lv2/atom/atom.h>
+#include <lv2/urid/urid.h>
#include <stdarg.h>
#include <stdint.h>
diff --git a/plugins/eg-sampler.lv2/atom_sink.h b/plugins/eg-sampler.lv2/atom_sink.h
index 8966eb2..3319767 100644
--- a/plugins/eg-sampler.lv2/atom_sink.h
+++ b/plugins/eg-sampler.lv2/atom_sink.h
@@ -1,9 +1,9 @@
// Copyright 2016 David Robillard <d@drobilla.net>
// SPDX-License-Identifier: ISC
-#include "lv2/atom/atom.h"
-#include "lv2/atom/forge.h"
-#include "lv2/atom/util.h"
+#include <lv2/atom/atom.h>
+#include <lv2/atom/forge.h>
+#include <lv2/atom/util.h>
#include <stdint.h>
#include <string.h>
diff --git a/plugins/eg-sampler.lv2/meson.build b/plugins/eg-sampler.lv2/meson.build
index 9700df2..a0f8799 100644
--- a/plugins/eg-sampler.lv2/meson.build
+++ b/plugins/eg-sampler.lv2/meson.build
@@ -8,12 +8,14 @@ data_filenames = ['manifest.ttl.in', 'sampler.ttl', 'click.wav']
samplerate_dep = dependency(
'samplerate',
+ include_type: 'system',
required: get_option('plugins'),
version: '>= 0.1.0',
)
sndfile_dep = dependency(
'sndfile',
+ include_type: 'system',
required: get_option('plugins'),
version: '>= 1.0.0',
)
@@ -32,6 +34,7 @@ if samplerate_dep.found() and sndfile_dep.found()
c_args: c_suppressions,
dependencies: [lv2_dep, m_dep, samplerate_dep, sndfile_dep],
gnu_symbol_visibility: 'hidden',
+ implicit_include_directories: false,
install: true,
install_dir: lv2dir / bundle_name,
name_prefix: '',
@@ -70,6 +73,7 @@ if samplerate_dep.found() and sndfile_dep.found()
c_args: ui_suppressions,
dependencies: [lv2_dep, gtk2_dep],
gnu_symbol_visibility: 'hidden',
+ implicit_include_directories: false,
install: true,
install_dir: lv2dir / bundle_name,
name_prefix: '',
diff --git a/plugins/eg-sampler.lv2/peaks.h b/plugins/eg-sampler.lv2/peaks.h
index 47d6616..ff91546 100644
--- a/plugins/eg-sampler.lv2/peaks.h
+++ b/plugins/eg-sampler.lv2/peaks.h
@@ -14,10 +14,10 @@
requested, with reasonably sized incremental updates sent over plugin ports.
*/
-#include "lv2/atom/atom.h"
-#include "lv2/atom/forge.h"
-#include "lv2/atom/util.h"
-#include "lv2/urid/urid.h"
+#include <lv2/atom/atom.h>
+#include <lv2/atom/forge.h>
+#include <lv2/atom/util.h>
+#include <lv2/urid/urid.h>
#include <math.h>
#include <stdbool.h>
diff --git a/plugins/eg-sampler.lv2/sampler.c b/plugins/eg-sampler.lv2/sampler.c
index d870a07..6fc04c5 100644
--- a/plugins/eg-sampler.lv2/sampler.c
+++ b/plugins/eg-sampler.lv2/sampler.c
@@ -7,17 +7,17 @@
#include "peaks.h"
#include "uris.h"
-#include "lv2/atom/atom.h"
-#include "lv2/atom/forge.h"
-#include "lv2/atom/util.h"
-#include "lv2/core/lv2.h"
-#include "lv2/core/lv2_util.h"
-#include "lv2/log/log.h"
-#include "lv2/log/logger.h"
-#include "lv2/midi/midi.h"
-#include "lv2/state/state.h"
-#include "lv2/urid/urid.h"
-#include "lv2/worker/worker.h"
+#include <lv2/atom/atom.h>
+#include <lv2/atom/forge.h>
+#include <lv2/atom/util.h>
+#include <lv2/core/lv2.h>
+#include <lv2/core/lv2_util.h>
+#include <lv2/log/log.h>
+#include <lv2/log/logger.h>
+#include <lv2/midi/midi.h>
+#include <lv2/state/state.h>
+#include <lv2/urid/urid.h>
+#include <lv2/worker/worker.h>
#include <samplerate.h>
#include <sndfile.h>
@@ -249,9 +249,9 @@ work(LV2_Handle instance,
static LV2_Worker_Status
work_response(LV2_Handle instance, uint32_t size, const void* data)
{
- Sampler* self = (Sampler*)instance;
- Sample* old_sample = self->sample;
- Sample* new_sample = *(Sample* const*)data;
+ Sampler* self = (Sampler*)instance;
+ Sample* old_sample = self->sample;
+ const Sample* new_sample = *(Sample* const*)data;
// Install the new sample
self->sample = *(Sample* const*)data;
@@ -353,7 +353,7 @@ deactivate(LV2_Handle instance)
}
/** Define a macro for converting a gain in dB to a coefficient. */
-#define DB_CO(g) ((g) > -90.0f ? powf(10.0f, (g)*0.05f) : 0.0f)
+#define DB_CO(g) ((g) > -90.0f ? powf(10.0f, (g) * 0.05f) : 0.0f)
/**
Handle an incoming event in the audio thread.
@@ -688,8 +688,7 @@ static const LV2_Descriptor descriptor = {EG_SAMPLER_URI,
cleanup,
extension_data};
-LV2_SYMBOL_EXPORT
-const LV2_Descriptor*
+LV2_SYMBOL_EXPORT const LV2_Descriptor*
lv2_descriptor(uint32_t index)
{
return index == 0 ? &descriptor : NULL;
diff --git a/plugins/eg-sampler.lv2/sampler_ui.c b/plugins/eg-sampler.lv2/sampler_ui.c
index 16a8c71..769dde0 100644
--- a/plugins/eg-sampler.lv2/sampler_ui.c
+++ b/plugins/eg-sampler.lv2/sampler_ui.c
@@ -4,16 +4,16 @@
#include "peaks.h"
#include "uris.h"
-#include "lv2/atom/atom.h"
-#include "lv2/atom/forge.h"
-#include "lv2/atom/util.h"
-#include "lv2/core/lv2.h"
-#include "lv2/core/lv2_util.h"
-#include "lv2/log/log.h"
-#include "lv2/log/logger.h"
-#include "lv2/midi/midi.h"
-#include "lv2/ui/ui.h"
-#include "lv2/urid/urid.h"
+#include <lv2/atom/atom.h>
+#include <lv2/atom/forge.h>
+#include <lv2/atom/util.h>
+#include <lv2/core/lv2.h>
+#include <lv2/core/lv2_util.h>
+#include <lv2/log/log.h>
+#include <lv2/log/logger.h>
+#include <lv2/midi/midi.h>
+#include <lv2/ui/ui.h>
+#include <lv2/urid/urid.h>
#include <cairo.h>
#include <gdk/gdk.h>
@@ -183,13 +183,13 @@ on_canvas_expose(GtkWidget* widget, GdkEventExpose* event, gpointer data)
// Draw line through top peaks
for (int i = 0; i < n_peaks; ++i) {
const float peak = peaks[i];
- cairo_line_to(cr, i * scale, mid_y + (peak / 2.0f) * size.height);
+ cairo_line_to(cr, i * scale, mid_y + ((peak / 2.0f) * size.height));
}
// Continue through bottom peaks
for (int i = n_peaks - 1; i >= 0; --i) {
const float peak = peaks[i];
- cairo_line_to(cr, i * scale, mid_y - (peak / 2.0f) * size.height);
+ cairo_line_to(cr, i * scale, mid_y - ((peak / 2.0f) * size.height));
}
// Close shape
@@ -421,7 +421,7 @@ ui_hide(LV2UI_Handle handle)
static int
ui_idle(LV2UI_Handle handle)
{
- SamplerUI* ui = (SamplerUI*)handle;
+ const SamplerUI* ui = (const SamplerUI*)handle;
if (ui->window) {
gtk_main_iteration_do(false);
}
@@ -451,8 +451,7 @@ static const LV2UI_Descriptor descriptor = {SAMPLER_UI_URI,
port_event,
extension_data};
-LV2_SYMBOL_EXPORT
-const LV2UI_Descriptor*
+LV2_SYMBOL_EXPORT const LV2UI_Descriptor*
lv2ui_descriptor(uint32_t index)
{
return index == 0 ? &descriptor : NULL;
diff --git a/plugins/eg-sampler.lv2/uris.h b/plugins/eg-sampler.lv2/uris.h
index f934390..9922f51 100644
--- a/plugins/eg-sampler.lv2/uris.h
+++ b/plugins/eg-sampler.lv2/uris.h
@@ -4,13 +4,13 @@
#ifndef SAMPLER_URIS_H
#define SAMPLER_URIS_H
-#include "lv2/atom/atom.h"
-#include "lv2/atom/forge.h"
-#include "lv2/atom/util.h"
-#include "lv2/midi/midi.h"
-#include "lv2/parameters/parameters.h"
-#include "lv2/patch/patch.h"
-#include "lv2/urid/urid.h"
+#include <lv2/atom/atom.h>
+#include <lv2/atom/forge.h>
+#include <lv2/atom/util.h>
+#include <lv2/midi/midi.h>
+#include <lv2/parameters/parameters.h>
+#include <lv2/patch/patch.h>
+#include <lv2/urid/urid.h>
#include <stdint.h>
#include <stdio.h>
@@ -164,7 +164,7 @@ read_set_file(const SamplerURIs* uris, const LV2_Atom_Object* obj)
return NULL;
}
- return (const char*)LV2_ATOM_BODY_CONST(value);
+ return (const char*)&value[1];
}
#endif /* SAMPLER_URIS_H */
diff --git a/plugins/eg-scope.lv2/examploscope.c b/plugins/eg-scope.lv2/examploscope.c
index e3bb53b..5cdb610 100644
--- a/plugins/eg-scope.lv2/examploscope.c
+++ b/plugins/eg-scope.lv2/examploscope.c
@@ -2,17 +2,17 @@
// Copyright 2013 Robin Gareus <robin@gareus.org>
// SPDX-License-Identifier: ISC
-#include "./uris.h"
-
-#include "lv2/atom/atom.h"
-#include "lv2/atom/forge.h"
-#include "lv2/atom/util.h"
-#include "lv2/core/lv2.h"
-#include "lv2/core/lv2_util.h"
-#include "lv2/log/log.h"
-#include "lv2/log/logger.h"
-#include "lv2/state/state.h"
-#include "lv2/urid/urid.h"
+#include "uris.h"
+
+#include <lv2/atom/atom.h>
+#include <lv2/atom/forge.h>
+#include <lv2/atom/util.h>
+#include <lv2/core/lv2.h>
+#include <lv2/core/lv2_util.h>
+#include <lv2/log/log.h>
+#include <lv2/log/logger.h>
+#include <lv2/state/state.h>
+#include <lv2/urid/urid.h>
#include <stdbool.h>
#include <stdint.h>
@@ -169,11 +169,11 @@ connect_port(LV2_Handle handle, uint32_t port, void* data)
http://lv2plug.in/ns/ext/atom#Float[Float].
*/
static void
-tx_rawaudio(LV2_Atom_Forge* forge,
- ScoLV2URIs* uris,
- const int32_t channel,
- const size_t n_samples,
- const float* data)
+tx_rawaudio(LV2_Atom_Forge* forge,
+ const ScoLV2URIs* uris,
+ const int32_t channel,
+ const size_t n_samples,
+ const float* data)
{
LV2_Atom_Forge_Frame frame;
@@ -398,8 +398,7 @@ static const LV2_Descriptor descriptor_stereo = {SCO_URI "#Stereo",
cleanup,
extension_data};
-LV2_SYMBOL_EXPORT
-const LV2_Descriptor*
+LV2_SYMBOL_EXPORT const LV2_Descriptor*
lv2_descriptor(uint32_t index)
{
switch (index) {
diff --git a/plugins/eg-scope.lv2/examploscope_ui.c b/plugins/eg-scope.lv2/examploscope_ui.c
index 1c82d44..4f366aa 100644
--- a/plugins/eg-scope.lv2/examploscope_ui.c
+++ b/plugins/eg-scope.lv2/examploscope_ui.c
@@ -1,14 +1,14 @@
// Copyright 2013 Robin Gareus <robin@gareus.org>
// SPDX-License-Identifier: ISC
-#include "./uris.h"
+#include "uris.h"
-#include "lv2/atom/atom.h"
-#include "lv2/atom/forge.h"
-#include "lv2/atom/util.h"
-#include "lv2/core/lv2.h"
-#include "lv2/ui/ui.h"
-#include "lv2/urid/urid.h"
+#include <lv2/atom/atom.h>
+#include <lv2/atom/forge.h>
+#include <lv2/atom/util.h>
+#include <lv2/core/lv2.h>
+#include <lv2/ui/ui.h>
+#include <lv2/urid/urid.h>
#include <cairo.h>
#include <gdk/gdk.h>
@@ -110,6 +110,8 @@ send_ui_state(LV2UI_Handle handle)
lv2_atom_total_size(msg),
ui->uris.atom_eventTransfer,
msg);
+
+ lv2_atom_forge_set_buffer(&ui->forge, NULL, 0);
}
/** Notify backend that UI is closed. */
@@ -134,6 +136,8 @@ send_ui_disable(LV2UI_Handle handle)
lv2_atom_total_size(msg),
ui->uris.atom_eventTransfer,
msg);
+
+ lv2_atom_forge_set_buffer(&ui->forge, NULL, 0);
}
/**
@@ -167,7 +171,7 @@ send_ui_enable(LV2UI_Handle handle)
static gboolean
on_cfg_changed(GtkWidget* widget, gpointer data)
{
- EgScopeUI* ui = (EgScopeUI*)data;
+ const EgScopeUI* ui = (const EgScopeUI*)data;
if (!ui->updating) {
// Only send UI state if the change is from user interaction
send_ui_state(data);
@@ -206,6 +210,7 @@ on_expose_event(GtkWidget* widget, GdkEventExpose* ev, gpointer data)
assert(start < DAWIDTH);
assert(end <= DAWIDTH);
assert(start < end);
+ assert(ui->n_channels <= 2U);
for (uint32_t c = 0; c < ui->n_channels; ++c) {
ScoChan* chn = &ui->chn[c];
@@ -219,10 +224,10 @@ on_expose_event(GtkWidget* widget, GdkEventExpose* ev, gpointer data)
* - (DAHEIGHT / 2) * (VAL) * (GAIN)
* )
*/
- const float chn_y_offset = DAHEIGHT * c + DAHEIGHT * 0.5f - 0.5f;
- const float chn_y_scale = DAHEIGHT * 0.5f * gain;
+ const float chn_y_offset = (DAHEIGHT * c) + (DAHEIGHT * 0.5f) - 0.5f;
+ const float chn_y_scale = (DAHEIGHT * 0.5f) * gain;
-#define CYPOS(VAL) (chn_y_offset - (VAL)*chn_y_scale)
+#define CYPOS(VAL) (chn_y_offset - ((VAL) * chn_y_scale))
cairo_save(cr);
@@ -292,15 +297,15 @@ on_expose_event(GtkWidget* widget, GdkEventExpose* ev, gpointer data)
// Channel separator
if (c > 0) {
cairo_set_source_rgba(cr, .5, .5, .5, 1.0);
- cairo_move_to(cr, 0, DAHEIGHT * c - .5);
- cairo_line_to(cr, DAWIDTH, DAHEIGHT * c - .5);
+ cairo_move_to(cr, 0, (DAHEIGHT * c) - .5);
+ cairo_line_to(cr, DAWIDTH, (DAHEIGHT * c) - .5);
cairo_stroke(cr);
}
// Zero scale line
cairo_set_source_rgba(cr, .3, .3, .7, .5);
- cairo_move_to(cr, 0, DAHEIGHT * (c + .5) - .5);
- cairo_line_to(cr, DAWIDTH, DAHEIGHT * (c + .5) - .5);
+ cairo_move_to(cr, 0, (DAHEIGHT * (c + .5)) - .5);
+ cairo_line_to(cr, DAWIDTH, (DAHEIGHT * (c + .5)) - .5);
cairo_stroke(cr);
}
@@ -327,12 +332,12 @@ on_expose_event(GtkWidget* widget, GdkEventExpose* ev, gpointer data)
and https://github.com/x42/sisco.lv2
*/
static int
-process_channel(EgScopeUI* ui,
- ScoChan* chn,
- const size_t n_elem,
- float const* data,
- uint32_t* idx_start,
- uint32_t* idx_end)
+process_channel(const EgScopeUI* ui,
+ ScoChan* chn,
+ const size_t n_elem,
+ float const* data,
+ uint32_t* idx_start,
+ uint32_t* idx_end)
{
int overflow = 0;
*idx_start = chn->idx;
@@ -655,8 +660,7 @@ static const LV2UI_Descriptor descriptor = {SCO_URI "#ui",
port_event,
NULL};
-LV2_SYMBOL_EXPORT
-const LV2UI_Descriptor*
+LV2_SYMBOL_EXPORT const LV2UI_Descriptor*
lv2ui_descriptor(uint32_t index)
{
return index == 0 ? &descriptor : NULL;
diff --git a/plugins/eg-scope.lv2/meson.build b/plugins/eg-scope.lv2/meson.build
index d776ee7..84e17ba 100644
--- a/plugins/eg-scope.lv2/meson.build
+++ b/plugins/eg-scope.lv2/meson.build
@@ -19,6 +19,7 @@ module = shared_library(
c_args: c_suppressions,
dependencies: [lv2_dep, m_dep],
gnu_symbol_visibility: 'hidden',
+ implicit_include_directories: false,
install: true,
install_dir: lv2dir / bundle_name,
name_prefix: '',
@@ -55,6 +56,7 @@ if gtk2_dep.found()
c_args: c_suppressions,
dependencies: [lv2_dep, gtk2_dep],
gnu_symbol_visibility: 'hidden',
+ implicit_include_directories: false,
install: true,
install_dir: lv2dir / bundle_name,
name_prefix: '',
diff --git a/plugins/eg-scope.lv2/uris.h b/plugins/eg-scope.lv2/uris.h
index 86778ce..d9d94be 100644
--- a/plugins/eg-scope.lv2/uris.h
+++ b/plugins/eg-scope.lv2/uris.h
@@ -4,9 +4,9 @@
#ifndef SCO_URIS_H
#define SCO_URIS_H
-#include "lv2/atom/atom.h"
-#include "lv2/parameters/parameters.h"
-#include "lv2/urid/urid.h"
+#include <lv2/atom/atom.h>
+#include <lv2/parameters/parameters.h>
+#include <lv2/urid/urid.h>
#define SCO_URI "http://lv2plug.in/plugins/eg-scope"