Commit Graph

18 Commits

Author SHA1 Message Date
Ryan Walklin 2326727ccb Update Wireplumber API to 0.5
The WP component loader API has changed to be asynchronous, so implement a (GAsyncReadyCallback)-based loader to manage them. Logging integration change was required for 0.5.0 RCs but not for the 0.5.0 release.

Fix clang-tidy and clang-format warnings. Note these are significantly wider than the changes for 0.5.0 so optional beyond the existing patchset.
2024-03-21 13:37:03 +13:00
Alan Vannereau 49caab47a6 Fix wireplumber reverse-scroll option 2023-12-22 11:50:41 +01:00
Alexander Bakker 6be5f7cb29 Disconnect from PipeWire when destroying the WirePlumber module
This fixes a crash where PipeWire tries to send events to a destroyed
WirePlumber module.
2023-11-29 22:46:58 +01:00
Caleb Harper 4d339f05af
Fix segmentation fault in WirePlumber module
The WirePlumber module assumes that either the node's name or
description will not be null. This leads to a segmentation fault when
both are.

The solution provided is to set self->node_name_ to a default value in
this case.
2023-11-06 09:50:13 -06:00
Evyatar Stalinsky e397f568b7 Round volume instead of truncating it 2023-06-06 11:42:31 +03:00
Evyatar Stalinsky d22fd3bbd1 Use a minimum step as provided by wireplubmer; Default step to 1 2023-06-06 11:42:02 +03:00
Evyatar Stalinsky 75990c2867 Fix linting 2023-06-05 22:23:46 +03:00
Evyatar Stalinsky 88a1a702b4 wireplumber: Support for scrolling 2023-06-05 22:03:46 +03:00
skylar779 3b2dfeec01
Made use of node_id_
Checking against names for volume changes seems a bit weird to me and
also didn't really work, so I've made use of node_id_ to check against
this instead and also fixed an issue, where the volume update would
refuse to do its thing despite it being the same id that was used on launch.
2023-04-11 10:51:25 +02:00
John Maximilian a9015c7c98
refactor: make linter happy. 2023-03-08 14:35:07 +00:00
Lucas Alber 8ccf00f0fe
Wireplumber: Free the default node name
The `default_node_name_` is reassigned without calling `g_free` on the old string.
2023-03-08 15:21:52 +01:00
Sasha Moak a9c9f1d705 fix(wireplumber): free(): invalid pointer
When freeing the `default_node_name_` pointer using `free`, the `&`
operator was used to try to free the reference rather than the pointer.
This caused a core dump. In order to fix this, the pointer is freed
instead (ie the `&` operator is no longer used).
2023-01-31 17:56:58 -08:00
Aleksei Bavshin ea17a66dfc
fix: compilation errors with cpp_std=c++20
There were two main issues with fmtlib and C++20 mode:

 - `fmt::format` defaults to compile-time argument checking and requires
   using `fmt::runtime(format_string)` to bypass that.
 - `std::format` implementation introduces conflicting declarations and
   we have to specify the namespace for all `format`/`format_to` calls.
2023-01-20 22:50:02 -08:00
Sasha Moak 4e8ccf36b5 fix(wireplumber): waybar crashes when default node changes
In order to fix the issue, the default node name is cached rather than
the default node id. This is due to ids being unstable. So now when the
object manager is installed (ie ready), the default node name is
retrieved and stored for later.

Now when the mixer changed signal is emitted, the id of the changed node
is used to get the node from the object manager. The nodes name is
grabbed off that node and compared against the default node name, if
they match the volume is updated. Some safeguarding has been added such
that if the node cannot be found off the object manager, it's ignored.

Additionally, the "changed" signal on the default nodes api is now
utilized to update the default node name if it has changed. This way if
the default node changes, the module will be updated with the correct
volume and node.nick.

This adds additional debug logging for helping diagnose wireplumber
issues.

This also adds the wireplumber man page entry to the main waybar
supported section.
2023-01-16 10:29:35 -08:00
Sasha Moak 60fa5e9f67 fix: wireplumber module when used with a bluetooth device
This fixes #1811 by falling back to `node.description` if `node.nick` is
not available. This can happen for bluetooth devices that do not have a
`node.nick`.
2022-11-26 11:35:45 -08:00
Sasha Moak 3730793197 feat: add icon support to the wireplumber module
Adds basic icon support for the wireplumber module.

This can be achieved by using `{icon}` in the `format` config and
pairing it with the `format-icons` config as well.

Example:

```
"wireplumber": {
    "format": "{volume}% {icon}",
    "format-icons": ["", "", ""]
}
```
2022-11-26 10:02:16 -08:00
Simon Plakolb 5e9bbe5c76 modules: Revert button to label 2022-11-24 13:08:16 +01:00
Sasha Moak c2f98d07ef feat: wireplumber support
Adds basic support for showing volume via wireplumber. Allows specifying
the node-id or falling back to the default Audio/Sink node id if node-id
is not set. If tooltip on hover is enabled, will show `{node_name}` by
default otherwise `tooltip-format`.

Format replacements:

`{volume}` - Volume in percentage
`{node_name}` - The node's nickname (`node.nick` property)
2022-11-16 23:23:07 -08:00