Skip to content

Commit

Permalink
feat: delete virtual device when unused
Browse files Browse the repository at this point in the history
  • Loading branch information
Curve committed Oct 18, 2023
1 parent d6a1c74 commit a508381
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.16)
project(venmic LANGUAGES CXX VERSION 2.0)
cmake_minimum_required(VERSION 3.21)
project(venmic LANGUAGES CXX VERSION 1.1)

# --------------------------------------------------------------------------------------------------------
# Library options
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"name": "Curve",
"url": "https://github.com/Curve"
},
"version": "1.0.0",
"version": "1.1.0",
"main": "./lib/index.js",
"types": "./lib/module.d.ts",
"scripts": {
Expand Down
13 changes: 11 additions & 2 deletions src/patchbay.impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,8 @@ namespace vencord
return rtn;
};

core->update();

auto rtn = nodes //
| ranges::views::filter(desireable) //
| ranges::views::filter(can_output) //
Expand All @@ -325,6 +327,11 @@ namespace vencord
// NOLINTNEXTLINE(*-value-param)
void patchbay::impl::receive([[maybe_unused]] cr_recipe::sender, vencord::target req)
{
if (!mic)
{
create_mic();
}

created.clear();
target.emplace(std::move(req));

Expand All @@ -343,8 +350,10 @@ namespace vencord
// NOLINTNEXTLINE(*-value-param)
void patchbay::impl::receive([[maybe_unused]] cr_recipe::sender, [[maybe_unused]] unset_target)
{
target.reset();
created.clear();
target.reset();

mic.reset();
}

template <>
Expand Down Expand Up @@ -377,7 +386,7 @@ namespace vencord
listener.on<pw::registry_event::global_removed>([this](std::uint32_t id) { global_removed(id); });
listener.on<pw::registry_event::global>([this](const auto &global) { global_added(global); });

create_mic();
core->update();

sender.send(ready{});

Expand Down

0 comments on commit a508381

Please sign in to comment.