still the biggest refactor

This commit is contained in:
Jonas Zeunert
2018-12-14 02:44:53 +01:00
parent 67edde9078
commit 8e12b3f3fa
23 changed files with 137 additions and 147 deletions

View File

@@ -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);
}
}