blink1-lib  1.0.0
blink1_lib::PlayState Struct Reference

#include <PlayState.hpp>

Public Member Functions

 PlayState () noexcept=default
 
 PlayState (const bool _playing, const std::uint8_t _playStart, const std::uint8_t _playEnd, const std::uint8_t _playCount, const std::uint8_t _playPos) noexcept
 
bool operator== (const PlayState &other) const noexcept
 
bool operator!= (const PlayState &other) const noexcept
 

Public Attributes

bool playing {false}
 
std::uint8_t playStart {0}
 
std::uint8_t playEnd {0}
 
std::uint8_t playCount {0}
 
std::uint8_t playPos {0}
 

Friends

std::ostream & operator<< (std::ostream &os, const PlayState &playState)
 

Detailed Description

The state of the blink1 devive playing patterns

Constructor & Destructor Documentation

◆ PlayState() [1/2]

blink1_lib::PlayState::PlayState ( )
defaultnoexcept

Default constructor

Initializes all values to 0

◆ PlayState() [2/2]

blink1_lib::PlayState::PlayState ( const bool  _playing,
const std::uint8_t  _playStart,
const std::uint8_t  _playEnd,
const std::uint8_t  _playCount,
const std::uint8_t  _playPos 
)
noexcept
Parameters
_playingWhether a pattern is currently playing
_playStartThe index in the pattern where the play/loop started
_playEndThe index in the pattern where the play/loop will end
_playCountThe number of repetitions left in the loop
_playPosThe current index in the pattern

Member Function Documentation

◆ operator!=()

bool blink1_lib::PlayState::operator!= ( const PlayState other) const
noexcept

Inequality operator

Parameters
otherObject to compare to
Returns
true if the objects are not equal, false otherwise

◆ operator==()

bool blink1_lib::PlayState::operator== ( const PlayState other) const
noexcept

Equality operator

Parameters
otherObject to compare to
Returns
true if the objects are equal, false otherwise

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const PlayState playState 
)
friend

Output operator

Parameters
osOutput stream
playStatePlayState to output

Member Data Documentation

◆ playCount

std::uint8_t blink1_lib::PlayState::playCount {0}

Number of repetitions left in a loop

◆ playEnd

std::uint8_t blink1_lib::PlayState::playEnd {0}

The index in the pattern where the play/loop will end

◆ playing

bool blink1_lib::PlayState::playing {false}

Whether a pattern is currently playing

◆ playPos

std::uint8_t blink1_lib::PlayState::playPos {0}

The current index in the pattern

◆ playStart

std::uint8_t blink1_lib::PlayState::playStart {0}

The index in the pattern where the play/loop started


The documentation for this struct was generated from the following file: