aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/eg-scope.lv2/examploscope.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/eg-scope.lv2/examploscope.c')
-rw-r--r--plugins/eg-scope.lv2/examploscope.c61
1 files changed, 24 insertions, 37 deletions
diff --git a/plugins/eg-scope.lv2/examploscope.c b/plugins/eg-scope.lv2/examploscope.c
index ec013a1..5cdb610 100644
--- a/plugins/eg-scope.lv2/examploscope.c
+++ b/plugins/eg-scope.lv2/examploscope.c
@@ -1,31 +1,18 @@
-/*
- Copyright 2016 David Robillard <d@drobilla.net>
- Copyright 2013 Robin Gareus <robin@gareus.org>
-
- 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.
-*/
-
-#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"
+// Copyright 2016 David Robillard <d@drobilla.net>
+// 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 <stdbool.h>
#include <stdint.h>
@@ -182,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;
@@ -249,7 +236,7 @@ run(LV2_Handle handle, uint32_t n_samples)
// Add UI state as properties
lv2_atom_forge_key(&self->forge, self->uris.ui_spp);
- lv2_atom_forge_int(&self->forge, self->ui_spp);
+ lv2_atom_forge_int(&self->forge, (int32_t)self->ui_spp);
lv2_atom_forge_key(&self->forge, self->uris.ui_amp);
lv2_atom_forge_float(&self->forge, self->ui_amp);
lv2_atom_forge_key(&self->forge, self->uris.param_sampleRate);
@@ -295,7 +282,8 @@ run(LV2_Handle handle, uint32_t n_samples)
for (uint32_t c = 0; c < self->n_channels; ++c) {
if (self->ui_active) {
// If UI is active, send raw audio data to UI
- tx_rawaudio(&self->forge, &self->uris, c, n_samples, self->input[c]);
+ tx_rawaudio(
+ &self->forge, &self->uris, (int32_t)c, n_samples, self->input[c]);
}
// If not processing audio in-place, forward audio
if (self->input[c] != self->output[c]) {
@@ -410,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) {