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
Network
KDE Connect
Commits
dd49d79c
Commit
dd49d79c
authored
Nov 23, 2020
by
Art Pinch
Committed by
Simon Redman
Feb 19, 2021
Browse files
[SystemVolumePlugin][Windows] Send data about default audio device
parent
14dff16f
Changes
1
Hide whitespace changes
Inline
Side-by-side
plugins/systemvolume/systemvolumeplugin-win.cpp
View file @
dd49d79c
...
...
@@ -260,6 +260,13 @@ bool SystemvolumePlugin::sendSinkList()
}
unsigned
int
deviceCount
;
devices
->
GetCount
(
&
deviceCount
);
IMMDevice
*
defaultDevice
=
nullptr
;
deviceEnumerator
->
GetDefaultAudioEndpoint
(
eRender
,
eMultimedia
,
&
defaultDevice
);
LPWSTR
defaultId
=
NULL
;
defaultDevice
->
GetId
(
&
defaultId
);
for
(
unsigned
int
i
=
0
;
i
<
deviceCount
;
i
++
)
{
IMMDevice
*
device
=
nullptr
;
...
...
@@ -310,6 +317,7 @@ bool SystemvolumePlugin::sendSinkList()
sinkObject
.
insert
(
QStringLiteral
(
"muted"
),
(
bool
)
muted
);
sinkObject
.
insert
(
QStringLiteral
(
"volume"
),
(
qint64
)(
volume
*
100
));
sinkObject
.
insert
(
QStringLiteral
(
"maxVolume"
),
(
qint64
)
100
);
sinkObject
.
insert
(
QStringLiteral
(
"enabled"
),
lstrcmpW
(
deviceId
,
defaultId
)
==
0
);
// Register Callback
if
(
!
sinkList
.
contains
(
name
))
{
...
...
@@ -325,6 +333,7 @@ bool SystemvolumePlugin::sendSinkList()
array
.
append
(
sinkObject
);
}
devices
->
Release
();
defaultDevice
->
Release
();
document
.
setArray
(
array
);
...
...
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