diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/eg-amp.lv2/amp.c | 5 | ||||
-rw-r--r-- | plugins/eg-fifths.lv2/fifths.c | 21 | ||||
-rw-r--r-- | plugins/eg-fifths.lv2/uris.h | 8 | ||||
-rw-r--r-- | plugins/eg-metro.lv2/metro.c | 24 | ||||
-rw-r--r-- | plugins/eg-midigate.lv2/midigate.c | 19 | ||||
-rw-r--r-- | plugins/eg-params.lv2/params.c | 25 | ||||
-rw-r--r-- | plugins/eg-params.lv2/state_map.h | 4 | ||||
-rw-r--r-- | plugins/eg-sampler.lv2/atom_sink.h | 6 | ||||
-rw-r--r-- | plugins/eg-sampler.lv2/peaks.h | 8 | ||||
-rw-r--r-- | plugins/eg-sampler.lv2/sampler.c | 25 | ||||
-rw-r--r-- | plugins/eg-sampler.lv2/sampler_ui.c | 23 | ||||
-rw-r--r-- | plugins/eg-sampler.lv2/uris.h | 14 | ||||
-rw-r--r-- | plugins/eg-scope.lv2/examploscope.c | 25 | ||||
-rw-r--r-- | plugins/eg-scope.lv2/examploscope_ui.c | 18 | ||||
-rw-r--r-- | plugins/eg-scope.lv2/uris.h | 6 |
15 files changed, 112 insertions, 119 deletions
diff --git a/plugins/eg-amp.lv2/amp.c b/plugins/eg-amp.lv2/amp.c index 9c22049..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> @@ -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-fifths.lv2/fifths.c b/plugins/eg-fifths.lv2/fifths.c index d2400b4..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> @@ -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/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/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/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/params.c b/plugins/eg-params.lv2/params.c index 742c48b..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> @@ -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/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 4c5a92a..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> @@ -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 fc879eb..b02082a 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> @@ -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 3d3ac10..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> diff --git a/plugins/eg-scope.lv2/examploscope.c b/plugins/eg-scope.lv2/examploscope.c index 918fca2..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> @@ -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 7b49967..2ad42dc 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> @@ -206,6 +206,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]; @@ -655,8 +656,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/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" |