Add exclusive mode option for WASAPI
This commit is contained in:
@@ -74,6 +74,7 @@ GstEnginePipeline::GstEnginePipeline(QObject *parent)
|
||||
: QObject(parent),
|
||||
id_(sId++),
|
||||
valid_(false),
|
||||
exclusive_mode_(false),
|
||||
volume_enabled_(true),
|
||||
stereo_balancer_enabled_(false),
|
||||
eq_enabled_(false),
|
||||
@@ -221,6 +222,10 @@ void GstEnginePipeline::set_output_device(const QString &output, const QVariant
|
||||
|
||||
}
|
||||
|
||||
void GstEnginePipeline::set_exclusive_mode(const bool exclusive_mode) {
|
||||
exclusive_mode_ = exclusive_mode;
|
||||
}
|
||||
|
||||
void GstEnginePipeline::set_volume_enabled(const bool enabled) {
|
||||
volume_enabled_ = enabled;
|
||||
}
|
||||
@@ -520,6 +525,13 @@ bool GstEnginePipeline::InitAudioBin(QString &error) {
|
||||
|
||||
}
|
||||
|
||||
if (g_object_class_find_property(G_OBJECT_GET_CLASS(audiosink_), "exclusive")) {
|
||||
if (exclusive_mode_) {
|
||||
qLog(Debug) << "Setting exclusive mode for" << output_;
|
||||
}
|
||||
g_object_set(G_OBJECT(audiosink_), "exclusive", exclusive_mode_, nullptr);
|
||||
}
|
||||
|
||||
#ifndef Q_OS_WIN32
|
||||
if (g_object_class_find_property(G_OBJECT_GET_CLASS(audiosink_), "volume")) {
|
||||
qLog(Debug) << output_ << "has volume, enabling volume synchronization.";
|
||||
|
||||
Reference in New Issue
Block a user