Skip to content

Commit

Permalink
Metadata changed state fixes inline with EBU PR ebu#111
Browse files Browse the repository at this point in the history
  • Loading branch information
firthm01 committed Sep 14, 2021
1 parent e5dfd82 commit a4379eb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,14 @@ void HoaMetadataSender::sendMetadata() {
return;
}
auto msg = getMessage();
data_.set_changed(false);
socket_.asyncSend(
msg, [this](std::error_code ec, const nng::Message& ignored) {
if (!ec) {
std::lock_guard<std::mutex> lock(timeoutMutex_);
lastSendTimestamp_ = std::chrono::system_clock::now();
} else {
data_.set_changed(true);
EAR_LOGGER_WARN(logger_, "Metadata sending failed: {}", ec.message());
}
});
Expand Down Expand Up @@ -139,7 +141,7 @@ void HoaMetadataSender::speakerSetupIndex(int value) {
data_.set_allocated_ds_metadata(
proto::convertSpeakerSetupToEpsMetadata(value));
}*/


} // namespace communication
} // namespace plugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,11 @@ void JuceSceneFrontendConnector::reloadItemListCache() {
});
if (it == container->hoaItems.end()) {
auto view = std::make_shared<ItemView>();
view->setData({item, false});
view->setMetadata(item);
container->hoaItems.push_back(view);
container->hoaList->addItem(view.get());
} else {
(*it)->setData({item, false});
(*it)->setMetadata(item);
}
}
}
Expand Down Expand Up @@ -338,10 +338,11 @@ void JuceSceneFrontendConnector::updateItemView(communication::ConnectionId id,
} else if (item.has_hoa_metadata()) {
auto it = std::find_if(container->hoaItems.begin(), container->hoaItems.end(),
[id](auto entry) { return id == entry->getId(); });
if (it != container->hoaItems.end()){(*it)->setData({item,false});
if (it != container->hoaItems.end()){
(*it)->setMetadata(item);
} else {
auto view = std::make_shared<ItemView>();
view->setData({item, false});
view->setMetadata(item);
container->hoaItems.push_back(view);
container->hoaList->addItem(view.get());
}
Expand Down

0 comments on commit a4379eb

Please sign in to comment.