Older/Server/AlarmClockServer.h

28 lines
723 B
C
Raw Normal View History

2023-07-21 16:17:01 +08:00
#ifndef __ALARMCLOCKSERVER_H__
#define __ALARMCLOCKSERVER_H__
#include "ZeroMQSocket.h"
#include <Singleton.h>
#include <boost/asio/steady_timer.hpp>
class AlarmClockServer {
friend class Amass::Singleton<AlarmClockServer>;
public:
void listen(const std::string_view &host, const std::string_view &port);
void setAlarmTime(uint8_t hour, uint8_t minute);
void textToSpeech(const std::string_view &text);
void currentDatatime();
protected:
AlarmClockServer(boost::asio::io_context &context);
void startPublishHeartBeat();
void playRandomMusic();
void stopPlayMusic();
private:
ZeroMQ::Socket m_publisher;
boost::asio::steady_timer m_timer;
};
#endif // __ALARMCLOCKSERVER_H__