50 lines
823 B
C++
50 lines
823 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 "output/items/Item.h"
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
#include <chrono>
|
|
#include <future>
|
|
|
|
namespace flippR_driver
|
|
{
|
|
namespace output
|
|
{
|
|
namespace items
|
|
{
|
|
|
|
class Sound : public Item, public ISound
|
|
{
|
|
public:
|
|
u_int id;
|
|
|
|
public:
|
|
Sound(std::shared_ptr<OutputPinController> output_gpio_interface, uint8_t address, std::string name, std::chrono::milliseconds deactivation_time, u_int id);
|
|
~Sound() override = default;
|
|
|
|
void play() override;
|
|
|
|
private:
|
|
std::chrono::milliseconds deactivation_time;
|
|
|
|
std::future<void> play_task;
|
|
|
|
private:
|
|
virtual void playTask();
|
|
};
|
|
|
|
}
|
|
} /* namespace output */
|
|
}
|
|
#endif
|