Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Libraries
PulseAudio-Qt
Commits
ee75fcec
Commit
ee75fcec
authored
Nov 07, 2021
by
Nicolas Fella
Browse files
[server] Add API to check whether PipeWire is used
parent
c1a32bd2
Pipeline
#95867
passed with stage
in 33 seconds
Changes
3
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
src/server.cpp
View file @
ee75fcec
...
...
@@ -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
src/server.h
View file @
ee75fcec
...
...
@@ -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
);
...
...
src/server_p.h
View file @
ee75fcec
...
...
@@ -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
);
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment