Deluge Firmware
Loading...
Searching...
No Matches
numericdriver.h
Go to the documentation of this file.
1/*
2 * Copyright © 2014-2023 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#ifndef NUMERICDRIVER_H
19#define NUMERICDRIVER_H
20
21
22#include "definitions.h"
25
27{
28public:
30
31 void setText(char const *newText, bool alignRight = false, uint8_t drawDot = 255, bool doBlink = false, uint8_t* newBlinkMask = NULL, bool blinkImmediately = false, bool shouldBlinkFast = false, int scrollPos = 0, uint8_t* blinkAddition = NULL, bool justReplaceBottomLayer = false);
32 void setNextTransitionDirection(int8_t thisDirection);
33 void displayPopup(char const *newText, int8_t numFlashes = 3, bool alignRight = false, uint8_t drawDot = 255, int blinkSpeed = 1);
34 void freezeWithError(char const* text);
35 void cancelPopup();
36 void displayError(int error);
37
38
39#if !HAVE_OLED
40 void setTextAsNumber(int16_t number, uint8_t drawDot = 255, bool doBlink = false);
41 void setTextAsSlot(int16_t currentSlot, int8_t currentSubSlot, bool currentSlotExists, bool doBlink = false, int blinkPos = -1, bool blinkImmediately = false);
42 void timerRoutine();
43 void removeTopLayer();
44 NumericLayerScrollingText* setScrollingText(char const* newText, int startAtPos = 0, int initialDelay = 600);
45 int getEncodedPosFromLeft(int textPos, char const* text, bool* andAHalf);
46 void render();
47 void displayLoadingAnimation(bool delayed = false, bool transparent = false);
49#endif
50
52
53private:
54
55 NumericLayer* topLayer;
57 int8_t nextTransitionDirection;
58
59
60 void deleteAllLayers();
61
62#if !HAVE_OLED
63 int encodeText(char const *newText, uint8_t *destination, bool alignRight, uint8_t drawDot = 255, bool limitToDisplayLength = true, int scrollPos = 0);
64 void replaceBottomLayer(NumericLayer* newLayer);
65 void setTopLayer(NumericLayer* newTopLayer);
66 void transitionToNewLayer(NumericLayer* newLayer);
67 void setTextVeryBasicA1(char const* text);
68#endif
69
70};
71
72extern "C" void displayPopupIfAllBootedUp(char const* text);
73
75
76#endif // NUMERICDRIVER_H
Definition: numericdriver.h:27
void freezeWithError(char const *text)
Definition: numericdriver.cpp:600
NumericLayerScrollingText * setScrollingText(char const *newText, int startAtPos=0, int initialDelay=600)
Definition: numericdriver.cpp:182
void removeTopLayer()
Definition: numericdriver.cpp:119
int getEncodedPosFromLeft(int textPos, char const *text, bool *andAHalf)
Definition: numericdriver.cpp:257
void displayPopup(char const *newText, int8_t numFlashes=3, bool alignRight=false, uint8_t drawDot=255, int blinkSpeed=1)
Definition: numericdriver.cpp:495
void setTextAsSlot(int16_t currentSlot, int8_t currentSubSlot, bool currentSlotExists, bool doBlink=false, int blinkPos=-1, bool blinkImmediately=false)
Definition: numericdriver.cpp:469
void setNextTransitionDirection(int8_t thisDirection)
Definition: numericdriver.cpp:491
void timerRoutine()
Definition: numericdriver.cpp:529
void render()
Definition: numericdriver.cpp:547
void setTextAsNumber(int16_t number, uint8_t drawDot=255, bool doBlink=false)
Definition: numericdriver.cpp:461
void displayLoadingAnimation(bool delayed=false, bool transparent=false)
Definition: numericdriver.cpp:570
void cancelPopup()
Definition: numericdriver.cpp:514
void setText(char const *newText, bool alignRight=false, uint8_t drawDot=255, bool doBlink=false, uint8_t *newBlinkMask=NULL, bool blinkImmediately=false, bool shouldBlinkFast=false, int scrollPos=0, uint8_t *blinkAddition=NULL, bool justReplaceBottomLayer=false)
Definition: numericdriver.cpp:136
bool popupActive
Definition: numericdriver.h:51
bool isLayerCurrentlyOnTop(NumericLayer *layer)
Definition: numericdriver.cpp:638
void displayError(int error)
Definition: numericdriver.cpp:643
NumericDriver()
Definition: numericdriver.cpp:90
Definition: NumericLayerBasicText.h:23
Definition: NumericLayer.h:24
Definition: NumericLayerScrollingText.h:23
void displayPopupIfAllBootedUp(char const *text)
Definition: numericdriver.cpp:631
NumericDriver numericDriver
Definition: numericdriver.cpp:43