// components/hal/led_stub.h #pragma once #include class LedStub { public: virtual ~LedStub() {} virtual void begin() = 0; virtual void set_led_state(uint8_t note, uint8_t channel, uint8_t velocity) = 0; virtual void clear_all() = 0; // Helper function to map MIDI note to LED index virtual uint8_t note_to_index(uint8_t note) { return note; } }; // LED state structure struct LedState { uint8_t note; // Launchpad note uint8_t channel; // LED channel (1-3) uint8_t velocity; // Color/brightness (0-127) uint32_t timestamp; // When state was set bool active; // Current on/off state }; // Default stub implementation class DefaultLedStub : public LedStub { private: static const uint8_t NUM_LEDS = 10; LedState led_states[NUM_LEDS]; bool initialized; public: DefaultLedStub(); void begin() override; void set_led_state(uint8_t note, uint8_t channel, uint8_t velocity) override; void clear_all() override; };