feat: add WAV load/save and ring buffer implementation

Co-authored-by: aider (deepseek/deepseek-reasoner) <aider@aider.chat>
This commit is contained in:
Loic Coenen
2026-05-11 21:15:12 +00:00
parent 6b490ed739
commit 5a2414b4c3
9 changed files with 319 additions and 3 deletions

View File

@@ -8,6 +8,8 @@
#define LOOP_BUF_SIZE (5 * 48000)
#define MAX_CHANNELS 16
#include "ringbuffer.h"
typedef enum {
STATE_IDLE,
STATE_RECORD,
@@ -25,6 +27,8 @@ struct channel_t {
atomic_int active;
jack_port_t *audio_in;
jack_port_t *audio_out;
RingBuf *save_ring;
};
/* Globals declared in looper.c */
@@ -33,6 +37,8 @@ extern atomic_int channel_count;
extern int next_channel_id;
extern atomic_int cmd_add;
extern atomic_int cmd_remove;
extern atomic_int cmd_load;
extern atomic_int cmd_save;
void channel_add(jack_client_t *client, int idx);
void channel_remove(jack_client_t *client, int idx);