52 lines
840 B
C++
52 lines
840 B
C++
/*
|
|
* Sound.h
|
|
*
|
|
* Created on: Aug 2, 2018
|
|
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
|
*/
|
|
|
|
#ifndef _SRC_OUTPUT_SOUND_H_
|
|
#define _SRC_OUTPUT_SOUND_H_
|
|
|
|
#include "output/items/ISound.h"
|
|
#include "ISoundItem.h"
|
|
#include "Item.h"
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
#include <chrono>
|
|
#include <future>
|
|
|
|
|
|
namespace flippR_driver
|
|
{
|
|
namespace output
|
|
{
|
|
namespace items
|
|
{
|
|
|
|
class Sound : public ISound, Item, ISoundItem
|
|
{
|
|
public:
|
|
u_int id;
|
|
|
|
public:
|
|
Sound(std::shared_ptr<IOutputGPIOInterface> output_gpio_interface, uint8_t address, std::string name, std::chrono::milliseconds deactivation_time, u_int id);
|
|
virtual ~Sound() = default;
|
|
|
|
virtual void play();
|
|
|
|
private:
|
|
std::chrono::milliseconds deactivation_time;
|
|
|
|
std::future<void> play_task;
|
|
|
|
private:
|
|
virtual void playTask();
|
|
};
|
|
|
|
}
|
|
} /* namespace output */
|
|
}
|
|
#endif
|