mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-29 01:47:43 +01:00
remove c99'ness from rsynth.c - should fix #5751
This commit is contained in:
parent
f52cfdd639
commit
e451411719
3 changed files with 21 additions and 16 deletions
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
/* LV2 */
|
||||
#include "lv2/lv2plug.in/ns/lv2core/lv2.h"
|
||||
#include "lv2/lv2plug.in/ns/ext/atom/util.h"
|
||||
#include "lv2/lv2plug.in/ns/ext/atom/atom.h"
|
||||
#include "lv2/lv2plug.in/ns/ext/urid/urid.h"
|
||||
#include "lv2/lv2plug.in/ns/ext/midi/midi.h"
|
||||
|
||||
|
|
@ -35,7 +35,7 @@
|
|||
static void * synth_alloc (void);
|
||||
static void synth_init (void *, double rate);
|
||||
static void synth_free (void *);
|
||||
static void synth_parse_midi (void *, uint8_t *data, size_t size);
|
||||
static void synth_parse_midi (void *, const uint8_t *data, const size_t size);
|
||||
static uint32_t synth_sound (void *, uint32_t written, uint32_t nframes, float **out);
|
||||
|
||||
#include "rsynth.c"
|
||||
|
|
@ -131,8 +131,8 @@ run(LV2_Handle handle, uint32_t n_samples)
|
|||
|
||||
/* Process incoming MIDI events */
|
||||
if (self->midiin) {
|
||||
LV2_Atom_Event* ev = lv2_atom_sequence_begin(&(self->midiin)->body);
|
||||
while(!lv2_atom_sequence_is_end(&(self->midiin)->body, (self->midiin)->atom.size, ev)) {
|
||||
LV2_Atom_Event const* ev = (LV2_Atom_Event const*) ((&(self->midiin)->body) + 1); // lv2_atom_sequence_begin
|
||||
while( (const uint8_t*)ev < ((const uint8_t*) &(self->midiin)->body + (self->midiin)->atom.size) ) {
|
||||
if (ev->body.type == self->midi_MidiEvent) {
|
||||
if (written + BUFFER_SIZE_SAMPLES < ev->time.frames
|
||||
&& ev->time.frames < n_samples) {
|
||||
|
|
@ -140,9 +140,9 @@ run(LV2_Handle handle, uint32_t n_samples)
|
|||
written = synth_sound(self->synth, written, ev->time.frames, audio);
|
||||
}
|
||||
/* send midi message to synth */
|
||||
synth_parse_midi(self->synth, (uint8_t*)(ev+1), ev->body.size);
|
||||
synth_parse_midi(self->synth, (const uint8_t*)(ev+1), ev->body.size);
|
||||
}
|
||||
ev = lv2_atom_sequence_next(ev);
|
||||
ev = (LV2_Atom_Event const*)((const uint8_t*)ev + sizeof(LV2_Atom_Event) + ((ev->body.size + 7) & ~7));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue