Transition Control

- autotransition can be turn on and of in onscreen menu
- autotransition is turned off when only one app is loaded

closes #1
closes #2
This commit is contained in:
Stephan Mühl
2023-03-22 18:34:51 +01:00
parent 1d18850c0b
commit 667fff226e
8 changed files with 95 additions and 65 deletions

View File

@@ -56,20 +56,20 @@ void MatrixDisplayUi::setTargetFPS(uint8_t fps)
// -/------ Automatic controll ------\-
void MatrixDisplayUi::enableAutoTransition()
void MatrixDisplayUi::enablesetAutoTransition()
{
this->autoTransition = true;
this->setAutoTransition = true;
}
void MatrixDisplayUi::disableAutoTransition()
void MatrixDisplayUi::disablesetAutoTransition()
{
this->autoTransition = false;
this->setAutoTransition = false;
}
void MatrixDisplayUi::setAutoTransitionForwards()
void MatrixDisplayUi::setsetAutoTransitionForwards()
{
this->state.frameTransitionDirection = 1;
this->lastTransitionDirection = 1;
}
void MatrixDisplayUi::setAutoTransitionBackwards()
void MatrixDisplayUi::setsetAutoTransitionBackwards()
{
this->state.frameTransitionDirection = -1;
this->lastTransitionDirection = -1;
@@ -173,7 +173,7 @@ int8_t MatrixDisplayUi::update()
if (timeBudget <= 0)
{
// Implement frame skipping to ensure time budget is keept
if (this->autoTransition && this->state.lastUpdate != 0)
if (this->setAutoTransition && this->state.lastUpdate != 0)
this->state.ticksSinceLastStateSwitch += ceil(-timeBudget / this->updateInterval);
this->state.lastUpdate = frameStart;
@@ -205,7 +205,7 @@ void MatrixDisplayUi::tick()
}
if (this->state.ticksSinceLastStateSwitch >= this->ticksPerFrame)
{
if (this->autoTransition)
if (this->setAutoTransition)
{
this->state.frameState = IN_TRANSITION;

View File

@@ -86,7 +86,7 @@ private:
uint16_t ticksPerFrame = 151; // ~ 5000ms at 30 FPS
uint16_t ticksPerTransition = 15; // ~ 500ms at 30 FPS
bool autoTransition = true;
bool setAutoTransition = true;
AppCallback *AppFunctions;
@@ -129,18 +129,18 @@ public:
/**
* Enable automatic transition to next frame after the some time can be configured with `setTimePerApp` and `setTimePerTransition`.
*/
void enableAutoTransition();
void enablesetAutoTransition();
/**
* Disable automatic transition to next frame.
*/
void disableAutoTransition();
void disablesetAutoTransition();
/**
* Set the direction if the automatic transitioning
*/
void setAutoTransitionForwards();
void setAutoTransitionBackwards();
void setsetAutoTransitionForwards();
void setsetAutoTransitionBackwards();
/**
* Set the approx. time a frame is displayed