diff --git a/CMakeLists.txt b/CMakeLists.txt index 7afdc6b..ec61f9f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.21) -project(venmic LANGUAGES CXX VERSION 3.3.4) +project(venmic LANGUAGES CXX VERSION 3.3.5) # -------------------------------------------------------------------------------------------------------- # Library options diff --git a/package.json b/package.json index f552eb2..ddf97b9 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "private": false, "license": "MPL-2.0", "author": "Curve (https://github.com/Curve)", - "version": "3.3.4", + "version": "3.3.5", "main": "./lib/index.js", "types": "./lib/module.d.ts", "scripts": { diff --git a/private/patchbay.impl.hpp b/private/patchbay.impl.hpp index 63de144..69065ee 100644 --- a/private/patchbay.impl.hpp +++ b/private/patchbay.impl.hpp @@ -87,10 +87,13 @@ namespace vencord private: template - void bind(const pw::global &); + void bind(pw::global &); + + public: + void add_global(pw::global &); template - void add_global(T &); + void add_global(T &, pw::global &); private: void rem_global(std::uint32_t); diff --git a/src/patchbay.impl.cpp b/src/patchbay.impl.cpp index 6950b1c..32df6e3 100644 --- a/src/patchbay.impl.cpp +++ b/src/patchbay.impl.cpp @@ -218,7 +218,7 @@ namespace vencord } template <> - void patchbay::impl::add_global(pw::node &node) + void patchbay::impl::add_global(pw::node &node, pw::global &) { auto id = node.id(); auto props = node.info().props; @@ -262,7 +262,7 @@ namespace vencord } template <> - void patchbay::impl::add_global(pw::link &link) + void patchbay::impl::add_global(pw::link &link, pw::global &) { auto id = link.id(); auto info = link.info(); @@ -277,7 +277,7 @@ namespace vencord } template <> - void patchbay::impl::add_global(pw::port &port) + void patchbay::impl::add_global(pw::port &port, pw::global &) { auto props = port.info().props; @@ -300,10 +300,10 @@ namespace vencord } template <> - void patchbay::impl::add_global(pw::metadata &data) + void patchbay::impl::add_global(pw::metadata &data, pw::global &global) { auto props = data.properties(); - const auto name = data.props()["metadata.name"]; + const auto name = global.props["metadata.name"]; logger::get()->trace(R"([patchbay] (add_global) new metadata: {} (name: "{}"))", data.id(), name); @@ -342,7 +342,7 @@ namespace vencord } template - void patchbay::impl::bind(const pw::global &global) + void patchbay::impl::bind(pw::global &global) { auto bound = registry->bind(global.id).get(); @@ -353,11 +353,10 @@ namespace vencord return; } - add_global(bound.value()); + add_global(bound.value(), global); } - template <> - void patchbay::impl::add_global(const pw::global &global) + void patchbay::impl::add_global(pw::global &global) { logger::get()->trace(R"([patchbay] (add_global) new global: {} (type: "{}"))", global.id, global.type); @@ -550,7 +549,7 @@ namespace vencord auto listener = registry->listen(); listener.on([this](std::uint32_t id) { rem_global(id); }); - listener.on([this](const auto &global) { add_global(global); }); + listener.on([this](auto global) { add_global(global); }); sender.send(ready{});