copy dimmer data directly to the data vector
This commit is contained in:
parent
e435e04945
commit
4833b37739
|
@ -582,14 +582,10 @@ void Widget::setParameters() const
|
|||
void Widget::sendDmx(bool trimmed) const
|
||||
{
|
||||
auto msg = std::make_shared<Pro::MsgOutputOnlySendDMX>();
|
||||
msg->data = std::vector<uint8_t>();
|
||||
uint16_t l = null_start_data.size() - 1;
|
||||
if (trimmed)
|
||||
for (l = null_start_data.size() - 1; l > 0 && null_start_data[l] == 0; --l) {};
|
||||
{
|
||||
std::scoped_lock lock(mtx_data);
|
||||
std::copy(null_start_data.begin(), null_start_data.begin() + l + 1, msg->data.begin());
|
||||
}
|
||||
msg->data = std::vector<uint8_t>(null_start_data.begin(), null_start_data.begin() + l + 1);
|
||||
sendMessage(msg);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue