Skip to content

Commit

Permalink
refactor(patchbay)!: remove ignore_input_media
Browse files Browse the repository at this point in the history
* Clients can easily handle this themselves by excluding `"media.class": "Stream/Input/Audio"`
  • Loading branch information
Curve committed May 31, 2024
1 parent bcafa10 commit 5a12732
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 20 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.21)
project(venmic LANGUAGES CXX VERSION 4.0.2)
project(venmic LANGUAGES CXX VERSION 5.0.0)

# --------------------------------------------------------------------------------------------------------
# Library options
Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ The Rest-Server exposes three simple endpoints
The setting `only_default_speakers` is optional and will default to `true`.
When enabled it will prevent linking against nodes that don't play to the default speaker.

The setting `ignore_input_media` is optional and will default to `true`.
When enabled it will prevent linking against nodes have a "Input" media-class.

The setting `workaround` is also optional and will default to an empty array.
When set, venmic will redirect the first node that matches all of the specified properties to itself.
</blockquote>
Expand Down
2 changes: 0 additions & 2 deletions addon/addon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ struct patchbay : public Napi::ObjectWrap<patchbay>
auto include = to_array<vencord::node>(data.Get("include"));
auto exclude = to_array<vencord::node>(data.Get("exclude"));
auto ignore_devices = convert<bool>(data.Get("ignore_devices"));
auto ignore_input_media = convert<bool>(data.Get("ignore_input_media"));
auto only_default_speakers = convert<bool>(data.Get("only_default_speakers"));
auto workaround = to_array<vencord::node>(data.Get("workaround"));

Expand All @@ -188,7 +187,6 @@ struct patchbay : public Napi::ObjectWrap<patchbay>
.include = include.value_or(std::vector<vencord::node>{}),
.exclude = exclude.value_or(std::vector<vencord::node>{}),
.ignore_devices = ignore_devices.value_or(true),
.ignore_input_media = ignore_input_media.value_or(true),
.only_default_speakers = only_default_speakers.value_or(true),
.workaround = workaround.value_or(std::vector<vencord::node>{}),
});
Expand Down
7 changes: 2 additions & 5 deletions include/vencord/patchbay.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@ namespace vencord
std::vector<node> exclude;

public:
bool ignore_devices{true}; // Only link against non-device nodes
bool ignore_input_media{true}; // Ignore Nodes that have "Input" in their media class

public:
bool only_default_speakers{true};
bool ignore_devices{true}; // Only link against non-device nodes
bool only_default_speakers{true}; // Ignore nodes that don't play to the default speaker

public:
std::vector<node> workaround;
Expand Down
1 change: 0 additions & 1 deletion lib/module.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export interface LinkData
exclude: Node[];

ignore_devices?: boolean;
ignore_input_media?: boolean;
only_default_speakers?: boolean;

workaround?: Node[];
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"private": false,
"license": "MPL-2.0",
"author": "Curve (https://github.com/Curve)",
"version": "4.0.2",
"version": "5.0.0",
"main": "./lib/index.js",
"types": "./lib/module.d.ts",
"scripts": {
Expand Down
7 changes: 0 additions & 7 deletions src/patchbay.impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,6 @@ namespace vencord
return;
}

if (options.ignore_input_media && props["media.class"].find("Input") != std::string::npos)
{
logger::get()->warn("[patchbay] (link) prevented link to node with input class: {} (\"{}\")", id,
props["media.class"]);
return;
}

logger::get()->debug("[patchbay] (link) linking {}", id);

auto mapping = map_ports(target);
Expand Down

0 comments on commit 5a12732

Please sign in to comment.