JBWOPR
JBWoprNokiaTuneEffect Class Reference

Nokia tune effect. More...

#include <jbwoprnokiatune.h>

Inheritance diagram for JBWoprNokiaTuneEffect:
JBWoprSongEffect JBWoprEffectBase

Public Member Functions

 JBWoprNokiaTuneEffect (JBWoprDevice *woprBoard, uint32_t tempo=180, uint32_t duration=-1, const std::string name=JBWOPR_EFFECT_NAME_NOKIA_TUNE)
 JBWoprNokiaTuneEffect constructor.
Public Member Functions inherited from JBWoprSongEffect
 JBWoprSongEffect (JBWoprDevice *woprBoard, const std::vector< Note > *song, uint32_t tempo=114, uint32_t duration=-1, const std::string &name=JBWOPR_EFFECT_NAME_SONG)
 Constructor.
void start () override
 Start effect.
void loop () override
 Run loop.
virtual void setSong (const std::vector< Note > *song)
 Set melody.
Public Member Functions inherited from JBWoprEffectBase
 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 stop ()
 Stop effect.
bool isRunning () const
 Check if effect is running.
uint32_t getDuration () const
 Set duration of effect.

Protected Member Functions

virtual void setSong (std::vector< JBWoprSongEffect::Note > *song)
virtual void setTempo (uint32_t tempo)
 Set tempo.
Protected Member Functions inherited from JBWoprEffectBase
void _displayText (const std::string &text, JBTextAlignment alignment=JBTextAlignment::LEFT)
 Display text on raw display.

Protected Attributes

const std::vector< JBWoprSongEffect::Note_nokiaTune
 Nokia tune.
Protected Attributes inherited from JBWoprSongEffect
const std::vector< Note > * _song = nullptr
 Melody.
uint32_t _step = 0
 Current step.
uint32_t _tempo = 114
 Tempo.
uint32_t _wholeNote = (60000 * 4) / _tempo
 Whole note duration.
bool _done = false
 True if done.
Protected Attributes inherited from JBWoprEffectBase
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

Nokia tune effect.

This class implements the Nokia tune effect.

Constructor & Destructor Documentation

◆ JBWoprNokiaTuneEffect()

JBWoprNokiaTuneEffect::JBWoprNokiaTuneEffect ( JBWoprDevice * woprBoard,
uint32_t tempo = 180,
uint32_t duration = -1,
const std::string name = JBWOPR_EFFECT_NAME_NOKIA_TUNE )
explicit

JBWoprNokiaTuneEffect constructor.

Parameters
woprBoardPointer to JBWoprDevice
tempoTempo of effect
durationDuration of effect
nameName of effect

Member Function Documentation

◆ setTempo()

virtual void JBWoprNokiaTuneEffect::setTempo ( uint32_t tempo)
inlineprotectedvirtual

Set tempo.

Parameters
tempoTempo

Reimplemented from JBWoprSongEffect.

Member Data Documentation

◆ _nokiaTune

const std::vector<JBWoprSongEffect::Note> JBWoprNokiaTuneEffect::_nokiaTune
protected
Initial value:
{
{ NOTE_E, 5, 8, " R "},
{ NOTE_D, 5, 8, " O R " },
{ NOTE_Fs, 4, 4, " O R E " },
{ NOTE_Gs, 4, 4, " O I R EZ" },
{ NOTE_Cs, 5, 8, " O IA R EZ" },
{ NOTE_B, 4, 8, "NO IA RU EZ" },
{ NOTE_D, 4, 4, "NO IA RULEZ" },
{ NOTE_E, 4, 4, "NOKIA RULEZ" },
{ NOTE_B, 4, 8, "" },
{ NOTE_A, 4, 8, "-" },
{ NOTE_Cs, 4, 4, "NOKIA RULEZ" },
{ NOTE_E, 4, 4, "-" },
{ NOTE_A, 4, 2, "NOKIA RULEZ" },
{ 0, 0, 4, "" }
}

Nokia tune.


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