2#include <initializer_list>
4#include "../util/Stack.h"
406 std::initializer_list<UiCanvasDescriptor>
canvases,
439 return primaryOneBitGraphicsDisplayId_;
445 return specialControlIds_;
451 static constexpr int kMaxNumPages = 32;
452 static constexpr int kMaxNumCanvases = 8;
455 uint32_t lastUpdateTimes_[kMaxNumCanvases];
458 SpecialControlIds specialControlIds_;
464 void ProcessEvent(
const UiEventQueue::Event&
m);
469 void RebuildPageVisibilities();
Definition leddriver.h:33
A generic UI system.
Definition UI.h:362
void Mute(bool shouldBeMuted, bool queueEvents=false)
SpecialControlIds GetSpecialControlIds() const
Definition UI.h:443
void Init(UiEventQueue &inputQueue, const SpecialControlIds &specialControlIds, std::initializer_list< UiCanvasDescriptor > canvases, uint16_t primaryOneBitGraphicsDisplayId=invalidCanvasId)
uint16_t GetPrimaryOneBitGraphicsDisplayId() const
Definition UI.h:437
void OpenPage(UiPage &page)
void ClosePage(UiPage &page)
static constexpr uint16_t invalidCanvasId
Definition UI.h:392
A queue that holds user input events in the UI system.
Definition UiEventQueue.h:18
static constexpr uint16_t invalidPotId
Definition UiEventQueue.h:27
static constexpr uint16_t invalidEncoderId
Definition UiEventQueue.h:24
static constexpr uint16_t invalidButtonId
Definition UiEventQueue.h:21
The base class for a page in the UI system.
Definition UI.h:75
virtual void Draw(const UiCanvasDescriptor &canvas)=0
virtual bool OnMenuEncoderActivityChanged(bool isCurrentlyActive)
Definition UI.h:238
virtual bool IsOpaque(const UiCanvasDescriptor &display)
Definition UI.h:86
virtual bool OnButton(uint16_t buttonID, uint8_t numberOfPresses, bool isRetriggering)
Definition UI.h:185
virtual bool OnEncoderTurned(uint16_t encoderID, int16_t turns, uint16_t stepsPerRevolution)
Definition UI.h:224
virtual void OnFocusLost()
Definition UI.h:324
const UI * GetParentUI() const
Definition UI.h:335
virtual bool OnValuePotMoved(float newPosition)
Definition UI.h:272
UiPage()
Definition UI.h:77
virtual bool OnValueEncoderTurned(int16_t turns, uint16_t stepsPerRevolution)
Definition UI.h:210
virtual bool OnEncoderActivityChanged(uint16_t encoderID, bool isCurrentlyActive)
Definition UI.h:260
UI * GetParentUI()
Definition UI.h:333
virtual ~UiPage()
Definition UI.h:79
virtual void OnHide()
Definition UI.h:318
virtual bool OnOkayButton(uint8_t numberOfPresses, bool isRetriggering)
Definition UI.h:114
virtual bool OnMenuEncoderTurned(int16_t turns, uint16_t stepsPerRevolution)
Definition UI.h:198
virtual bool OnCancelButton(uint8_t numberOfPresses, bool isRetriggering)
Definition UI.h:130
virtual void OnFocusGained()
Definition UI.h:321
bool IsActive()
Definition UI.h:93
virtual void OnShow()
Definition UI.h:315
virtual bool OnFunctionButton(uint8_t numberOfPresses, bool isRetriggering)
Definition UI.h:166
virtual bool OnValueEncoderActivityChanged(bool isCurrentlyActive)
Definition UI.h:248
virtual bool OnValuePotActivityChanged(bool isCurrentlyActive)
Definition UI.h:295
virtual bool OnPotActivityChanged(uint16_t potID, bool isCurrentlyActive)
Definition UI.h:307
virtual void OnUserInteraction()
Definition UI.h:98
virtual bool OnPotMoved(uint16_t potID, float newPosition)
Definition UI.h:284
virtual bool OnArrowButton(ArrowButtonType arrowType, uint8_t numberOfPresses, bool isRetriggering)
Definition UI.h:147
ArrowButtonType
The type of arrow button in the UI system.
Definition UI.h:15
Hardware defines and helpers for daisy field platform.
Definition index.h:2
uint16_t cancelBttnId
Definition UI.h:378
uint16_t leftBttnId
Definition UI.h:381
uint16_t downBttnId
Definition UI.h:380
uint16_t funcBttnId
Definition UI.h:376
uint16_t rightBttnId
Definition UI.h:382
uint16_t valuePotId
Definition UI.h:388
uint16_t valueEncoderId
Definition UI.h:386
uint16_t menuEncoderId
Definition UI.h:384
uint16_t upBttnId
Definition UI.h:379
uint16_t okBttnId
Definition UI.h:377
A descriptor for a canvas in the UI system.
Definition UI.h:34
uint8_t id_
Definition UI.h:37
uint32_t screenSaverTimeOut
Definition UI.h:53
bool screenSaverOn
Definition UI.h:55
FlushFuncPtr flushFunction_
Definition UI.h:65
void * handle_
Definition UI.h:43
uint32_t updateRateMs_
Definition UI.h:46
ClearFuncPtr clearFunction_
Definition UI.h:59