44 lines
782 B
C++
44 lines
782 B
C++
/*
|
|
* Sound.h
|
|
*
|
|
* Created on: Aug 2, 2018
|
|
* Author: rhetenor
|
|
*/
|
|
|
|
#ifndef _SRC_OUTPUT_SOUND_H_
|
|
#define _SRC_OUTPUT_SOUND_H_
|
|
|
|
#include "../../../include/output/output_items/ISound.h"
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
|
|
#include "utility/IOutputGPIOInterface.h"
|
|
|
|
namespace flippR_driver
|
|
{
|
|
namespace output
|
|
{
|
|
namespace items
|
|
{
|
|
|
|
class Sound : public ISound, OutputItem
|
|
{
|
|
public:
|
|
Sound(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, unsigned int address, unsigned int i2c_address, unsigned int data_pin, std::string name, std::chrono::milliseconds deactivation_time);
|
|
virtual ~Sound() = default;
|
|
|
|
virtual void play();
|
|
|
|
private:
|
|
std::chrono::milliseconds deactivation_time;
|
|
|
|
private:
|
|
virtual void playTask();
|
|
};
|
|
|
|
}
|
|
} /* namespace output */
|
|
}
|
|
#endif
|