-
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
63ce587
3f0f0d1
f6b9237
92440cf
e3d6f90
57d5537
c4aac9b
a6bfee9
8cd51f9
089c88f
7325642
6885c29
fbfc51b
ea746c3
a2a9eed
77a6c62
1f0a3c8
287536d
21306b7
6bf91e8
13fdf9e
86ebf6e
86cb8bb
1d427f9
91f7074
3da844f
848fa40
62bb72d
1cb5f06
2dd2dee
709fa32
dbb30bc
afbf13e
bdb2a2e
69af698
a47ab40
650e254
384e94a
71503d2
44f38e9
7f49733
6cd0410
333881e
b82e1e8
5b6ab53
966d2d2
e3b5ad7
c1b097d
4316146
ef3a4fe
503d744
5bdf3a7
9c46f51
776b4df
27dee56
dae23d6
6bc0fd2
156e8ee
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,100 @@ | |
| </option> | ||
| </group> | ||
| <group> | ||
| <_short>Wireplumber mixer</_short> | ||
| <option name="wp_popup_on_change" type="bool"> | ||
| <_short>Pop up on change</_short> | ||
| <_long> | ||
| Wether 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> | ||
| </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.
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_face_choice" type="string"> | ||
| <_short>Quick action target</_short> | ||
| <_long> | ||
| Which audio control will be the target of the "Quick action" (choice for the click action) | ||
| </_long> | ||
| <default>last_change</default> | ||
| <desc> | ||
| <value>last_change</value> | ||
| <_name>Last changed volume</_name> | ||
| </desc> | ||
| <desc> | ||
| <value>default_sink</value> | ||
| <_name>Default sink</_name> | ||
| </desc> | ||
| <desc> | ||
| <value>default_source</value> | ||
| <_name>Default source</_name> | ||
| </desc> | ||
| </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_face</value> | ||
| <_name>Show quick action target</_name> | ||
| </desc> | ||
| </option> | ||
| <option name="wp_middle_click_action" type="string"> | ||
| <_short>Middle click action</_short> | ||
| <default>mute_face</default> | ||
| <desc> | ||
| <value>show_mixer</value> | ||
| <_name>Show full mixer</_name> | ||
| </desc> | ||
| <desc> | ||
| <value>show_face</value> | ||
| <_name>Show quick action target</_name> | ||
| </desc> | ||
| <desc> | ||
| <value>mute_face</value> | ||
| <_name>Mute quick action target</_name> | ||
| </desc> | ||
| </option> | ||
| <option name="wp_right_click_action" type="string"> | ||
| <_short>Right click action</_short> | ||
| <default>show_face</default> | ||
| <desc> | ||
| <value>show_mixer</value> | ||
| <_name>Show full mixer</_name> | ||
| </desc> | ||
| <desc> | ||
| <value>show_face</value> | ||
| <_name>Show quick action target</_name> | ||
| </desc> | ||
| <desc> | ||
| <value>mute_face</value> | ||
| <_name>Mute quick action target</_name> | ||
| </desc> | ||
| </option> | ||
| <option name="wp_icon_size" type="int"> | ||
| <_short>Volume 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, "audio-volume-muted"}, | ||
| }; | ||
|
|
||
| // 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