fix: add transport_state_to_string and clock_source_to_string to dispatcher

Co-authored-by: aider (deepseek/deepseek-coder) <aider@aider.chat>
This commit is contained in:
Loic Coenen
2026-05-02 14:34:12 +00:00
parent 6ce8f42dd8
commit 3dae299894
2 changed files with 27 additions and 0 deletions

View File

@@ -406,6 +406,27 @@ static void* dispatcher_thread_func(void *arg) {
return NULL; return NULL;
} }
// ============================================================
// Utility functions
// ============================================================
const char* transport_state_to_string(TransportState state) {
switch (state) {
case TRANSPORT_STOPPED: return "Stopped";
case TRANSPORT_PLAYING: return "Playing";
case TRANSPORT_PAUSED: return "Paused";
default: return "Unknown";
}
}
const char* clock_source_to_string(ClockSource source) {
switch (source) {
case CLOCK_SOURCE_INTERNAL: return "Internal";
case CLOCK_SOURCE_MIDI: return "MIDI";
default: return "Unknown";
}
}
// ============================================================ // ============================================================
// Public API // Public API
// ============================================================ // ============================================================

View File

@@ -158,6 +158,12 @@ void dispatcher_stop(void);
// Get current state (thread-safe snapshot) // Get current state (thread-safe snapshot)
AppState dispatcher_get_state(void); AppState dispatcher_get_state(void);
// ============================================================
// Utility functions for state enums
// ============================================================
const char* transport_state_to_string(TransportState state);
const char* clock_source_to_string(ClockSource source);
// ============================================================ // ============================================================
// Reducer - pure function // Reducer - pure function
// ============================================================ // ============================================================