44 lines
936 B
C++
44 lines
936 B
C++
//
|
|
// Created by rhetenor on 14.12.18.
|
|
//
|
|
|
|
#ifndef FLIPPR_DRIVER_OUTPUT_IMPL_SOUNDBOARDPINCONTROLLER_H
|
|
#define FLIPPR_DRIVER_OUTPUT_IMPL_SOUNDBOARDPINCONTROLLER_H
|
|
|
|
#include "output/SoundBoardPinController.h"
|
|
|
|
#include <map>
|
|
|
|
namespace flippR_driver
|
|
{
|
|
namespace output
|
|
{
|
|
namespace detail
|
|
{
|
|
|
|
class SoundBoardPinController : public output::SoundBoardPinController
|
|
{
|
|
public:
|
|
SoundBoardPinController(std::shared_ptr<std::mutex> output_item_mutex, const uint8_t & fire_address);
|
|
~SoundBoardPinController() override = default;
|
|
|
|
void activate(const items::detail::Sound &sound);
|
|
void deactivate(const items::detail::Sound &sound);
|
|
|
|
private:
|
|
void write_sound_address(const uint8_t & address) const;
|
|
void fire_sound() const;
|
|
|
|
void write_pin(const uint8_t & pin, const bool & value) const;
|
|
|
|
private:
|
|
std::shared_ptr<std::mutex> output_item_mutex;
|
|
|
|
uint8_t fire_address;
|
|
};
|
|
|
|
}
|
|
}
|
|
}
|
|
#endif //FLIPPR_DRIVER_SOUNDBOARDPINCONTROLLER_H
|