Deluge Firmware 1.3.0
Build date: 2026.08.23
Loading...
Searching...
No Matches
screensaver.h
1/*
2 * Copyright © 2026 Synthstrom Audible Limited
3 *
4 * This file is part of The Synthstrom Audible Deluge Firmware.
5 *
6 * The Synthstrom Audible Deluge Firmware is free software: you can redistribute it and/or modify it under the
7 * terms of the GNU General Public License as published by the Free Software Foundation,
8 * either version 3 of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
11 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 * See the GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along with this program.
15 * If not, see <https://www.gnu.org/licenses/>.
16 */
17
18#pragma once
19
20#include "hid/display/oled_canvas/canvas.h"
21#include "hid/display/rainfall.h"
22#include "hid/display/starfield.h"
23
24namespace deluge::hid::display {
25
36public:
39
46 static void noteActivity();
47
51 static void timerEvent();
52
55 static void settingsChanged();
56
58
61
65 [[nodiscard]] static bool isActive() { return active_; }
66
77 static bool consumeFrameDirty() {
78 bool was = frameDirty_;
79 frameDirty_ = false;
80 return was;
81 }
82
87 static oled_canvas::Canvas& getCanvas() { return canvas_; }
88
90
91private:
93 static void arm();
95 static void render();
97 static void renderStarfield();
99 static void renderRainfall();
100
101 static bool active_;
102 static bool frameDirty_;
103 static oled_canvas::Canvas canvas_;
104 static Starfield starfield_;
105 static Rainfall rainfall_;
106};
107
108} // namespace deluge::hid::display
A field of falling diagonal rain streaks, in the visual grammar of the Deluge logo.
Definition rainfall.h:34
Blanks the OLED, or replaces it with a starfield or a field of Deluge rain, after a configurable peri...
Definition screensaver.h:35
static void arm()
Set the idle timer from the configured timeout.
Definition screensaver.cpp:79
static bool isActive()
Whether the screensaver is currently overriding the panel contents.
Definition screensaver.h:65
static oled_canvas::Canvas & getCanvas()
The canvas the screensaver draws into, which sendMainImage() sends in place of main.
Definition screensaver.h:87
static void noteActivity()
Register that a physical control was touched: wake the screensaver if it is showing,...
Definition screensaver.cpp:83
static void render()
Draw the current frame into canvas_ and mark it dirty.
Definition screensaver.cpp:179
static bool consumeFrameDirty()
Test and clear the "our canvas changed" flag.
Definition screensaver.h:77
static void renderRainfall()
Draw the rainfall's streaks into canvas_.
Definition screensaver.cpp:202
static void renderStarfield()
Draw the starfield's stars into canvas_.
Definition screensaver.cpp:195
static void timerEvent()
Activate the screensaver, or advance it one animation frame.
Definition screensaver.cpp:99
static void settingsChanged()
Apply a change to the mode or timeout setting: wake if showing, then re-arm or cancel the timer for t...
Definition screensaver.cpp:165
Perspective-projection starfield.
Definition starfield.h:35