Add microphone indicator
ClosedPublic

Authored by broulik on Mar 23 2019, 1:09 PM.

Details

Summary

Shows a System Tray icon when the microphone is being used.
It also indicates the default microphone volume as well as middle click to mute and wheel for adjusting the volume.
The microphone icon only shows muted when *all* microphones are muted.

Test Plan



Tried both alsa and pulseaudio apps, everything I tried ended up spawning an indicator.
Didn't manage to read raw from /dev/snd/...

Diff Detail

Repository
R115 Plasma Audio Volume Applet
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Mar 23 2019, 1:09 PM
Restricted Application added a project: Plasma. · View Herald TranscriptMar 23 2019, 1:09 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik requested review of this revision.Mar 23 2019, 1:09 PM
apol added a subscriber: apol.Mar 23 2019, 6:15 PM

What happens if 2 applications are using it? Maybe it would make sense to include the application icon as an overlay?

apol added a comment.Mar 23 2019, 6:15 PM

BTW, +1 really cool :)

What happens if 2 applications are using it?

It shows "foo, bar are using the microphone"

Maybe it would make sense to include the application icon as an overlay?

For the tooltip, maybe.

Looks good.

Personally I would work directly with the SourceOutputMap (and maybe duplicate it as list here in MicrophoneIndicator) instead of working with the models. I'm not saying that it's wrong / you should change it though, just a note.

src/qml/microphoneindicator.cpp
43

Just ignore virtual streams? We only care about real devices here.

199

newline

203

qAsConst(m_mutedIndices)

254

newline

275

Yes, this should never be empty.

src/qml/plugin.cpp
67

Any reason why you used singleton?

filipf added a subscriber: filipf.Mar 27 2019, 6:55 PM

Yeah you want to ignore virtual devices or I guess this audio effects for eaxmple app would trigger the indicator?

broulik added inline comments.Apr 1 2019, 12:47 PM
src/qml/plugin.cpp
67

So that we don't end up with multiple Status Notifier Items. This makes the indicator shared between all applets

broulik updated this revision to Diff 57158.Mon, Apr 29, 7:57 AM
  • Address comments
  • Ignore virtual streams
ngraham accepted this revision.Mon, Apr 29, 5:08 PM
This revision is now accepted and ready to land.Mon, Apr 29, 5:08 PM
drosca accepted this revision.Mon, Apr 29, 5:11 PM
This revision was automatically updated to reflect the committed changes.