30 lines
1 KiB
C++
30 lines
1 KiB
C++
#ifndef PLAYER_H
|
|
#define PLAYER_H
|
|
#include "gpio.h"
|
|
#include "gsmdata.h"
|
|
#include "fifo.h"
|
|
static constexpr int GSMLEN = 160;
|
|
static constexpr int FIFOLEN = 8;
|
|
/* Algoritmus vyslovení čísla v češtině. Sémantika není dokonalá, ale dá tomu rozumět.
|
|
* */
|
|
class TextPlayer {
|
|
GpioClass & led;
|
|
const SayedTexts & m_t;
|
|
FIFO<uint32_t, FIFOLEN> & fifo;
|
|
public:
|
|
explicit TextPlayer(FIFO<uint32_t, FIFOLEN> & f, GpioClass & io) noexcept :
|
|
led (io), m_t(sayed_texts), fifo(f) {}
|
|
void say (const int number); // celé číslo
|
|
void say (const int number, const int dnum); // celé číslo jako desetinné s dnum míst (1 .. 3)
|
|
void say (const text_p & o) { out (o); } // přetížení pro uživatelská slova
|
|
protected:
|
|
void sre (const int number);
|
|
void hec (const int number);
|
|
void dek (const int number);
|
|
void one (const int number);
|
|
void mil (const int number, const int dnum);
|
|
|
|
void out (const text_p & o);
|
|
};
|
|
|
|
#endif // PLAYER_H
|