21 #ifndef PLUGINS_USBPRO_ULTRADMXPRODEVICE_H_
22 #define PLUGINS_USBPRO_ULTRADMXPRODEVICE_H_
27 #include "olad/TokenBucket.h"
28 #include "olad/PluginAdaptor.h"
29 #include "olad/Port.h"
31 #include "plugins/usbpro/UltraDMXProWidget.h"
32 #include "plugins/usbpro/UsbSerialDevice.h"
33 #include "plugins/usbpro/messages/UsbProConfigMessages.pb.h"
46 const std::string &name,
51 uint16_t firmware_version,
52 unsigned int fps_limit);
54 std::string DeviceId()
const {
return m_serial; }
56 bool AllowMultiPortPatching()
const {
return true; }
59 const std::string &request,
60 std::string *response,
70 const ola::plugin::usbpro::Request *request,
71 std::string *response,
75 std::string *response,
81 const ola::plugin::usbpro::Request *request,
82 std::string *response,
88 bool m_got_parameters;
104 const std::string &description)
106 m_description(description),
113 std::string Description()
const {
return m_description; }
116 const std::string m_description;
129 const std::string &description,
131 unsigned int max_burst,
135 m_description(description),
137 m_bucket(max_burst, rate, max_burst, *wake_time),
138 m_wake_time(wake_time),
139 m_primary(primary) {}
141 bool WriteDMX(
const DmxBuffer &buffer, uint8_t priority) {
142 if (m_bucket.GetToken(*m_wake_time)) {
143 return m_primary ? m_widget->SendDMX(buffer)
144 : m_widget->SendSecondaryDMX(buffer);
146 OLA_INFO <<
"Port rated limited, dropping frame";
152 std::string Description()
const {
return m_description; }
155 const std::string m_description;
164 #endif // PLUGINS_USBPRO_ULTRADMXPRODEVICE_H_