docs(M8.1): add an Arch PipeWire mixer profile
Tests: cargo test --locked -p fader-config --test schema Tests: cargo test --locked -p fader_master --all-targets --all-features Lint: cargo clippy --locked -p fader-config -p fader_master --all-targets --all-features -- -D warnings
This commit is contained in:
parent
b5a24160ae
commit
e57c8812bf
|
|
@ -2,6 +2,7 @@ use fader_config::{DeviceProfile, PersistedState, Profile, StartupPolicy};
|
|||
use fader_core::{StreamMetadata, VolumeMode};
|
||||
|
||||
const EXAMPLE: &str = include_str!("../../examples/profiles/desktop.toml");
|
||||
const ARCH_PIPEWIRE: &str = include_str!("../../examples/profiles/arch-pipewire.toml");
|
||||
const ARCHITECTURE: &str = include_str!("../../architecture.md");
|
||||
|
||||
#[test]
|
||||
|
|
@ -47,6 +48,22 @@ fn validated_profile_exposes_compiled_runtime_application_and_group_views() {
|
|||
assert_eq!(media.volume_mode(), VolumeMode::Absolute);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn arch_pipewire_profile_matches_reported_qobuz_metadata() {
|
||||
let profile = Profile::parse(ARCH_PIPEWIRE).expect("Arch profile must validate");
|
||||
let music = profile.applications()[0]
|
||||
.matcher()
|
||||
.expect("validated music selector compiles");
|
||||
assert!(
|
||||
music.matches(
|
||||
&StreamMetadata::new()
|
||||
.with_application_name("PipeWire ALSA [qbz]")
|
||||
.with_media_name("ALSA Playback")
|
||||
)
|
||||
);
|
||||
assert!(!music.matches(&StreamMetadata::new().with_application_name("Firefox")));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn rejects_unknown_fields_versions_and_bad_ids_with_context() {
|
||||
let unknown = EXAMPLE.replace("schema_version = 1", "schema_version = 1\nsurprise = true");
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
schema_version = 1
|
||||
id = "arch-pipewire"
|
||||
startup = "adopt"
|
||||
new_stream = "adopt"
|
||||
|
||||
[audio]
|
||||
adapter = "pulse"
|
||||
max_gain = 1.0
|
||||
|
||||
[[applications]]
|
||||
id = "music"
|
||||
label = "Music"
|
||||
selectors = [
|
||||
{ field = "application.name", regex = '(?i)(qobuz|qbz|spotify|music)' },
|
||||
{ field = "application.process.binary", regex = '(?i)(qobuz|qbz|spotify)' },
|
||||
]
|
||||
|
||||
[[applications]]
|
||||
id = "browser"
|
||||
label = "Browser"
|
||||
selectors = [
|
||||
{ field = "application.name", regex = '(?i)(firefox|chromium|chrome|brave|librewolf)' },
|
||||
{ field = "application.process.binary", regex = '(?i)^(firefox|chromium|chrome|brave|librewolf)(-.*)?$' },
|
||||
]
|
||||
|
||||
[[groups]]
|
||||
id = "media"
|
||||
label = "Media group"
|
||||
members = ["music", "browser"]
|
||||
volume_mode = "absolute"
|
||||
|
|
@ -108,7 +108,7 @@ fn status(socket_override: Option<&Path>) -> Result<()> {
|
|||
match response.result {
|
||||
ResponseResult::Snapshot { snapshot } => {
|
||||
println!(
|
||||
"backend={} status={} revision={} streams={}",
|
||||
"backend={} status={} revision={} objects={}",
|
||||
snapshot.backend,
|
||||
snapshot.status,
|
||||
snapshot.revision,
|
||||
|
|
|
|||
Loading…
Reference in New Issue