-
Notifications
You must be signed in to change notification settings - Fork 43
Added wireplumber mixer widget #307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
3054bc0
6f771b0
7a0632d
ba6e294
91a805d
94c451a
4ed8808
45d419f
df98546
542f261
0ea7f54
e3485a1
7ee1bcf
2eb434c
28856c7
59c0b7f
2e95eba
c4c28ec
4254377
d86eef3
83a981f
00c74a3
d7feb09
0c30933
a9148fe
4f64fd8
e61e817
843b4f3
caf71b9
4bca93f
347d721
53262d8
99c82c6
be3a793
38dead5
78d9de5
d446ea2
c5a2688
4816e6a
ab84eff
94ff628
325d37b
03ffe93
d0f0902
a55e348
38f61f5
bbc110c
694f548
8c315b5
4be57b9
17f27b9
a3f9290
1b419ae
bcd88ad
05a1754
327b857
0c16c5e
b2d639e
9a0647f
7dc5b19
3e1d3c2
486d8c2
f9cce65
0c77ecc
1effebe
2cc67a8
4c65c66
e5a42ef
ce30441
5fdc1e0
47d1411
7f24845
3df09bf
8641e12
cdf4784
a7f8e85
74c6f18
f303b15
7a7456f
b6d3c1e
bd5d07e
d5faee2
97aff7b
93e0ead
e1777f4
51e5f2d
a4a8a60
e1b07d9
9ca37e8
4df51c6
309f447
69c63bc
3bda692
7578cdc
fce7dee
8c9a9c5
86ec9cc
2dd752d
8559059
0670b5d
2f505f9
27b203f
ee84b1a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -249,6 +249,105 @@ | |
| </option> | ||
| </group> | ||
| <group> | ||
| <_short>Audio mixer (wireplumber)</_short> | ||
| <option name="wp_quick_target_choice" type="string"> | ||
| <_short>Quick action target</_short> | ||
| <_long>Which audio control will be the target of the quick actions (scrolling and muting on the widget)</_long> | ||
| <default>default_sink</default> | ||
| <desc> | ||
| <value>default_sink</value> | ||
| <_name>Default sink</_name> | ||
| </desc> | ||
| <desc> | ||
| <value>default_source</value> | ||
| <_name>Default source</_name> | ||
| </desc> | ||
| <desc> | ||
| <value>last_change</value> | ||
| <_name>Last changed volume</_name> | ||
| </desc> | ||
| </option> | ||
| <option name="wp_popup_on_change" type="bool"> | ||
| <_short>Pop up on change</_short> | ||
| <_long>Whether to show a popup with the new values upon a change to the quick action target</_long> | ||
| <default>true</default> | ||
| </option> | ||
| <option name="wp_display_timeout" type="double"> | ||
| <_short>Display timeout</_short> | ||
| <default>2.5</default> | ||
| <min>0</min> | ||
| </option> | ||
| <option name="wp_slider_length" type="int"> | ||
| <_short>Slider length</_short> | ||
| <default>300</default> | ||
| <min>1</min> | ||
| </option> | ||
| <option name="wp_scroll_sensitivity" type="double"> | ||
| <_short>Scroll sensitivity</_short> | ||
| <default>1</default> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could set a value for this (0?) Otherwise, we could allow negative values but then we can remove the invert option.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I’m sorry, i’m not quite sure what you mean ?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
You can set minimum and maximum values for integer options. |
||
| <min>0</min> | ||
| </option> | ||
| <option name="wp_invert_scroll" type="bool"> | ||
| <_short>Invert scroll</_short> | ||
| <_long>Inverts which scroll direction raises and lowers volume</_long> | ||
| <default>false</default> | ||
| </option> | ||
| <option name="wp_icons_on_left" type="bool"> | ||
| <_short>Icons on left</_short> | ||
| <_long>Displays the mute and set default icon on the left</_long> | ||
| <default>false</default> | ||
| </option> | ||
| <option name="wp_left_click_action" type="string"> | ||
| <_short>Left click action</_short> | ||
| <default>show_mixer</default> | ||
| <desc> | ||
| <value>show_mixer</value> | ||
| <_name>Show full mixer</_name> | ||
| </desc> | ||
| <desc> | ||
| <value>show_quick_target</value> | ||
| <_name>Show quick action target</_name> | ||
| </desc> | ||
| </option> | ||
| <option name="wp_middle_click_action" type="string"> | ||
| <_short>Middle click action</_short> | ||
| <default>mute_quick_target</default> | ||
| <desc> | ||
| <value>show_mixer</value> | ||
| <_name>Show full mixer</_name> | ||
| </desc> | ||
| <desc> | ||
| <value>show_quick_target</value> | ||
| <_name>Show quick action target</_name> | ||
| </desc> | ||
| <desc> | ||
| <value>mute_quick_target</value> | ||
| <_name>Mute quick action target</_name> | ||
| </desc> | ||
| </option> | ||
| <option name="wp_right_click_action" type="string"> | ||
| <_short>Right click action</_short> | ||
| <default>show_quick_target</default> | ||
| <desc> | ||
| <value>show_mixer</value> | ||
| <_name>Show full mixer</_name> | ||
| </desc> | ||
| <desc> | ||
| <value>show_quick_target</value> | ||
| <_name>Show quick action target</_name> | ||
| </desc> | ||
| <desc> | ||
| <value>mute_quick_target</value> | ||
| <_name>Mute quick action target</_name> | ||
| </desc> | ||
| </option> | ||
| <option name="wp_icon_size" type="int"> | ||
| <_short>Icon size</_short> | ||
| <default>32</default> | ||
| <min>1</min> | ||
| </option> | ||
| </group> | ||
| <group> | ||
| <_short>Notifications</_short> | ||
| <option name="notifications_autohide_timeout" type="double"> | ||
| <_short>Notifications Display Timeout</_short> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| #include <map> | ||
|
|
||
| #include "volume-level.hpp" | ||
|
|
||
| enum VolumeLevel | ||
| { | ||
| VOLUME_LEVEL_MUTE = 0, | ||
| VOLUME_LEVEL_LOW, | ||
| VOLUME_LEVEL_MED, | ||
| VOLUME_LEVEL_HIGH, | ||
| VOLUME_LEVEL_OOR, /* Out of range */ | ||
| }; | ||
|
|
||
| const std::map<VolumeLevel, std::string> volume_icons = { | ||
| {VOLUME_LEVEL_MUTE, "audio-volume-muted"}, | ||
| {VOLUME_LEVEL_LOW, "audio-volume-low"}, | ||
| {VOLUME_LEVEL_MED, "audio-volume-medium"}, | ||
| {VOLUME_LEVEL_HIGH, "audio-volume-high"}, | ||
| {VOLUME_LEVEL_OOR, "emblem-unreadable"}, | ||
| }; | ||
|
|
||
| // volume is expected to be from 0 to 1 | ||
| std::string volume_icon_for(double volume) | ||
| { | ||
| double max = 1.0; | ||
| auto third = max / 3; | ||
| if (volume == 0) | ||
| { | ||
| return volume_icons.at(VOLUME_LEVEL_MUTE); | ||
| } else if ((volume > 0) && (volume <= third)) | ||
| { | ||
| return volume_icons.at(VOLUME_LEVEL_LOW); | ||
| } else if ((volume > third) && (volume <= (third * 2))) | ||
| { | ||
| return volume_icons.at(VOLUME_LEVEL_MED); | ||
| } else if ((volume > (third * 2)) && (volume <= max)) | ||
| { | ||
| return volume_icons.at(VOLUME_LEVEL_HIGH); | ||
| } | ||
|
|
||
| return volume_icons.at(VOLUME_LEVEL_OOR); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| #pragma once | ||
|
|
||
| #include <string> | ||
|
|
||
| // helper in common for volume and wireplumber widgets icons handling | ||
| std::string volume_icon_for(double volume); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use spaces here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now, apologies if i am somehow getting this wrong, but it seems other indentation in this file uses tabs ? such as the above libpulse check