Keeping nr_failed as member allows to split-out calculation of overall
failed units into updateData.
Signed-off-by: Steffen Kothe <steffen.kothe@skothe.net>
- The module only fetches nodes for "node-type". This causes the 'onMixerChanged' log to spam whenever two or more
wireplumber modules were registered on different nodes. To reduce this the unknown node warning will now only print
if the node is not the focus of any current module.
- Adds microphone support etc to the wireplumber module.
The existing module hardcodes the selected node type to "Audio/Sink". This feature allows the user to override this
via `"node-type": "Audio/Source"`.
- Unlike the pulseaudio module, this change does not try to see the module manage both input and output. The same effect
can be achieved by running two instances of the wireplumber module.
This approach:
- Works around some of the complexity overhead that seem to have caused similar PRs to stall.
- Using separate module instances also allows both the microphone and speaker levels to be controlled with a scroll
wheel. This is something a unified module like pulseaudio struggles with.
- Similarly, separate instances allows the source volume level to be exposed as the state. Ie- the linear-gradient
css patterns can be applied to both input and output.
Historically we listened to /sys/class/poewr_supply inotify events,
which does not seem to work anymore.
We switched now to udev netlink kernel events.
Not adding the constructor causes a compilation error on Ubuntu 22.04
with both clang 14 and gcc 11:
/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/alloc_traits.h:518:4: error: no matching function for call to 'construct_at'
std::construct_at(__p, std::forward<_Args>(__args)...);
^~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/vector.tcc:117:21: note: in instantiation of function template specialization 'std::allocator_traits<std::allocator<waybar::modules::Profile>>::construct<waybar::modules::Profile, Glib::ustring, Glib::ustring>' requested here
_Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish,
^
../src/modules/power_profiles_daemon.cpp:106:26: note: in instantiation of function template specialization 'std::vector<waybar::modules::Profile>::emplace_back<Glib::ustring, Glib::ustring>' requested here
availableProfiles_.emplace_back(std::move(name), std::move(driver));
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_construct.h:94:5: note: candidate template ignored: substitution failure [with _Tp = waybar::modules::Profile, _Args = <Glib::ustring, Glib::ustring>]: no matching constructor for initialization of 'waybar::modules::Profile'
construct_at(_Tp* __location, _Args&&... __args)
^