33 lines
768 B
C++
33 lines
768 B
C++
/*
|
|
* MIT License
|
|
* Author: Mark Allyn
|
|
*
|
|
* knob_panel.h — Thread 3 stub: future hardware encoder panel.
|
|
*
|
|
* When physical encoders are installed, KnobPanel will read them via
|
|
* GPIO/serial and write to SharedRenderState under Mutex A. Until
|
|
* then, the thread starts but idles immediately without touching
|
|
* SharedRenderState. The keyboard equivalents in PPIScope handle
|
|
* the same state fields in the meantime.
|
|
*/
|
|
|
|
#pragma once
|
|
#include <thread>
|
|
#include <atomic>
|
|
#include "shared_render_state.h"
|
|
|
|
class KnobPanel {
|
|
public:
|
|
explicit KnobPanel(SharedRenderState& srs) : srs_(srs) {}
|
|
|
|
void start();
|
|
void stop();
|
|
|
|
private:
|
|
void run();
|
|
|
|
SharedRenderState& srs_;
|
|
std::thread thread_;
|
|
std::atomic<bool> running_{false};
|
|
};
|