feat: add command queue and FIFO pipe for unified input handling

Co-authored-by: aider (deepseek/deepseek-reasoner) <aider@aider.chat>
This commit is contained in:
Loic Coenen
2026-05-09 21:31:54 +00:00
parent f7f18f9fa7
commit 392dabbc0f
8 changed files with 234 additions and 38 deletions

19
src/command.h Normal file
View File

@@ -0,0 +1,19 @@
#ifndef COMMAND_H
#define COMMAND_H
typedef enum {
CMD_CYCLE, // toggle record/stop for a channel
CMD_STOP, // force to idle
// CMD_LOOP_TOGGLE not needed, CYCLE covers it
CMD_BIND_CHANNEL, // bind a channel index (data = channel)
CMD_UNBIND, // reset bind to channel 0
// ADD and REMOVE are still driven via atomics for now
} cmd_type_t;
typedef struct {
cmd_type_t type;
int channel; // which channel; -1 means "current/bound"
int data; // extra parameter (e.g. bind channel number)
} command_t;
#endif