From 3dae29989495b0fbf1528d878eae9b0795291d9d Mon Sep 17 00:00:00 2001 From: Loic Coenen Date: Sat, 2 May 2026 14:34:12 +0000 Subject: [PATCH] fix: add transport_state_to_string and clock_source_to_string to dispatcher Co-authored-by: aider (deepseek/deepseek-coder) --- dispatcher.c | 21 +++++++++++++++++++++ dispatcher.h | 6 ++++++ 2 files changed, 27 insertions(+) diff --git a/dispatcher.c b/dispatcher.c index 3f737f4..4e01718 100644 --- a/dispatcher.c +++ b/dispatcher.c @@ -406,6 +406,27 @@ static void* dispatcher_thread_func(void *arg) { 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 // ============================================================ diff --git a/dispatcher.h b/dispatcher.h index 2e0c681..c18881f 100644 --- a/dispatcher.h +++ b/dispatcher.h @@ -158,6 +158,12 @@ void dispatcher_stop(void); // Get current state (thread-safe snapshot) 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 // ============================================================