1
0
Fork 0
🎚️ Rust library for observing/modifying PulseAudio volumes and the default source/sink
Find a file
2024-09-13 21:54:24 +02:00
src Add some docs 2024-09-13 21:54:24 +02:00
.gitignore Initial commit 2024-09-12 22:25:20 +02:00
Cargo.lock Remove double indirection at the cost of an unsafe lifetime transmutation 2024-09-13 19:45:21 +02:00
Cargo.toml Add Cargo.toml metadata and reduce state broadcast channel capacity to 1 2024-09-13 20:02:07 +02:00
LICENSE.md Initial commit 2024-09-12 22:25:20 +02:00
README.md Add some docs 2024-09-13 21:54:24 +02:00
rustfmt.toml Initial commit 2024-09-12 22:25:20 +02:00

pulseaudio-volume-interface

Rust library for observing/modifying PulseAudio volumes and the default source/sink.

Usage example

use pulseaudio_volume_interface::PulseAudioVolumeInterface;

fn main() {
    let pa_volume_interface = PulseAudioVolumeInterface::new("deckster handler".to_owned());
    // Wait for the data to load.
    // Because of PulseAudio, there is no way to know when everything is ready, so we have to just hope a second is enough.
    sleep(Duration::from_secs(1));

    let full_state = pa_volume_interface.current_state();
    let entities_by_id = full_state.entities_by_id();

    for (id, state) in entities_by_id {
        println!("{id}: {:#?}\n", state.metadata());
    }
}

License

This project is available under the permissive Blue Oak Model License 1.0.0.