JBWOPR
Loading...
Searching...
No Matches
JBWoprEffectBase Class Reference

Abstract effect base class. More...

#include <jbwopreffects.h>

Inheritance diagram for JBWoprEffectBase:
JBWoprDateDisplayEffect JBWoprDateTimeDisplayEffect JBWoprDefconRainbowEffect JBWoprMissileCodeSolveEffect JBWoprScrollTextDisplayEffect JBWoprSongEffect JBWoprTextDisplayEffect JBWoprTimeDisplayEffect

Public Member Functions

 JBWoprEffectBase (JBWoprDevice *woprDevice, uint32_t duration=-1, std::string name=JBWOPR_EFFECT_NAME_BASE)
 Constructor.
 
virtual std::string getName ()
 Get name of effect.
 
virtual void start ()
 Start effect.
 
virtual void stop ()
 Stop effect.
 
virtual void loop ()
 Run loop.
 
bool isRunning () const
 Check if effect is running.
 
uint32_t getDuration () const
 Set duration of effect.
 

Protected Member Functions

void _displayText (const std::string &text, JBTextAlignment alignment=JBTextAlignment::LEFT)
 Display text on raw display.
 

Protected Attributes

JBWoprDevice_woprDevice
 JBWoprDevice instance.
 
std::string _name
 Name of effect.
 
bool _isRunning = false
 True if effect is running.
 
bool _done = true
 True if effect is done, waiting for duration to end.
 
uint32_t _duration = -1
 Duration of effect in milliseconds.
 
uint32_t _startTime = 0
 Start time of effect in milliseconds.
 
uint32_t _nextTick = 0
 Next tick time in milliseconds.
 

Detailed Description

Abstract effect base class.

Constructor & Destructor Documentation

◆ JBWoprEffectBase()

JBWoprEffectBase::JBWoprEffectBase ( JBWoprDevice woprDevice,
uint32_t  duration = -1,
std::string  name = JBWOPR_EFFECT_NAME_BASE 
)
explicit

Constructor.

Parameters
WOPRDeviceinstance
duration(optional) Duration of effect in milliseconds, default is -1 (infinite)
name(optional) Name of effect

Member Function Documentation

◆ _displayText()

void JBWoprEffectBase::_displayText ( const std::string &  text,
JBTextAlignment  alignment = JBTextAlignment::LEFT 
)
protected

Display text on raw display.

This method will display text on the raw display without using the displayShowText() method of the JBWoprDevice class.

Parameters
textText to display
alignment(optional) Text alignment, default is LEFT

◆ getDuration()

uint32_t JBWoprEffectBase::getDuration ( ) const

Set duration of effect.

Parameters
durationDuration of effect in milliseconds

◆ getName()

std::string JBWoprEffectBase::getName ( )
virtual

Get name of effect.

Returns
Name of effect

◆ isRunning()

bool JBWoprEffectBase::isRunning ( ) const

Check if effect is running.

Returns
True if effect is running

◆ loop()

◆ start()


The documentation for this class was generated from the following files: