OSCR
Open Source Cartridge Reader
Loading...
Searching...
No Matches
OSCR::UI::ProgressBar Namespace Reference

Progress bar methods. More...

Functions

void init (uint32_t maxProgress)
void init (uint32_t maxProgress, uint8_t lineOffset)
void advance (uint32_t steps=1)
void finish ()
void render (bool end=false)

Variables

uint32_t current = 0
uint32_t total = 0
uint32_t lastUpdate = 0

Detailed Description

Progress bar methods.

Function Documentation

◆ advance()

void OSCR::UI::ProgressBar::advance ( uint32_t steps = 1)
extern

Advance the progress bar.

Parameters
stepsThe amount to advance by (default: 1).

◆ finish()

void OSCR::UI::ProgressBar::finish ( )
extern

Finish the progress bar (set current to total and render it).

◆ init() [1/2]

void OSCR::UI::ProgressBar::init ( uint32_t maxProgress)
extern

Initilize the progress bar with the provided max/target value.

Parameters
maxProgressThe maximum the progress bar will reach.

◆ init() [2/2]

void OSCR::UI::ProgressBar::init ( uint32_t maxProgress,
uint8_t lineOffset )
extern

Initilize the progress bar offset by lineOffset lines with the provided max/target value.

Parameters
maxProgressThe maximum the progress bar will reach.
maxProgressNumber of lines to offset the bar by.
Note
Not all interfaces support changing lines.

◆ render()

void OSCR::UI::ProgressBar::render ( bool end = false)
extern

Render an updated progress bar.

Variable Documentation

◆ current

uint32_t OSCR::UI::ProgressBar::current = 0

Current progress.

◆ total

uint32_t OSCR::UI::ProgressBar::total = 0

The total of the progress bar or 0 if not known.