Commit ee75fcec authored by Nicolas Fella's avatar Nicolas Fella
Browse files

[server] Add API to check whether PipeWire is used

parent c1a32bd2
Pipeline #95867 passed with stage
in 33 seconds
......@@ -82,6 +82,13 @@ void ServerPrivate::update(const pa_server_info *info)
m_defaultSinkName = QString::fromUtf8(info->default_sink_name);
m_defaultSourceName = QString::fromUtf8(info->default_source_name);
const bool isPw = QString::fromUtf8(info->server_name).contains("PipeWire");
if (isPw != m_isPipeWire) {
m_isPipeWire = isPw;
Q_EMIT q->isPipeWireChanged();
}
q->updateDefaultDevices();
}
......@@ -121,4 +128,10 @@ void Server::updateDefaultDevices()
}
}
bool Server::isPipeWire() const
{
return d->m_isPipeWire;
}
} // PulseAudioQt
......@@ -29,9 +29,15 @@ public:
Source *defaultSource() const;
void setDefaultSource(Source *source);
/**
* Whether PulseAudio is provided via pipewire-pulse.
*/
bool isPipeWire() const;
Q_SIGNALS:
void defaultSinkChanged(PulseAudioQt::Sink *sink);
void defaultSourceChanged(PulseAudioQt::Source *source);
void isPipeWireChanged();
private:
explicit Server(Context *context);
......
......@@ -21,6 +21,7 @@ public:
QString m_defaultSourceName;
Sink *m_defaultSink;
Source *m_defaultSource;
bool m_isPipeWire = false;
void update(const pa_server_info *info);
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment