Files
looper/src/channel.h
Loic Coenen b1e330e839 refactor: remove stale cmd_add/cmd_remove declarations from channel.h
Co-authored-by: aider (deepseek/deepseek-reasoner) <aider@aider.chat>
2026-05-09 22:20:35 +00:00

39 lines
854 B
C

#ifndef CHANNEL_H
#define CHANNEL_H
// cppcheck-suppress missingIncludeSystem
#include <jack/jack.h>
#include <stdatomic.h>
#define LOOP_BUF_SIZE (5 * 48000)
#define MAX_CHANNELS 16
typedef enum {
STATE_IDLE,
STATE_RECORD,
STATE_LOOPING,
STATE_PAUSED
} looper_state;
struct channel_t {
atomic_int state;
int prev_state;
float loop_buffer[LOOP_BUF_SIZE];
int loop_count;
int record_pos;
int playback_pos;
atomic_int active;
jack_port_t *audio_in;
jack_port_t *audio_out;
};
/* Globals declared in looper.c */
extern struct channel_t channels[MAX_CHANNELS];
extern atomic_int channel_count;
extern int next_channel_id;
void channel_add(jack_client_t *client, int idx);
void channel_remove(jack_client_t *client, int idx);
#endif