#ifndef CHANNEL_H #define CHANNEL_H // cppcheck-suppress missingIncludeSystem #include #include #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