feat(sound): redesign with separate device profiles page (#1500)

This commit is contained in:
Michael Murphy 2025-11-25 21:46:17 +01:00 committed by GitHub
parent 6ebc2208ed
commit 2c9f60cd5f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
65 changed files with 3179 additions and 1971 deletions

View file

@ -0,0 +1,27 @@
// Copyright 2025 System76 <info@system76.com>
// SPDX-License-Identifier: MPL-2.0
use pipewire::device::DeviceInfoRef;
/// Device information
#[must_use]
#[derive(Clone, Debug)]
pub struct Device {
pub id: u32,
pub name: String,
}
impl Device {
/// Attains process info from a pipewire info node.
#[must_use]
pub fn from_device(info: &DeviceInfoRef) -> Option<Self> {
let props = info.props()?;
let device = Device {
id: props.get("object.id")?.parse::<u32>().ok()?,
name: props.get("device.description")?.to_owned(),
};
Some(device)
}
}