working on big refactor
This commit is contained in:
45
FlippR-Driver/src/output/impl/SoundBoardPinController.h
Normal file
45
FlippR-Driver/src/output/impl/SoundBoardPinController.h
Normal file
@@ -0,0 +1,45 @@
|
||||
//
|
||||
// Created by rhetenor on 14.12.18.
|
||||
//
|
||||
|
||||
#ifndef FLIPPR_DRIVER_SOUNDBOARDPINCONTROLLER_H
|
||||
#define FLIPPR_DRIVER_SOUNDBOARDPINCONTROLLER_H
|
||||
|
||||
#include <map>
|
||||
#include "output/SoundBoardPinController.h"
|
||||
|
||||
#include "PinController.h"
|
||||
|
||||
namespace flippR_driver
|
||||
{
|
||||
namespace output
|
||||
{
|
||||
namespace impl
|
||||
{
|
||||
|
||||
class SoundBoardPinController : public PinController, public output::SoundBoardPinController
|
||||
{
|
||||
public:
|
||||
SoundBoardPinController();
|
||||
~SoundBoardPinController() override = default;
|
||||
|
||||
void activate(const items::Sound &sound) override;
|
||||
void deactivate(const items::Sound &sound) override;
|
||||
|
||||
private:
|
||||
void write_sound_address(uint8_t address);
|
||||
void fire_sound(bool fire);
|
||||
|
||||
void write_pin(uint8_t pin, bool value);
|
||||
|
||||
private:
|
||||
std::shared_ptr<std::mutex> output_item_mutex;
|
||||
|
||||
const std::map<std::string, uint8_t> pins_sound;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif //FLIPPR_DRIVER_SOUNDBOARDPINCONTROLLER_H
|
||||
Reference in New Issue
Block a user