aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/eg02-midigate.lv2/midigate.c2
-rw-r--r--plugins/eg03-metro.lv2/metro.c8
-rw-r--r--plugins/eg04-sampler.lv2/sampler.c12
-rw-r--r--plugins/eg04-sampler.lv2/uris.h2
4 files changed, 12 insertions, 12 deletions
diff --git a/plugins/eg02-midigate.lv2/midigate.c b/plugins/eg02-midigate.lv2/midigate.c
index 3ed6fbf..8d2bd74 100644
--- a/plugins/eg02-midigate.lv2/midigate.c
+++ b/plugins/eg02-midigate.lv2/midigate.c
@@ -173,7 +173,7 @@ run(LV2_Handle instance, uint32_t sample_count)
}
write_output(self, offset, ev->time.frames - offset);
- offset = ev->time.frames;
+ offset = (uint32_t)ev->time.frames;
}
write_output(self, offset, sample_count - offset);
diff --git a/plugins/eg03-metro.lv2/metro.c b/plugins/eg03-metro.lv2/metro.c
index c2e18af..e7f8ead 100644
--- a/plugins/eg03-metro.lv2/metro.c
+++ b/plugins/eg03-metro.lv2/metro.c
@@ -179,17 +179,17 @@ instantiate(const LV2_Descriptor* descriptor,
// Initialise instance fields
self->rate = rate;
self->bpm = 120.0f;
- self->attack_len = attack_s * rate;
- self->decay_len = decay_s * rate;
+ self->attack_len = (uint32_t)(attack_s * rate);
+ self->decay_len = (uint32_t)(decay_s * rate);
self->state = STATE_OFF;
// Generate one cycle of a sine wave at the desired frequency
const double freq = 440.0 * 2.0;
const double amp = 0.5;
- self->wave_len = rate / freq;
+ self->wave_len = (uint32_t)(rate / freq);
self->wave = (float*)malloc(self->wave_len * sizeof(float));
for (uint32_t i = 0; i < self->wave_len; ++i) {
- self->wave[i] = sin(i * 2 * M_PI * freq / rate) * amp;
+ self->wave[i] = (float)(sin(i * 2 * M_PI * freq / rate) * amp);
}
return (LV2_Handle)self;
diff --git a/plugins/eg04-sampler.lv2/sampler.c b/plugins/eg04-sampler.lv2/sampler.c
index ee17312..54da799 100644
--- a/plugins/eg04-sampler.lv2/sampler.c
+++ b/plugins/eg04-sampler.lv2/sampler.c
@@ -48,10 +48,10 @@ enum {
static const char* default_sample_file = "click.wav";
typedef struct {
- SF_INFO info; // Info about sample from sndfile
- float* data; // Sample data in float
- char* path; // Path of file
- size_t path_len; // Length of path
+ SF_INFO info; // Info about sample from sndfile
+ float* data; // Sample data in float
+ char* path; // Path of file
+ uint32_t path_len; // Length of path
} Sample;
typedef struct {
@@ -111,7 +111,7 @@ typedef struct {
static Sample*
load_sample(Sampler* self, const char* path)
{
- const size_t path_len = strlen(path);
+ const size_t path_len = strlen(path);
lv2_log_trace(&self->logger, "Loading sample %s\n", path);
@@ -138,7 +138,7 @@ load_sample(Sampler* self, const char* path)
// Fill sample struct and return it
sample->data = data;
sample->path = (char*)malloc(path_len + 1);
- sample->path_len = path_len;
+ sample->path_len = (uint32_t)path_len;
memcpy(sample->path, path, path_len + 1);
return sample;
diff --git a/plugins/eg04-sampler.lv2/uris.h b/plugins/eg04-sampler.lv2/uris.h
index c981f9e..f9aa5a7 100644
--- a/plugins/eg04-sampler.lv2/uris.h
+++ b/plugins/eg04-sampler.lv2/uris.h
@@ -72,7 +72,7 @@ static inline LV2_Atom*
write_set_file(LV2_Atom_Forge* forge,
const SamplerURIs* uris,
const char* filename,
- const size_t filename_len)
+ const uint32_t filename_len)
{
LV2_Atom_Forge_Frame frame;
LV2_Atom* set = (LV2_Atom*)lv2_atom_forge_object(