Mic check

This commit is contained in:
Wizzard 2023-07-11 22:00:24 -04:00
parent 17517d1b46
commit 33a0f68cf1
1 changed files with 7 additions and 1 deletions

View File

@ -6,7 +6,7 @@
namespace Virtmic { namespace Virtmic {
const QStringList EXCLUDE_TARGETS{"Chromium input", "discord-awesomeaudio"}; const QStringList EXCLUDE_TARGETS{"Chromium input", "discord-awesomeaudio", "pavucontrol"};
const std::string nullstr = ""; const std::string nullstr = "";
const std::string &getTarget(const pipewire::spa::dict &props) { const std::string &getTarget(const pipewire::spa::dict &props) {
@ -86,6 +86,12 @@ void start(QString _target) {
auto &parent = nodes.at(parent_id); auto &parent = nodes.at(parent_id);
std::string name = getTarget(parent.props); std::string name = getTarget(parent.props);
if (EXCLUDE_TARGETS.contains(QString::fromStdString(name)))
continue;
if (parent.props.count("media.class") && (parent.props.at("media.class") == "Audio/Source" || parent.props.at("media.class") == "Audio/Source/Virtual"))
continue;
if (name == target || if (name == target ||
(target == "[All Desktop Audio]" && (target == "[All Desktop Audio]" &&
!EXCLUDE_TARGETS.contains(QString::fromStdString(name)))) { !EXCLUDE_TARGETS.contains(QString::fromStdString(name)))) {