still the biggest refactor
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "Sound.h"
|
||||
|
||||
#include "output/OutputPinController.h"
|
||||
#include <output/SoundBoardPinController.h>
|
||||
|
||||
namespace flippR_driver
|
||||
{
|
||||
@@ -16,8 +16,8 @@ namespace output
|
||||
namespace items
|
||||
{
|
||||
|
||||
Sound::Sound(std::shared_ptr<OutputPinController> output_gpio_interface, uint8_t address, std::string name, std::chrono::milliseconds deactivation_time, u_int id) :
|
||||
Item(std::move(output_gpio_interface), address, std::move(name)), deactivation_time(deactivation_time), id(id)
|
||||
Sound::Sound(std::shared_ptr<SoundBoardPinController> pin_controller, uint8_t address, std::string name, std::chrono::milliseconds deactivation_time, u_int id) :
|
||||
pin_controller(std::move(pin_controller)), Item(address, std::move(name)), deactivation_time(deactivation_time), id(id)
|
||||
{}
|
||||
|
||||
void Sound::play()
|
||||
@@ -27,11 +27,11 @@ void Sound::play()
|
||||
|
||||
void Sound::playTask()
|
||||
{
|
||||
gpio_interface->activate(this);
|
||||
pin_controller->activate(this);
|
||||
|
||||
std::this_thread::sleep_for(deactivation_time);
|
||||
|
||||
gpio_interface->deactivate(this);
|
||||
pin_controller->deactivate(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user