Skip to content

AstalWp: add missing features #297

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

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

AstalWp: add missing features #297

wants to merge 15 commits into from

Conversation

kotontrion
Copy link
Collaborator

@kotontrion kotontrion commented Feb 21, 2025

The AstalWp lib initially only implemented enough to achieve feature parity with the audio service of ags v1 and is missing some useful features.

Todo:

  • per channel volume controls
  • set an endpoints target device
  • configure device routes
  • give the user access to more pipewire properties
  • docs

If there are feature missing in the list above, let me know.

Changes:

breaking

  • the AstalWpEndpoint class was renamed to AstalWpNode. There are two new Classes: AstalWpStream and AstalWpEndpoint, both inherit from AstalWpNode.
  • is-default property was moved from AstalWpNode to AstalWpEndpoint
  • use glib-mkenums, which might break packages. eg in Arch it is part of glib-devel, so this needs to be added as a build dependency

non breaking

  • AstalWpStream
    • target-serial: int represents the serial number of the Endpoint this stream targets.
    • target-endpoint: AstalWpEndpoint the target endpoint of this stream
    • media-role
    • `media-category``
  • AstalWpEndpoint
    • device-id: uint the id of the device associated with this endpoint
    • device: AstalWpdevice same, but the device object instead of id
    • is-default: boolean was moved here from AstalWpNode
    • routes: List of AstalWpRoute objects
    • active-route-id and active-route for the currently active route
  • AstalWpNode
    • state : AstalWpNodeState the current state of this node (eg, running, idle)
    • channel-volumes: GList(AstalWpChannelVolume) a list containing volume information for each channel
    • get_pw_property: gets a property of the underlying pipewire object. This allows to read properties, which are not wrapped as GObject properties yet.
  • AstalWpdevice
    • form-factor: string
  • AstalWpChanelVolume
    • name: string the name of the channel
    • volume: double the volume
    • volume-icon: string the volume icon
  • AstalWpRoute object representing a Route
  • AstalWpWp now has a ready signal, which is emitted after streams/endpoints/devices/etc are initially loaded

Note: kotontrion/wirecontrol#1 does make use of these new feature.

closes #295
closes #318

@PartyWumpus
Copy link

PartyWumpus commented Feb 23, 2025

Hey, I was bored so I decided to see if I could implement this stuff on my own. I've got form-factor and and endpoint target device on a branch PartyWumpus/astal/wireplumber-improvements. No idea if what I've written is any use, but thought I'd share. I could make a PR but this does what you're already planning to do so I wasn't sure.

(sidenote: being able to instantly just use endpoint.device.formFactor in TS with only these quick changes is great, astal is a really cool tool)

@kotontrion kotontrion marked this pull request as ready for review March 6, 2025 11:37
@kotontrion
Copy link
Collaborator Author

This PR is now basically ready except for the docs and a little cleanup. Also requires a bit more testing. I did only test it using wirecontrol, linked in the original message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

attributes missing for enums in gir Make AstalWp.Device give the form-factor
2 participants