1
0
Fork 0

copy dimmer data directly to the data vector

This commit is contained in:
Kevin Matz 2023-04-09 20:42:05 -04:00
parent e435e04945
commit 4833b37739
1 changed files with 1 additions and 5 deletions

View File

@ -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);
}