Open linchangyi opened 4 years ago
Left click to switch speaker, right click to show detailed options.
I would like this too. Having to switch audio devices (external DAC -> internal soundcard for full duplex) every time I have a conference call, it would be nice for this to be more streamlined.
Plasma correctly detects I'm not using my HDMI output now so it's not trivial to test switching devices anymore. I've added RadioButton's to switch on click. Here's a mockup of what a speaker/mic will look like. Apps won't show the radio button (it's a mockup).
If someone could test this, It'd be helpful.
~/.local/share/plasma/plasmoids/org.kde.plasma.volumewin7mixer/
plasmawindowed org.kde.plasma.volumewin7mixer
Sure thing. I'll be able to do it tomorrow when I get back to my PC.
It works my dude.
Some things to note though:
Are there any log files I should share with you?
it only switches to the new device if I click on the little indicator bubble.
This is deliberate. I don't want to hide the contextmenu as most people will not know to right click the menu.
I will be adding a tooltip to the radiobutton mentioning "make default device" or "is default device".
the tray automatically closes after selecting the new audio device
Yeah I noticed that too. Weird. I will try to prevent that.
This is deliberate. I don't want to hide the contextmenu as most people will not know to right click the menu.
If it's not too much effort, what would I have to change on my end to allow for left-clicking -> change device and right-clicking -> context menu?
I will be adding a tooltip to the radiobutton mentioning "make default device" or "is default device".
Is there any way to disable tooltips?
Oh, I just realized makeDefaultDevice()
calls the following code. It means I added a config option ages ago to toggle closing the popup when setting a default device. It's useful when using keyboard shortcuts. Eg: Meta+V
, LeftArrow
, Enter
. Anyways, just toggle the option in the config.
if (plasmoid.configuration.closeOnSetDefault) {
main.closeDialog(false)
}
As for modifying the code, change onClicked: contextMenu.showBelow(iconLabelButton)
to onClicked: mixerItem.makeDeviceDefault()
IconLabelButton {
id: iconLabelButton
...
onClicked: mixerItem.makeDeviceDefault()
PlasmaComponents.RadioButton {
...
Awesome! I made both changes and everything's working great.
It works great. But in my opinion, clicking on the speaker icon would be much more intuitive than clicking the radio button, so I made some changes, would be my pleasure to have your pull request.
Now, in order to switch to another speaker, we have to click the speaker icon then set it to default, which need two clicks. I think it is too complicated for such a high frequency demand. It will be much more convinient to switch to a speaker by just clicking the speaker icon.