renamed impl to detail
This commit is contained in:
43
FlippR-Driver/src/output/items/detail/Sound.cpp
Normal file
43
FlippR-Driver/src/output/items/detail/Sound.cpp
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Sound.cpp
|
||||
*
|
||||
* Created on: Aug 2, 2018
|
||||
* Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert
|
||||
*/
|
||||
|
||||
#include "Sound.h"
|
||||
|
||||
#include <output/SoundBoardPinController.h>
|
||||
|
||||
namespace flippR_driver
|
||||
{
|
||||
namespace output
|
||||
{
|
||||
namespace items
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
|
||||
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()
|
||||
{
|
||||
this->play_task = std::async(std::launch::async, &Sound::playTask, this);
|
||||
}
|
||||
|
||||
void Sound::playTask()
|
||||
{
|
||||
pin_controller->activate(*this);
|
||||
|
||||
std::this_thread::sleep_for(deactivation_time);
|
||||
|
||||
pin_controller->deactivate(*this);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
} /* namespace output */
|
||||
}
|
||||
Reference in New Issue
Block a user