This commit is contained in:
Joey Yakimowich-Payne 2026-01-30 08:10:51 -07:00
commit befe57530a
3 changed files with 20 additions and 42 deletions

View file

@ -36,7 +36,7 @@ target_include_directories(warppipe
$<INSTALL_INTERFACE:include> $<INSTALL_INTERFACE:include>
) )
target_compile_features(warppipe PUBLIC cxx_std_17) target_compile_features(warppipe PUBLIC cxx_std_20)
target_link_libraries(warppipe PUBLIC PkgConfig::PIPEWIRE PRIVATE nlohmann_json::nlohmann_json) target_link_libraries(warppipe PUBLIC PkgConfig::PIPEWIRE PRIVATE nlohmann_json::nlohmann_json)
if(WARPPIPE_BUILD_EXAMPLES) if(WARPPIPE_BUILD_EXAMPLES)

View file

@ -361,23 +361,13 @@ void WarpGraphModel::refreshFromClient() {
} }
if (m_ghostNodes.erase(qtId)) { if (m_ghostNodes.erase(qtId)) {
std::vector<QtNodes::ConnectionId> gcToRemove; std::erase_if(m_ghostConnections, [&](const auto &gc) {
for (auto gcIt = m_ghostConnections.begin(); if (gc.outNodeId != qtId && gc.inNodeId != qtId)
gcIt != m_ghostConnections.end();) { return false;
if (gcIt->outNodeId == qtId || gcIt->inNodeId == qtId) { m_connections.erase(gc);
gcToRemove.push_back(*gcIt); Q_EMIT connectionDeleted(gc);
gcIt = m_ghostConnections.erase(gcIt); return true;
} else { });
++gcIt;
}
}
for (const auto &gc : gcToRemove) {
auto cIt = m_connections.find(gc);
if (cIt != m_connections.end()) {
m_connections.erase(cIt);
Q_EMIT connectionDeleted(gc);
}
}
Q_EMIT nodeUpdated(qtId); Q_EMIT nodeUpdated(qtId);
} }
continue; continue;
@ -396,25 +386,13 @@ void WarpGraphModel::refreshFromClient() {
if (ghostMatch != 0) { if (ghostMatch != 0) {
m_ghostNodes.erase(ghostMatch); m_ghostNodes.erase(ghostMatch);
{ std::erase_if(m_ghostConnections, [&](const auto &gc) {
std::vector<QtNodes::ConnectionId> gcToRemove; if (gc.outNodeId != ghostMatch && gc.inNodeId != ghostMatch)
for (auto gcIt = m_ghostConnections.begin(); return false;
gcIt != m_ghostConnections.end();) { m_connections.erase(gc);
if (gcIt->outNodeId == ghostMatch || gcIt->inNodeId == ghostMatch) { Q_EMIT connectionDeleted(gc);
gcToRemove.push_back(*gcIt); return true;
gcIt = m_ghostConnections.erase(gcIt); });
} else {
++gcIt;
}
}
for (const auto &gc : gcToRemove) {
auto cIt = m_connections.find(gc);
if (cIt != m_connections.end()) {
m_connections.erase(cIt);
Q_EMIT connectionDeleted(gc);
}
}
}
m_pwToQt.emplace(nodeInfo.id.value, ghostMatch); m_pwToQt.emplace(nodeInfo.id.value, ghostMatch);
auto &data = m_nodes[ghostMatch]; auto &data = m_nodes[ghostMatch];
data.info = nodeInfo; data.info = nodeInfo;

View file

@ -158,7 +158,7 @@ void LinkProxyError(void* data, int, int res, const char* message) {
} }
static const pw_proxy_events kLinkProxyEvents = { static const pw_proxy_events kLinkProxyEvents = {
PW_VERSION_PROXY_EVENTS, .version = PW_VERSION_PROXY_EVENTS,
.bound = LinkProxyBound, .bound = LinkProxyBound,
.removed = LinkProxyRemoved, .removed = LinkProxyRemoved,
.error = LinkProxyError, .error = LinkProxyError,
@ -234,7 +234,7 @@ void StreamStateChanged(void* data,
} }
static const pw_stream_events kStreamEvents = { static const pw_stream_events kStreamEvents = {
PW_VERSION_STREAM_EVENTS, .version = PW_VERSION_STREAM_EVENTS,
.state_changed = StreamStateChanged, .state_changed = StreamStateChanged,
.process = StreamProcess, .process = StreamProcess,
}; };
@ -390,7 +390,7 @@ void Client::Impl::RegistryGlobal(void* data,
PW_VERSION_METADATA, 0)); PW_VERSION_METADATA, 0));
if (impl->metadata_proxy) { if (impl->metadata_proxy) {
static const pw_metadata_events metadata_events = { static const pw_metadata_events metadata_events = {
PW_VERSION_METADATA_EVENTS, .version = PW_VERSION_METADATA_EVENTS,
.property = MetadataProperty, .property = MetadataProperty,
}; };
pw_metadata_add_listener( pw_metadata_add_listener(
@ -700,7 +700,7 @@ Status Client::Impl::ConnectLocked() {
} }
static const pw_core_events core_events = { static const pw_core_events core_events = {
PW_VERSION_CORE_EVENTS, .version = PW_VERSION_CORE_EVENTS,
.done = CoreDone, .done = CoreDone,
.error = CoreError, .error = CoreError,
}; };
@ -713,7 +713,7 @@ Status Client::Impl::ConnectLocked() {
} }
static const pw_registry_events registry_events = { static const pw_registry_events registry_events = {
PW_VERSION_REGISTRY_EVENTS, .version = PW_VERSION_REGISTRY_EVENTS,
.global = RegistryGlobal, .global = RegistryGlobal,
.global_remove = RegistryGlobalRemove, .global_remove = RegistryGlobalRemove,
}; };