From 9cb683ddb3c98c5ee0a2af32176f8ef2f5ce25d5 Mon Sep 17 00:00:00 2001 From: Moritz Ruth Date: Fri, 13 Sep 2024 20:02:07 +0200 Subject: [PATCH] Add Cargo.toml metadata and reduce state broadcast channel capacity to 1 --- Cargo.toml | 12 +++++++++--- README.md | 6 +++++- src/worker.rs | 3 ++- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index dd7d043..de466e2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,12 +2,18 @@ name = "pulseaudio-volume-interface" version = "1.0.0" edition = "2021" +authors = ["Moritz Ruth"] +description = "Allows observing/modifying PulseAudio volumes and the default source/sink" +repository = "https://git.moritzruth.de/moritzruth/pulseaudio-volume-interface" +license = "BlueOak-1.0.0" +keywords = ["pulseaudio", "volume", "audio"] +categories = ["os", "multimedia::audio"] [dependencies] +arc-swap = "1.7.1" +async-broadcast = "0.7.1" flume = "0.11.0" im = "15.1.0" libpulse-binding = "2.28.1" log = "0.4.21" -arc-swap = "1.7.1" -oneshot = "0.1.8" -async-broadcast = "0.7.1" \ No newline at end of file +oneshot = "0.1.8" \ No newline at end of file diff --git a/README.md b/README.md index 3e113e8..a0f72ce 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ # pulseaudio-volume-interface -> Rust library for observing and modifying PulseAudio source, sink, and sink input volumes. Also allows to set the default source and sink. +> Rust library for observing/modifying PulseAudio volumes and the default source/sink. + +## License + +This project is available under the permissive [Blue Oak Model License 1.0.0](https://blueoakcouncil.org/license/1.0.0). \ No newline at end of file diff --git a/src/worker.rs b/src/worker.rs index 48eba6c..bfcb383 100644 --- a/src/worker.rs +++ b/src/worker.rs @@ -386,7 +386,8 @@ pub(super) struct PaWorker { impl PaWorker { pub(super) fn spawn(client_name: String) -> PaWorker { let (commands_tx, commands_rx) = flume::unbounded(); - let (state_tx, _) = async_broadcast::broadcast(5); + let (mut state_tx, _) = async_broadcast::broadcast(1); + state_tx.set_overflow(true); let worker = PaWorker { commands_tx: commands_tx.clone(),