aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/eg-sampler.lv2
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/eg-sampler.lv2')
-rw-r--r--plugins/eg-sampler.lv2/atom_sink.h17
-rw-r--r--plugins/eg-sampler.lv2/meson.build44
-rw-r--r--plugins/eg-sampler.lv2/peaks.h22
-rw-r--r--plugins/eg-sampler.lv2/sampler.c24
-rw-r--r--plugins/eg-sampler.lv2/sampler_ui.c18
-rw-r--r--plugins/eg-sampler.lv2/uris.h18
6 files changed, 52 insertions, 91 deletions
diff --git a/plugins/eg-sampler.lv2/atom_sink.h b/plugins/eg-sampler.lv2/atom_sink.h
index 57035e1..8966eb2 100644
--- a/plugins/eg-sampler.lv2/atom_sink.h
+++ b/plugins/eg-sampler.lv2/atom_sink.h
@@ -1,18 +1,5 @@
-/*
- Copyright 2016 David Robillard <d@drobilla.net>
-
- 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 2016 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
#include "lv2/atom/atom.h"
#include "lv2/atom/forge.h"
diff --git a/plugins/eg-sampler.lv2/meson.build b/plugins/eg-sampler.lv2/meson.build
index 1283a8f..9700df2 100644
--- a/plugins/eg-sampler.lv2/meson.build
+++ b/plugins/eg-sampler.lv2/meson.build
@@ -1,17 +1,29 @@
# Copyright 2022 David Robillard <d@drobilla.net>
-# SPDX-License-Identifier: CC0-1.0 OR ISC
+# SPDX-License-Identifier: 0BSD OR ISC
plugin_sources = files('sampler.c')
+ui_sources = files('sampler_ui.c')
bundle_name = 'eg-sampler.lv2'
data_filenames = ['manifest.ttl.in', 'sampler.ttl', 'click.wav']
-samplerate_dep = dependency('samplerate',
- version: '>= 0.1.0',
- required: get_option('plugins'))
+samplerate_dep = dependency(
+ 'samplerate',
+ required: get_option('plugins'),
+ version: '>= 0.1.0',
+)
-sndfile_dep = dependency('sndfile',
- version: '>= 1.0.0',
- required: get_option('plugins'))
+sndfile_dep = dependency(
+ 'sndfile',
+ required: get_option('plugins'),
+ version: '>= 1.0.0',
+)
+
+gtk2_dep = dependency(
+ 'gtk+-2.0',
+ include_type: 'system',
+ required: get_option('plugins'),
+ version: '>= 2.18.0',
+)
if samplerate_dep.found() and sndfile_dep.found()
module = shared_library(
@@ -45,4 +57,22 @@ if samplerate_dep.found() and sndfile_dep.found()
)
endif
endforeach
+
+ if gtk2_dep.found()
+ ui_suppressions = c_suppressions
+ if cc.get_id() == 'gcc'
+ ui_suppressions += ['-Wno-strict-overflow']
+ endif
+
+ shared_library(
+ 'sampler_ui',
+ ui_sources,
+ c_args: ui_suppressions,
+ dependencies: [lv2_dep, gtk2_dep],
+ gnu_symbol_visibility: 'hidden',
+ install: true,
+ install_dir: lv2dir / bundle_name,
+ name_prefix: '',
+ )
+ endif
endif
diff --git a/plugins/eg-sampler.lv2/peaks.h b/plugins/eg-sampler.lv2/peaks.h
index 7a5f3e3..47d6616 100644
--- a/plugins/eg-sampler.lv2/peaks.h
+++ b/plugins/eg-sampler.lv2/peaks.h
@@ -1,19 +1,5 @@
-/*
- LV2 audio peaks utilities
- Copyright 2016 David Robillard <d@drobilla.net>
-
- 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 2016 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
#ifndef PEAKS_H_INCLUDED
#define PEAKS_H_INCLUDED
@@ -166,11 +152,11 @@ peaks_sender_send(PeaksSender* sender,
forge, &vec_frame, sizeof(float), uris->atom_Float);
// Calculate how many peaks to send this update
- const uint32_t chunk_size = MAX(1u, sender->n_samples / sender->n_peaks);
+ const uint32_t chunk_size = MAX(1U, sender->n_samples / sender->n_peaks);
const uint32_t space = forge->size - forge->offset;
const uint32_t remaining = sender->n_peaks - sender->current_offset;
const uint32_t n_update =
- MIN(remaining, MIN(n_frames / 4u, space / sizeof(float)));
+ MIN(remaining, MIN(n_frames / 4U, space / sizeof(float)));
// Calculate peak (maximum magnitude) for each chunk
for (uint32_t i = 0; i < n_update; ++i) {
diff --git a/plugins/eg-sampler.lv2/sampler.c b/plugins/eg-sampler.lv2/sampler.c
index c978d2b..d870a07 100644
--- a/plugins/eg-sampler.lv2/sampler.c
+++ b/plugins/eg-sampler.lv2/sampler.c
@@ -1,21 +1,7 @@
-/*
- LV2 Sampler Example Plugin
- Copyright 2011-2016 David Robillard <d@drobilla.net>
- Copyright 2011 Gabriel M. Beddingfield <gabriel@teuton.org>
- Copyright 2011 James Morris <jwm.art.net@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.
-*/
+// Copyright 2011-2016 David Robillard <d@drobilla.net>
+// Copyright 2011 Gabriel M. Beddingfield <gabriel@teuton.org>
+// Copyright 2011 James Morris <jwm.art.net@gmail.com>
+// SPDX-License-Identifier: ISC
#include "atom_sink.h"
#include "peaks.h"
@@ -148,7 +134,7 @@ load_sample(LV2_Log_Logger* logger, const char* path, const int sample_rate)
return NULL;
}
- sf_seek(sndfile, 0ul, SEEK_SET);
+ sf_seek(sndfile, 0UL, SEEK_SET);
sf_read_float(sndfile, data, info->frames * info->channels);
sf_close(sndfile);
diff --git a/plugins/eg-sampler.lv2/sampler_ui.c b/plugins/eg-sampler.lv2/sampler_ui.c
index 630fc22..16a8c71 100644
--- a/plugins/eg-sampler.lv2/sampler_ui.c
+++ b/plugins/eg-sampler.lv2/sampler_ui.c
@@ -1,19 +1,5 @@
-/*
- LV2 Sampler Example Plugin UI
- Copyright 2011-2016 David Robillard <d@drobilla.net>
-
- 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 2011-2016 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
#include "peaks.h"
#include "uris.h"
diff --git a/plugins/eg-sampler.lv2/uris.h b/plugins/eg-sampler.lv2/uris.h
index d7201fa..f934390 100644
--- a/plugins/eg-sampler.lv2/uris.h
+++ b/plugins/eg-sampler.lv2/uris.h
@@ -1,19 +1,5 @@
-/*
- LV2 Sampler Example Plugin
- Copyright 2011-2016 David Robillard <d@drobilla.net>
-
- 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 2011-2016 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
#ifndef SAMPLER_URIS_H
#define SAMPLER_URIS_H