mirror of
https://github.com/arabianq/pipewire-soundpad.git
synced 2026-04-28 14:31:23 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e6c8d720d5 | |||
| a6d93ff528 | |||
| bcf791d84c | |||
| e4b0b10393 | |||
| 11de96db58 | |||
| 7396c0aef8 | |||
| fc2cd5e2da | |||
| 1a37729cf1 |
Generated
+39
-62
@@ -739,7 +739,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "cpal"
|
||||
version = "0.18.0"
|
||||
source = "git+https://github.com/RustAudio/cpal#e5d618c625e978a105c57edf12f4738c65056cef"
|
||||
source = "git+https://github.com/RustAudio/cpal#f938e338c9811fbe4d428517acf1d15cc6d694d4"
|
||||
dependencies = [
|
||||
"alsa",
|
||||
"block2 0.6.2",
|
||||
@@ -1249,23 +1249,9 @@ checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6"
|
||||
|
||||
[[package]]
|
||||
name = "fax"
|
||||
version = "0.2.6"
|
||||
version = "0.2.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f05de7d48f37cd6730705cbca900770cab77a89f413d23e100ad7fad7795a0ab"
|
||||
dependencies = [
|
||||
"fax_derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fax_derive"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a0aca10fb742cb43f9e7bb8467c91aa9bcb8e3ffbc6a6f7389bb93ffc920577d"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
checksum = "caf1079563223d5d59d83c85886a56e586cfd5c1a26292e971a0fa266531ac5a"
|
||||
|
||||
[[package]]
|
||||
name = "fdeflate"
|
||||
@@ -1721,9 +1707,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "idna_adapter"
|
||||
version = "1.2.1"
|
||||
version = "1.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344"
|
||||
checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714"
|
||||
dependencies = [
|
||||
"icu_normalizer",
|
||||
"icu_properties",
|
||||
@@ -1898,9 +1884,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "js-sys"
|
||||
version = "0.3.95"
|
||||
version = "0.3.97"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2964e92d1d9dc3364cae4d718d93f227e3abb088e747d92e0395bfdedf1c12ca"
|
||||
checksum = "a1840c94c045fbcf8ba2812c95db44499f7c64910a912551aaaa541decebcacf"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"futures-util",
|
||||
@@ -3023,7 +3009,7 @@ checksum = "3eb8486b569e12e2c32ad3e204dbaba5e4b5b216e9367044f25f1dba42341773"
|
||||
|
||||
[[package]]
|
||||
name = "pwsp"
|
||||
version = "1.7.5"
|
||||
version = "1.7.6"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"clap",
|
||||
@@ -3959,7 +3945,7 @@ dependencies = [
|
||||
"toml_datetime",
|
||||
"toml_parser",
|
||||
"toml_writer",
|
||||
"winnow 1.0.2",
|
||||
"winnow",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -3980,7 +3966,7 @@ dependencies = [
|
||||
"indexmap",
|
||||
"toml_datetime",
|
||||
"toml_parser",
|
||||
"winnow 1.0.2",
|
||||
"winnow",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -3989,7 +3975,7 @@ version = "1.1.2+spec-1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526"
|
||||
dependencies = [
|
||||
"winnow 1.0.2",
|
||||
"winnow",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4184,9 +4170,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wasm-bindgen"
|
||||
version = "0.2.118"
|
||||
version = "0.2.120"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0bf938a0bacb0469e83c1e148908bd7d5a6010354cf4fb73279b7447422e3a89"
|
||||
checksum = "df52b6d9b87e0c74c9edfa1eb2d9bf85e5d63515474513aa50fa181b3c4f5db1"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"once_cell",
|
||||
@@ -4197,9 +4183,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-futures"
|
||||
version = "0.4.68"
|
||||
version = "0.4.70"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f371d383f2fb139252e0bfac3b81b265689bf45b6874af544ffa4c975ac1ebf8"
|
||||
checksum = "af934872acec734c2d80e6617bbb5ff4f12b052dd8e6332b0817bce889516084"
|
||||
dependencies = [
|
||||
"js-sys",
|
||||
"wasm-bindgen",
|
||||
@@ -4207,9 +4193,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-macro"
|
||||
version = "0.2.118"
|
||||
version = "0.2.120"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "eeff24f84126c0ec2db7a449f0c2ec963c6a49efe0698c4242929da037ca28ed"
|
||||
checksum = "78b1041f495fb322e64aca85f5756b2172e35cd459376e67f2a6c9dffcedb103"
|
||||
dependencies = [
|
||||
"quote",
|
||||
"wasm-bindgen-macro-support",
|
||||
@@ -4217,9 +4203,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-macro-support"
|
||||
version = "0.2.118"
|
||||
version = "0.2.120"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9d08065faf983b2b80a79fd87d8254c409281cf7de75fc4b773019824196c904"
|
||||
checksum = "9dcd0ff20416988a18ac686d4d4d0f6aae9ebf08a389ff5d29012b05af2a1b41"
|
||||
dependencies = [
|
||||
"bumpalo",
|
||||
"proc-macro2",
|
||||
@@ -4230,9 +4216,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-shared"
|
||||
version = "0.2.118"
|
||||
version = "0.2.120"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5fd04d9e306f1907bd13c6361b5c6bfc7b3b3c095ed3f8a9246390f8dbdee129"
|
||||
checksum = "49757b3c82ebf16c57d69365a142940b384176c24df52a087fb748e2085359ea"
|
||||
dependencies = [
|
||||
"unicode-ident",
|
||||
]
|
||||
@@ -4408,9 +4394,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "web-sys"
|
||||
version = "0.3.95"
|
||||
version = "0.3.97"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4f2dfbb17949fa2088e5d39408c48368947b86f7834484e87b73de55bc14d97d"
|
||||
checksum = "2eadbac71025cd7b0834f20d1fe8472e8495821b4e9801eb0a60bd1f19827602"
|
||||
dependencies = [
|
||||
"js-sys",
|
||||
"wasm-bindgen",
|
||||
@@ -4962,15 +4948,6 @@ dependencies = [
|
||||
"xkbcommon-dl",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "winnow"
|
||||
version = "0.7.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "winnow"
|
||||
version = "1.0.2"
|
||||
@@ -5177,9 +5154,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "zbus"
|
||||
version = "5.14.0"
|
||||
version = "5.15.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ca82f95dbd3943a40a53cfded6c2d0a2ca26192011846a1810c4256ef92c60bc"
|
||||
checksum = "c3bcbf15c8708d7fc1be0c993622e0a5cbd5e8b52bfa40afa4c3e0cd8d724ac1"
|
||||
dependencies = [
|
||||
"async-broadcast",
|
||||
"async-executor",
|
||||
@@ -5204,7 +5181,7 @@ dependencies = [
|
||||
"uds_windows",
|
||||
"uuid",
|
||||
"windows-sys 0.61.2",
|
||||
"winnow 0.7.15",
|
||||
"winnow",
|
||||
"zbus_macros",
|
||||
"zbus_names",
|
||||
"zvariant",
|
||||
@@ -5212,9 +5189,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "zbus_macros"
|
||||
version = "5.14.0"
|
||||
version = "5.15.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "897e79616e84aac4b2c46e9132a4f63b93105d54fe8c0e8f6bffc21fa8d49222"
|
||||
checksum = "51fa5406ad9175a8c825a931f8cf347116b531b3634fcb0b627c290f1f2516ff"
|
||||
dependencies = [
|
||||
"proc-macro-crate",
|
||||
"proc-macro2",
|
||||
@@ -5227,12 +5204,12 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "zbus_names"
|
||||
version = "4.3.1"
|
||||
version = "4.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ffd8af6d5b78619bab301ff3c560a5bd22426150253db278f164d6cf3b72c50f"
|
||||
checksum = "7074f3e50b894eac91750142016d30d0a89be8e67dbfd9704fb875825760e52d"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"winnow 0.7.15",
|
||||
"winnow",
|
||||
"zvariant",
|
||||
]
|
||||
|
||||
@@ -5361,24 +5338,24 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "zvariant"
|
||||
version = "5.10.0"
|
||||
version = "5.10.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5708299b21903bbe348e94729f22c49c55d04720a004aa350f1f9c122fd2540b"
|
||||
checksum = "c4db0ecb8987cf5e92653c57c098f7f0e39a03112edb796f4fe089fb7eaa14ff"
|
||||
dependencies = [
|
||||
"endi",
|
||||
"enumflags2",
|
||||
"serde",
|
||||
"url",
|
||||
"winnow 0.7.15",
|
||||
"winnow",
|
||||
"zvariant_derive",
|
||||
"zvariant_utils",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zvariant_derive"
|
||||
version = "5.10.0"
|
||||
version = "5.10.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5b59b012ebe9c46656f9cc08d8da8b4c726510aef12559da3e5f1bf72780752c"
|
||||
checksum = "5b949b639ab1b4bed763aa7481ba0e368af68d8b55532f8ed4bec86a59f2ca98"
|
||||
dependencies = [
|
||||
"proc-macro-crate",
|
||||
"proc-macro2",
|
||||
@@ -5389,13 +5366,13 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "zvariant_utils"
|
||||
version = "3.3.0"
|
||||
version = "3.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f75c23a64ef8f40f13a6989991e643554d9bef1d682a281160cf0c1bc389c5e9"
|
||||
checksum = "6d464f5733ffa07a3164d656f18533caace9d0638596721355d73256a410d691"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"serde",
|
||||
"syn",
|
||||
"winnow 0.7.15",
|
||||
"winnow",
|
||||
]
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "pwsp"
|
||||
version = "1.7.5"
|
||||
version = "1.7.6"
|
||||
edition = "2024"
|
||||
authors = ["arabian"]
|
||||
description = "PWSP lets you play audio files through your microphone. Has both CLI and GUI clients."
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
pkgbase = pwsp-bin
|
||||
pkgdesc = Lets you play audio files through your microphone (Pre-built binaries)
|
||||
pkgver = 1.7.5
|
||||
pkgrel = 2
|
||||
pkgver = 1.7.6
|
||||
pkgrel = 1
|
||||
url = https://github.com/arabianq/pipewire-soundpad
|
||||
arch = x86_64
|
||||
license = MIT
|
||||
@@ -9,8 +9,8 @@ depends = pipewire
|
||||
depends = alsa-lib
|
||||
provides = pwsp
|
||||
conflicts = pwsp
|
||||
source = pwsp-bin-1.7.5.zip :: https://github.com/arabianq/pipewire-soundpad/releases/download/v1.7.5/pwsp-v1.7.5-linux-x64.zip
|
||||
source = pipewire-soundpad-1.7.5.tar.gz :: https://github.com/arabianq/pipewire-soundpad/archive/refs/tags/v1.7.5.tar.gz
|
||||
source = pwsp-bin-1.7.6.zip :: https://github.com/arabianq/pipewire-soundpad/releases/download/v1.7.6/pwsp-v1.7.6-linux-x64.zip
|
||||
source = pipewire-soundpad-1.7.6.tar.gz :: https://github.com/arabianq/pipewire-soundpad/archive/refs/tags/v1.7.6.tar.gz
|
||||
sha256sums = SKIP
|
||||
sha256sums = SKIP
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# Maintainer: Alexander Tarasov <a.tevg@ya.ru>
|
||||
pkgname=pwsp-bin
|
||||
_pkgname=pipewire-soundpad
|
||||
pkgver=1.7.5
|
||||
pkgrel=2
|
||||
pkgver=1.7.6
|
||||
pkgrel=1
|
||||
pkgdesc="Lets you play audio files through your microphone (Pre-built binaries)"
|
||||
arch=('x86_64')
|
||||
url="https://github.com/arabianq/pipewire-soundpad"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
pkgbase = pwsp
|
||||
pkgdesc = Lets you play audio files through your microphone
|
||||
pkgver = 1.7.5
|
||||
pkgver = 1.7.6
|
||||
pkgrel = 1
|
||||
url = https://github.com/arabianq/pipewire-soundpad
|
||||
arch = any
|
||||
@@ -8,9 +8,10 @@ pkgbase = pwsp
|
||||
makedepends = clang
|
||||
makedepends = rust
|
||||
makedepends = cargo
|
||||
makedepends = cmake
|
||||
makedepends = pipewire
|
||||
makedepends = alsa-lib
|
||||
source = https://github.com/arabianq/pipewire-soundpad/archive/refs/tags/v1.7.5.tar.gz
|
||||
source = https://github.com/arabianq/pipewire-soundpad/archive/refs/tags/v1.7.6.tar.gz
|
||||
sha256sums = SKIP
|
||||
|
||||
pkgname = pwsp
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
# Maintainer: Alexander Tarasov <a.tevg@ya.ru>
|
||||
pkgsubn=pwsp
|
||||
pkgname=pwsp
|
||||
pkgver=1.7.5
|
||||
pkgver=1.7.6
|
||||
pkgrel=1
|
||||
pkgdesc="Lets you play audio files through your microphone"
|
||||
arch=('any')
|
||||
url="https://github.com/arabianq/pipewire-soundpad"
|
||||
license=('MIT')
|
||||
makedepends=(clang rust cargo pipewire alsa-lib)
|
||||
makedepends=(clang rust cargo cmake pipewire alsa-lib)
|
||||
source=("$url/archive/refs/tags/v$pkgver.tar.gz")
|
||||
sha256sums=('SKIP')
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://github.com/rustaudio/cpal",
|
||||
"commit": "e5d618c625e978a105c57edf12f4738c65056cef",
|
||||
"dest": "flatpak-cargo/git/cpal-e5d618c"
|
||||
"commit": "f938e338c9811fbe4d428517acf1d15cc6d694d4",
|
||||
"dest": "flatpak-cargo/git/cpal-f938e33"
|
||||
},
|
||||
{
|
||||
"type": "git",
|
||||
@@ -976,7 +976,7 @@
|
||||
{
|
||||
"type": "shell",
|
||||
"commands": [
|
||||
"cp -r --reflink=auto \"flatpak-cargo/git/cpal-e5d618c/.\" \"cargo/vendor/cpal\""
|
||||
"cp -r --reflink=auto \"flatpak-cargo/git/cpal-f938e33/.\" \"cargo/vendor/cpal\""
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -1592,27 +1592,14 @@
|
||||
{
|
||||
"type": "archive",
|
||||
"archive-type": "tar-gzip",
|
||||
"url": "https://static.crates.io/crates/fax/fax-0.2.6.crate",
|
||||
"sha256": "f05de7d48f37cd6730705cbca900770cab77a89f413d23e100ad7fad7795a0ab",
|
||||
"dest": "cargo/vendor/fax-0.2.6"
|
||||
"url": "https://static.crates.io/crates/fax/fax-0.2.7.crate",
|
||||
"sha256": "caf1079563223d5d59d83c85886a56e586cfd5c1a26292e971a0fa266531ac5a",
|
||||
"dest": "cargo/vendor/fax-0.2.7"
|
||||
},
|
||||
{
|
||||
"type": "inline",
|
||||
"contents": "{\"package\": \"f05de7d48f37cd6730705cbca900770cab77a89f413d23e100ad7fad7795a0ab\", \"files\": {}}",
|
||||
"dest": "cargo/vendor/fax-0.2.6",
|
||||
"dest-filename": ".cargo-checksum.json"
|
||||
},
|
||||
{
|
||||
"type": "archive",
|
||||
"archive-type": "tar-gzip",
|
||||
"url": "https://static.crates.io/crates/fax_derive/fax_derive-0.2.0.crate",
|
||||
"sha256": "a0aca10fb742cb43f9e7bb8467c91aa9bcb8e3ffbc6a6f7389bb93ffc920577d",
|
||||
"dest": "cargo/vendor/fax_derive-0.2.0"
|
||||
},
|
||||
{
|
||||
"type": "inline",
|
||||
"contents": "{\"package\": \"a0aca10fb742cb43f9e7bb8467c91aa9bcb8e3ffbc6a6f7389bb93ffc920577d\", \"files\": {}}",
|
||||
"dest": "cargo/vendor/fax_derive-0.2.0",
|
||||
"contents": "{\"package\": \"caf1079563223d5d59d83c85886a56e586cfd5c1a26292e971a0fa266531ac5a\", \"files\": {}}",
|
||||
"dest": "cargo/vendor/fax-0.2.7",
|
||||
"dest-filename": ".cargo-checksum.json"
|
||||
},
|
||||
{
|
||||
@@ -2229,14 +2216,14 @@
|
||||
{
|
||||
"type": "archive",
|
||||
"archive-type": "tar-gzip",
|
||||
"url": "https://static.crates.io/crates/idna_adapter/idna_adapter-1.2.1.crate",
|
||||
"sha256": "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344",
|
||||
"dest": "cargo/vendor/idna_adapter-1.2.1"
|
||||
"url": "https://static.crates.io/crates/idna_adapter/idna_adapter-1.2.2.crate",
|
||||
"sha256": "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714",
|
||||
"dest": "cargo/vendor/idna_adapter-1.2.2"
|
||||
},
|
||||
{
|
||||
"type": "inline",
|
||||
"contents": "{\"package\": \"3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344\", \"files\": {}}",
|
||||
"dest": "cargo/vendor/idna_adapter-1.2.1",
|
||||
"contents": "{\"package\": \"cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714\", \"files\": {}}",
|
||||
"dest": "cargo/vendor/idna_adapter-1.2.2",
|
||||
"dest-filename": ".cargo-checksum.json"
|
||||
},
|
||||
{
|
||||
@@ -2437,14 +2424,14 @@
|
||||
{
|
||||
"type": "archive",
|
||||
"archive-type": "tar-gzip",
|
||||
"url": "https://static.crates.io/crates/js-sys/js-sys-0.3.95.crate",
|
||||
"sha256": "2964e92d1d9dc3364cae4d718d93f227e3abb088e747d92e0395bfdedf1c12ca",
|
||||
"dest": "cargo/vendor/js-sys-0.3.95"
|
||||
"url": "https://static.crates.io/crates/js-sys/js-sys-0.3.97.crate",
|
||||
"sha256": "a1840c94c045fbcf8ba2812c95db44499f7c64910a912551aaaa541decebcacf",
|
||||
"dest": "cargo/vendor/js-sys-0.3.97"
|
||||
},
|
||||
{
|
||||
"type": "inline",
|
||||
"contents": "{\"package\": \"2964e92d1d9dc3364cae4d718d93f227e3abb088e747d92e0395bfdedf1c12ca\", \"files\": {}}",
|
||||
"dest": "cargo/vendor/js-sys-0.3.95",
|
||||
"contents": "{\"package\": \"a1840c94c045fbcf8ba2812c95db44499f7c64910a912551aaaa541decebcacf\", \"files\": {}}",
|
||||
"dest": "cargo/vendor/js-sys-0.3.97",
|
||||
"dest-filename": ".cargo-checksum.json"
|
||||
},
|
||||
{
|
||||
@@ -5406,66 +5393,66 @@
|
||||
{
|
||||
"type": "archive",
|
||||
"archive-type": "tar-gzip",
|
||||
"url": "https://static.crates.io/crates/wasm-bindgen/wasm-bindgen-0.2.118.crate",
|
||||
"sha256": "0bf938a0bacb0469e83c1e148908bd7d5a6010354cf4fb73279b7447422e3a89",
|
||||
"dest": "cargo/vendor/wasm-bindgen-0.2.118"
|
||||
"url": "https://static.crates.io/crates/wasm-bindgen/wasm-bindgen-0.2.120.crate",
|
||||
"sha256": "df52b6d9b87e0c74c9edfa1eb2d9bf85e5d63515474513aa50fa181b3c4f5db1",
|
||||
"dest": "cargo/vendor/wasm-bindgen-0.2.120"
|
||||
},
|
||||
{
|
||||
"type": "inline",
|
||||
"contents": "{\"package\": \"0bf938a0bacb0469e83c1e148908bd7d5a6010354cf4fb73279b7447422e3a89\", \"files\": {}}",
|
||||
"dest": "cargo/vendor/wasm-bindgen-0.2.118",
|
||||
"contents": "{\"package\": \"df52b6d9b87e0c74c9edfa1eb2d9bf85e5d63515474513aa50fa181b3c4f5db1\", \"files\": {}}",
|
||||
"dest": "cargo/vendor/wasm-bindgen-0.2.120",
|
||||
"dest-filename": ".cargo-checksum.json"
|
||||
},
|
||||
{
|
||||
"type": "archive",
|
||||
"archive-type": "tar-gzip",
|
||||
"url": "https://static.crates.io/crates/wasm-bindgen-futures/wasm-bindgen-futures-0.4.68.crate",
|
||||
"sha256": "f371d383f2fb139252e0bfac3b81b265689bf45b6874af544ffa4c975ac1ebf8",
|
||||
"dest": "cargo/vendor/wasm-bindgen-futures-0.4.68"
|
||||
"url": "https://static.crates.io/crates/wasm-bindgen-futures/wasm-bindgen-futures-0.4.70.crate",
|
||||
"sha256": "af934872acec734c2d80e6617bbb5ff4f12b052dd8e6332b0817bce889516084",
|
||||
"dest": "cargo/vendor/wasm-bindgen-futures-0.4.70"
|
||||
},
|
||||
{
|
||||
"type": "inline",
|
||||
"contents": "{\"package\": \"f371d383f2fb139252e0bfac3b81b265689bf45b6874af544ffa4c975ac1ebf8\", \"files\": {}}",
|
||||
"dest": "cargo/vendor/wasm-bindgen-futures-0.4.68",
|
||||
"contents": "{\"package\": \"af934872acec734c2d80e6617bbb5ff4f12b052dd8e6332b0817bce889516084\", \"files\": {}}",
|
||||
"dest": "cargo/vendor/wasm-bindgen-futures-0.4.70",
|
||||
"dest-filename": ".cargo-checksum.json"
|
||||
},
|
||||
{
|
||||
"type": "archive",
|
||||
"archive-type": "tar-gzip",
|
||||
"url": "https://static.crates.io/crates/wasm-bindgen-macro/wasm-bindgen-macro-0.2.118.crate",
|
||||
"sha256": "eeff24f84126c0ec2db7a449f0c2ec963c6a49efe0698c4242929da037ca28ed",
|
||||
"dest": "cargo/vendor/wasm-bindgen-macro-0.2.118"
|
||||
"url": "https://static.crates.io/crates/wasm-bindgen-macro/wasm-bindgen-macro-0.2.120.crate",
|
||||
"sha256": "78b1041f495fb322e64aca85f5756b2172e35cd459376e67f2a6c9dffcedb103",
|
||||
"dest": "cargo/vendor/wasm-bindgen-macro-0.2.120"
|
||||
},
|
||||
{
|
||||
"type": "inline",
|
||||
"contents": "{\"package\": \"eeff24f84126c0ec2db7a449f0c2ec963c6a49efe0698c4242929da037ca28ed\", \"files\": {}}",
|
||||
"dest": "cargo/vendor/wasm-bindgen-macro-0.2.118",
|
||||
"contents": "{\"package\": \"78b1041f495fb322e64aca85f5756b2172e35cd459376e67f2a6c9dffcedb103\", \"files\": {}}",
|
||||
"dest": "cargo/vendor/wasm-bindgen-macro-0.2.120",
|
||||
"dest-filename": ".cargo-checksum.json"
|
||||
},
|
||||
{
|
||||
"type": "archive",
|
||||
"archive-type": "tar-gzip",
|
||||
"url": "https://static.crates.io/crates/wasm-bindgen-macro-support/wasm-bindgen-macro-support-0.2.118.crate",
|
||||
"sha256": "9d08065faf983b2b80a79fd87d8254c409281cf7de75fc4b773019824196c904",
|
||||
"dest": "cargo/vendor/wasm-bindgen-macro-support-0.2.118"
|
||||
"url": "https://static.crates.io/crates/wasm-bindgen-macro-support/wasm-bindgen-macro-support-0.2.120.crate",
|
||||
"sha256": "9dcd0ff20416988a18ac686d4d4d0f6aae9ebf08a389ff5d29012b05af2a1b41",
|
||||
"dest": "cargo/vendor/wasm-bindgen-macro-support-0.2.120"
|
||||
},
|
||||
{
|
||||
"type": "inline",
|
||||
"contents": "{\"package\": \"9d08065faf983b2b80a79fd87d8254c409281cf7de75fc4b773019824196c904\", \"files\": {}}",
|
||||
"dest": "cargo/vendor/wasm-bindgen-macro-support-0.2.118",
|
||||
"contents": "{\"package\": \"9dcd0ff20416988a18ac686d4d4d0f6aae9ebf08a389ff5d29012b05af2a1b41\", \"files\": {}}",
|
||||
"dest": "cargo/vendor/wasm-bindgen-macro-support-0.2.120",
|
||||
"dest-filename": ".cargo-checksum.json"
|
||||
},
|
||||
{
|
||||
"type": "archive",
|
||||
"archive-type": "tar-gzip",
|
||||
"url": "https://static.crates.io/crates/wasm-bindgen-shared/wasm-bindgen-shared-0.2.118.crate",
|
||||
"sha256": "5fd04d9e306f1907bd13c6361b5c6bfc7b3b3c095ed3f8a9246390f8dbdee129",
|
||||
"dest": "cargo/vendor/wasm-bindgen-shared-0.2.118"
|
||||
"url": "https://static.crates.io/crates/wasm-bindgen-shared/wasm-bindgen-shared-0.2.120.crate",
|
||||
"sha256": "49757b3c82ebf16c57d69365a142940b384176c24df52a087fb748e2085359ea",
|
||||
"dest": "cargo/vendor/wasm-bindgen-shared-0.2.120"
|
||||
},
|
||||
{
|
||||
"type": "inline",
|
||||
"contents": "{\"package\": \"5fd04d9e306f1907bd13c6361b5c6bfc7b3b3c095ed3f8a9246390f8dbdee129\", \"files\": {}}",
|
||||
"dest": "cargo/vendor/wasm-bindgen-shared-0.2.118",
|
||||
"contents": "{\"package\": \"49757b3c82ebf16c57d69365a142940b384176c24df52a087fb748e2085359ea\", \"files\": {}}",
|
||||
"dest": "cargo/vendor/wasm-bindgen-shared-0.2.120",
|
||||
"dest-filename": ".cargo-checksum.json"
|
||||
},
|
||||
{
|
||||
@@ -5653,14 +5640,14 @@
|
||||
{
|
||||
"type": "archive",
|
||||
"archive-type": "tar-gzip",
|
||||
"url": "https://static.crates.io/crates/web-sys/web-sys-0.3.95.crate",
|
||||
"sha256": "4f2dfbb17949fa2088e5d39408c48368947b86f7834484e87b73de55bc14d97d",
|
||||
"dest": "cargo/vendor/web-sys-0.3.95"
|
||||
"url": "https://static.crates.io/crates/web-sys/web-sys-0.3.97.crate",
|
||||
"sha256": "2eadbac71025cd7b0834f20d1fe8472e8495821b4e9801eb0a60bd1f19827602",
|
||||
"dest": "cargo/vendor/web-sys-0.3.97"
|
||||
},
|
||||
{
|
||||
"type": "inline",
|
||||
"contents": "{\"package\": \"4f2dfbb17949fa2088e5d39408c48368947b86f7834484e87b73de55bc14d97d\", \"files\": {}}",
|
||||
"dest": "cargo/vendor/web-sys-0.3.95",
|
||||
"contents": "{\"package\": \"2eadbac71025cd7b0834f20d1fe8472e8495821b4e9801eb0a60bd1f19827602\", \"files\": {}}",
|
||||
"dest": "cargo/vendor/web-sys-0.3.97",
|
||||
"dest-filename": ".cargo-checksum.json"
|
||||
},
|
||||
{
|
||||
@@ -6352,19 +6339,6 @@
|
||||
"dest": "cargo/vendor/winit-0.30.13",
|
||||
"dest-filename": ".cargo-checksum.json"
|
||||
},
|
||||
{
|
||||
"type": "archive",
|
||||
"archive-type": "tar-gzip",
|
||||
"url": "https://static.crates.io/crates/winnow/winnow-0.7.15.crate",
|
||||
"sha256": "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945",
|
||||
"dest": "cargo/vendor/winnow-0.7.15"
|
||||
},
|
||||
{
|
||||
"type": "inline",
|
||||
"contents": "{\"package\": \"df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945\", \"files\": {}}",
|
||||
"dest": "cargo/vendor/winnow-0.7.15",
|
||||
"dest-filename": ".cargo-checksum.json"
|
||||
},
|
||||
{
|
||||
"type": "archive",
|
||||
"archive-type": "tar-gzip",
|
||||
@@ -6615,40 +6589,40 @@
|
||||
{
|
||||
"type": "archive",
|
||||
"archive-type": "tar-gzip",
|
||||
"url": "https://static.crates.io/crates/zbus/zbus-5.14.0.crate",
|
||||
"sha256": "ca82f95dbd3943a40a53cfded6c2d0a2ca26192011846a1810c4256ef92c60bc",
|
||||
"dest": "cargo/vendor/zbus-5.14.0"
|
||||
"url": "https://static.crates.io/crates/zbus/zbus-5.15.0.crate",
|
||||
"sha256": "c3bcbf15c8708d7fc1be0c993622e0a5cbd5e8b52bfa40afa4c3e0cd8d724ac1",
|
||||
"dest": "cargo/vendor/zbus-5.15.0"
|
||||
},
|
||||
{
|
||||
"type": "inline",
|
||||
"contents": "{\"package\": \"ca82f95dbd3943a40a53cfded6c2d0a2ca26192011846a1810c4256ef92c60bc\", \"files\": {}}",
|
||||
"dest": "cargo/vendor/zbus-5.14.0",
|
||||
"contents": "{\"package\": \"c3bcbf15c8708d7fc1be0c993622e0a5cbd5e8b52bfa40afa4c3e0cd8d724ac1\", \"files\": {}}",
|
||||
"dest": "cargo/vendor/zbus-5.15.0",
|
||||
"dest-filename": ".cargo-checksum.json"
|
||||
},
|
||||
{
|
||||
"type": "archive",
|
||||
"archive-type": "tar-gzip",
|
||||
"url": "https://static.crates.io/crates/zbus_macros/zbus_macros-5.14.0.crate",
|
||||
"sha256": "897e79616e84aac4b2c46e9132a4f63b93105d54fe8c0e8f6bffc21fa8d49222",
|
||||
"dest": "cargo/vendor/zbus_macros-5.14.0"
|
||||
"url": "https://static.crates.io/crates/zbus_macros/zbus_macros-5.15.0.crate",
|
||||
"sha256": "51fa5406ad9175a8c825a931f8cf347116b531b3634fcb0b627c290f1f2516ff",
|
||||
"dest": "cargo/vendor/zbus_macros-5.15.0"
|
||||
},
|
||||
{
|
||||
"type": "inline",
|
||||
"contents": "{\"package\": \"897e79616e84aac4b2c46e9132a4f63b93105d54fe8c0e8f6bffc21fa8d49222\", \"files\": {}}",
|
||||
"dest": "cargo/vendor/zbus_macros-5.14.0",
|
||||
"contents": "{\"package\": \"51fa5406ad9175a8c825a931f8cf347116b531b3634fcb0b627c290f1f2516ff\", \"files\": {}}",
|
||||
"dest": "cargo/vendor/zbus_macros-5.15.0",
|
||||
"dest-filename": ".cargo-checksum.json"
|
||||
},
|
||||
{
|
||||
"type": "archive",
|
||||
"archive-type": "tar-gzip",
|
||||
"url": "https://static.crates.io/crates/zbus_names/zbus_names-4.3.1.crate",
|
||||
"sha256": "ffd8af6d5b78619bab301ff3c560a5bd22426150253db278f164d6cf3b72c50f",
|
||||
"dest": "cargo/vendor/zbus_names-4.3.1"
|
||||
"url": "https://static.crates.io/crates/zbus_names/zbus_names-4.3.2.crate",
|
||||
"sha256": "7074f3e50b894eac91750142016d30d0a89be8e67dbfd9704fb875825760e52d",
|
||||
"dest": "cargo/vendor/zbus_names-4.3.2"
|
||||
},
|
||||
{
|
||||
"type": "inline",
|
||||
"contents": "{\"package\": \"ffd8af6d5b78619bab301ff3c560a5bd22426150253db278f164d6cf3b72c50f\", \"files\": {}}",
|
||||
"dest": "cargo/vendor/zbus_names-4.3.1",
|
||||
"contents": "{\"package\": \"7074f3e50b894eac91750142016d30d0a89be8e67dbfd9704fb875825760e52d\", \"files\": {}}",
|
||||
"dest": "cargo/vendor/zbus_names-4.3.2",
|
||||
"dest-filename": ".cargo-checksum.json"
|
||||
},
|
||||
{
|
||||
@@ -6823,40 +6797,40 @@
|
||||
{
|
||||
"type": "archive",
|
||||
"archive-type": "tar-gzip",
|
||||
"url": "https://static.crates.io/crates/zvariant/zvariant-5.10.0.crate",
|
||||
"sha256": "5708299b21903bbe348e94729f22c49c55d04720a004aa350f1f9c122fd2540b",
|
||||
"dest": "cargo/vendor/zvariant-5.10.0"
|
||||
"url": "https://static.crates.io/crates/zvariant/zvariant-5.10.1.crate",
|
||||
"sha256": "c4db0ecb8987cf5e92653c57c098f7f0e39a03112edb796f4fe089fb7eaa14ff",
|
||||
"dest": "cargo/vendor/zvariant-5.10.1"
|
||||
},
|
||||
{
|
||||
"type": "inline",
|
||||
"contents": "{\"package\": \"5708299b21903bbe348e94729f22c49c55d04720a004aa350f1f9c122fd2540b\", \"files\": {}}",
|
||||
"dest": "cargo/vendor/zvariant-5.10.0",
|
||||
"contents": "{\"package\": \"c4db0ecb8987cf5e92653c57c098f7f0e39a03112edb796f4fe089fb7eaa14ff\", \"files\": {}}",
|
||||
"dest": "cargo/vendor/zvariant-5.10.1",
|
||||
"dest-filename": ".cargo-checksum.json"
|
||||
},
|
||||
{
|
||||
"type": "archive",
|
||||
"archive-type": "tar-gzip",
|
||||
"url": "https://static.crates.io/crates/zvariant_derive/zvariant_derive-5.10.0.crate",
|
||||
"sha256": "5b59b012ebe9c46656f9cc08d8da8b4c726510aef12559da3e5f1bf72780752c",
|
||||
"dest": "cargo/vendor/zvariant_derive-5.10.0"
|
||||
"url": "https://static.crates.io/crates/zvariant_derive/zvariant_derive-5.10.1.crate",
|
||||
"sha256": "5b949b639ab1b4bed763aa7481ba0e368af68d8b55532f8ed4bec86a59f2ca98",
|
||||
"dest": "cargo/vendor/zvariant_derive-5.10.1"
|
||||
},
|
||||
{
|
||||
"type": "inline",
|
||||
"contents": "{\"package\": \"5b59b012ebe9c46656f9cc08d8da8b4c726510aef12559da3e5f1bf72780752c\", \"files\": {}}",
|
||||
"dest": "cargo/vendor/zvariant_derive-5.10.0",
|
||||
"contents": "{\"package\": \"5b949b639ab1b4bed763aa7481ba0e368af68d8b55532f8ed4bec86a59f2ca98\", \"files\": {}}",
|
||||
"dest": "cargo/vendor/zvariant_derive-5.10.1",
|
||||
"dest-filename": ".cargo-checksum.json"
|
||||
},
|
||||
{
|
||||
"type": "archive",
|
||||
"archive-type": "tar-gzip",
|
||||
"url": "https://static.crates.io/crates/zvariant_utils/zvariant_utils-3.3.0.crate",
|
||||
"sha256": "f75c23a64ef8f40f13a6989991e643554d9bef1d682a281160cf0c1bc389c5e9",
|
||||
"dest": "cargo/vendor/zvariant_utils-3.3.0"
|
||||
"url": "https://static.crates.io/crates/zvariant_utils/zvariant_utils-3.3.1.crate",
|
||||
"sha256": "6d464f5733ffa07a3164d656f18533caace9d0638596721355d73256a410d691",
|
||||
"dest": "cargo/vendor/zvariant_utils-3.3.1"
|
||||
},
|
||||
{
|
||||
"type": "inline",
|
||||
"contents": "{\"package\": \"f75c23a64ef8f40f13a6989991e643554d9bef1d682a281160cf0c1bc389c5e9\", \"files\": {}}",
|
||||
"dest": "cargo/vendor/zvariant_utils-3.3.0",
|
||||
"contents": "{\"package\": \"6d464f5733ffa07a3164d656f18533caace9d0638596721355d73256a410d691\", \"files\": {}}",
|
||||
"dest": "cargo/vendor/zvariant_utils-3.3.1",
|
||||
"dest-filename": ".cargo-checksum.json"
|
||||
},
|
||||
{
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<name>arabian</name>
|
||||
</developer>
|
||||
<releases>
|
||||
<release version="1.7.5" date="2026-04-26" />
|
||||
<release version="1.7.6" date="2026-04-28" />
|
||||
</releases>
|
||||
<content_rating type="oars-1.1" />
|
||||
</component>
|
||||
@@ -4,7 +4,7 @@
|
||||
%global cargo_install_lib 0
|
||||
|
||||
Name: pwsp
|
||||
Version: 1.7.5
|
||||
Version: 1.7.6
|
||||
Release: %autorelease
|
||||
Summary: Lets you play audio files through your microphone
|
||||
|
||||
@@ -18,6 +18,7 @@ BuildRequires: cargo
|
||||
BuildRequires: pipewire-devel
|
||||
BuildRequires: alsa-lib-devel
|
||||
BuildRequires: clang-devel
|
||||
BuildRequires: cmake
|
||||
|
||||
%global _description %{expand:
|
||||
PWSP lets you play audio files through your microphone. Has both CLI and
|
||||
|
||||
+373
-343
@@ -10,7 +10,7 @@ use pwsp::types::socket::Request;
|
||||
use pwsp::types::{audio_player::TrackInfo, gui::AppState};
|
||||
use pwsp::utils::gui::{format_time_pair, make_request_async};
|
||||
use std::{
|
||||
path::{Path, PathBuf},
|
||||
path::Path,
|
||||
time::Instant,
|
||||
};
|
||||
|
||||
@@ -137,271 +137,285 @@ impl SoundpadGui {
|
||||
ui.vertical(|ui| {
|
||||
ui.spacing_mut().item_spacing.y = 5.0;
|
||||
|
||||
// --- Header ---
|
||||
ui.horizontal(|ui| {
|
||||
let back_button = Button::new(ICON_ARROW_BACK).frame(false);
|
||||
if ui.add(back_button).clicked() {
|
||||
self.app_state.show_hotkeys = false;
|
||||
}
|
||||
|
||||
ui.vertical_centered(|ui| {
|
||||
ui.label(RichText::new("Hotkeys").color(Color32::WHITE).monospace());
|
||||
});
|
||||
});
|
||||
|
||||
self.draw_hotkeys_header(ui);
|
||||
ui.separator();
|
||||
|
||||
// --- Search and Add Command ---
|
||||
ui.horizontal(|ui| {
|
||||
ui.menu_button(format!("{} Add Command", ICON_ADD.codepoint), |ui| {
|
||||
let mut selected_cmd = None;
|
||||
if ui.button("Toggle Pause").clicked() {
|
||||
selected_cmd = Some(("cmd_toggle_pause", Request::toggle_pause(None)));
|
||||
}
|
||||
if ui.button("Stop Playback").clicked() {
|
||||
selected_cmd = Some(("cmd_stop", Request::stop(None)));
|
||||
}
|
||||
if ui.button("Pause Playback").clicked() {
|
||||
selected_cmd = Some(("cmd_pause", Request::pause(None)));
|
||||
}
|
||||
if ui.button("Resume Playback").clicked() {
|
||||
selected_cmd = Some(("cmd_resume", Request::resume(None)));
|
||||
}
|
||||
if ui.button("Toggle Loop").clicked() {
|
||||
selected_cmd = Some(("cmd_toggle_loop", Request::toggle_loop(None)));
|
||||
}
|
||||
|
||||
if let Some((slot_name, req)) = selected_cmd {
|
||||
make_request_async(Request::set_hotkey_action(slot_name, &req));
|
||||
self.app_state
|
||||
.hotkey_config
|
||||
.set_slot(slot_name.to_string(), req);
|
||||
self.app_state.assigning_hotkey_slot = Some(slot_name.to_string());
|
||||
self.app_state.hotkey_capture_active = true;
|
||||
ui.close();
|
||||
}
|
||||
});
|
||||
|
||||
ui.add_space(10.0);
|
||||
|
||||
ui.add(
|
||||
TextEdit::singleline(&mut self.app_state.hotkey_search_query)
|
||||
.hint_text("Search hotkeys...")
|
||||
.desired_width(f32::INFINITY),
|
||||
);
|
||||
});
|
||||
|
||||
self.draw_hotkeys_search(ui);
|
||||
ui.separator();
|
||||
ui.add_space(5.0);
|
||||
|
||||
let conflicts = self.app_state.hotkey_config.find_conflicts();
|
||||
let conflict_slots: std::collections::HashSet<&str> =
|
||||
conflicts.into_iter().flat_map(|(a, b)| [a, b]).collect();
|
||||
|
||||
let search = self.app_state.hotkey_search_query.to_lowercase();
|
||||
let mut action: Option<HotkeyAction> = None;
|
||||
|
||||
let slots: Vec<_> = self
|
||||
.app_state
|
||||
.hotkey_config
|
||||
.slots
|
||||
.iter()
|
||||
.filter(|s| {
|
||||
if search.is_empty() {
|
||||
return true;
|
||||
}
|
||||
s.slot.to_lowercase().contains(&search)
|
||||
|| format!("{:?}", s.action).to_lowercase().contains(&search)
|
||||
|| s.key_chord
|
||||
.as_deref()
|
||||
.unwrap_or("")
|
||||
.to_lowercase()
|
||||
.contains(&search)
|
||||
})
|
||||
.cloned()
|
||||
.collect();
|
||||
|
||||
let available_width = ui.available_width();
|
||||
let col_width = (available_width / 4.0).max(80.0);
|
||||
|
||||
TableBuilder::new(ui)
|
||||
.striped(true)
|
||||
.column(Column::exact(col_width).clip(true)) // Slot
|
||||
.column(Column::exact(col_width).clip(true)) // Sound / Action name
|
||||
.column(Column::exact(col_width).clip(true)) // Key Chord
|
||||
.column(Column::exact(col_width).clip(true)) // Actions
|
||||
.header(30.0, |mut header| {
|
||||
header.col(|ui| {
|
||||
ui.label(
|
||||
RichText::new("Slot")
|
||||
.strong()
|
||||
.monospace()
|
||||
.color(Color32::LIGHT_GRAY),
|
||||
);
|
||||
});
|
||||
header.col(|ui| {
|
||||
ui.label(
|
||||
RichText::new("Sound")
|
||||
.strong()
|
||||
.monospace()
|
||||
.color(Color32::LIGHT_GRAY),
|
||||
);
|
||||
});
|
||||
header.col(|ui| {
|
||||
ui.label(
|
||||
RichText::new("Key Chord")
|
||||
.strong()
|
||||
.monospace()
|
||||
.color(Color32::LIGHT_GRAY),
|
||||
);
|
||||
});
|
||||
header.col(|ui| {
|
||||
ui.label(
|
||||
RichText::new("Actions")
|
||||
.strong()
|
||||
.monospace()
|
||||
.color(Color32::LIGHT_GRAY),
|
||||
);
|
||||
});
|
||||
})
|
||||
.body(|mut body| {
|
||||
if slots.is_empty() {
|
||||
body.row(30.0, |mut row| {
|
||||
row.col(|_| {});
|
||||
row.col(|ui| {
|
||||
ui.label(
|
||||
RichText::new("No hotkey slots configured.")
|
||||
.color(Color32::GRAY),
|
||||
);
|
||||
});
|
||||
row.col(|_| {});
|
||||
row.col(|_| {});
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
for slot in &slots {
|
||||
body.row(30.0, |mut row| {
|
||||
// Column 1: Slot
|
||||
row.col(|ui| {
|
||||
ui.horizontal(|ui| {
|
||||
if conflict_slots.contains(slot.slot.as_str()) {
|
||||
ui.label(
|
||||
RichText::new(ICON_WARNING.codepoint)
|
||||
.color(Color32::from_rgb(255, 165, 0)),
|
||||
)
|
||||
.on_hover_text("Key chord conflict");
|
||||
}
|
||||
ui.add(
|
||||
Label::new(RichText::new(&slot.slot).monospace())
|
||||
.truncate(),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
// Column 2: Sound / Action name
|
||||
row.col(|ui| {
|
||||
let action_name = match slot.action.name.as_str() {
|
||||
"play" => {
|
||||
if let Some(file_path_str) =
|
||||
slot.action.args.get("file_path")
|
||||
{
|
||||
Path::new(file_path_str)
|
||||
.file_name()
|
||||
.unwrap_or_default()
|
||||
.to_string_lossy()
|
||||
.to_string()
|
||||
} else {
|
||||
"Play".to_string()
|
||||
}
|
||||
}
|
||||
"toggle_pause" => "Toggle Pause".to_string(),
|
||||
"pause" => "Pause Playback".to_string(),
|
||||
"resume" => "Resume Playback".to_string(),
|
||||
"stop" => "Stop Playback".to_string(),
|
||||
"toggle_loop" => "Toggle Loop".to_string(),
|
||||
other => other.to_string(),
|
||||
};
|
||||
ui.add(
|
||||
Label::new(RichText::new(action_name).monospace()).truncate(),
|
||||
);
|
||||
});
|
||||
|
||||
// Column 3: Key Chord
|
||||
row.col(|ui| {
|
||||
let chord_text = slot.key_chord.as_deref().unwrap_or("(none)");
|
||||
ui.add(
|
||||
Label::new(RichText::new(chord_text).monospace().color(
|
||||
if slot.key_chord.is_some() {
|
||||
Color32::from_rgb(100, 200, 100)
|
||||
} else {
|
||||
Color32::GRAY
|
||||
},
|
||||
))
|
||||
.truncate(),
|
||||
);
|
||||
});
|
||||
|
||||
// Column 4: Actions
|
||||
row.col(|ui| {
|
||||
ui.horizontal(|ui| {
|
||||
if ui
|
||||
.add(Button::new(ICON_DELETE).frame(false))
|
||||
.on_hover_text("Remove slot")
|
||||
.clicked()
|
||||
{
|
||||
action = Some(HotkeyAction::Remove(slot.slot.clone()));
|
||||
}
|
||||
if ui
|
||||
.add(Button::new(ICON_KEYBOARD).frame(false))
|
||||
.on_hover_text("Set key chord")
|
||||
.clicked()
|
||||
{
|
||||
action = Some(HotkeyAction::Capture(slot.slot.clone()));
|
||||
}
|
||||
if slot.key_chord.is_some()
|
||||
&& ui
|
||||
.add(Button::new(ICON_BACKSPACE).frame(false))
|
||||
.on_hover_text("Clear key chord")
|
||||
.clicked()
|
||||
{
|
||||
action = Some(HotkeyAction::ClearChord(slot.slot.clone()));
|
||||
}
|
||||
if ui
|
||||
.add(Button::new(ICON_PLAY_ARROW).frame(false))
|
||||
.on_hover_text("Play")
|
||||
.clicked()
|
||||
{
|
||||
action = Some(HotkeyAction::Play(slot.slot.clone()));
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
let action = self.draw_hotkeys_table(ui);
|
||||
|
||||
if let Some(action) = action {
|
||||
match action {
|
||||
HotkeyAction::Remove(slot) => {
|
||||
make_request_async(Request::clear_hotkey(&slot));
|
||||
self.app_state.hotkey_config.remove_slot(&slot);
|
||||
}
|
||||
HotkeyAction::Capture(slot) => {
|
||||
self.app_state.assigning_hotkey_slot = Some(slot);
|
||||
self.app_state.hotkey_capture_active = true;
|
||||
}
|
||||
HotkeyAction::ClearChord(slot) => {
|
||||
make_request_async(Request::clear_hotkey_key(&slot));
|
||||
self.app_state.hotkey_config.set_key_chord(&slot, None);
|
||||
}
|
||||
HotkeyAction::Play(slot) => {
|
||||
self.play_hotkey_slot(&slot);
|
||||
}
|
||||
}
|
||||
self.handle_hotkey_action(action);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
fn draw_hotkeys_header(&mut self, ui: &mut Ui) {
|
||||
ui.horizontal(|ui| {
|
||||
let back_button = Button::new(ICON_ARROW_BACK).frame(false);
|
||||
if ui.add(back_button).clicked() {
|
||||
self.app_state.show_hotkeys = false;
|
||||
}
|
||||
|
||||
ui.vertical_centered(|ui| {
|
||||
ui.label(RichText::new("Hotkeys").color(Color32::WHITE).monospace());
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
fn draw_hotkeys_search(&mut self, ui: &mut Ui) {
|
||||
ui.horizontal(|ui| {
|
||||
ui.menu_button(format!("{} Add Command", ICON_ADD.codepoint), |ui| {
|
||||
let mut selected_cmd = None;
|
||||
if ui.button("Toggle Pause").clicked() {
|
||||
selected_cmd = Some(("cmd_toggle_pause", Request::toggle_pause(None)));
|
||||
}
|
||||
if ui.button("Stop Playback").clicked() {
|
||||
selected_cmd = Some(("cmd_stop", Request::stop(None)));
|
||||
}
|
||||
if ui.button("Pause Playback").clicked() {
|
||||
selected_cmd = Some(("cmd_pause", Request::pause(None)));
|
||||
}
|
||||
if ui.button("Resume Playback").clicked() {
|
||||
selected_cmd = Some(("cmd_resume", Request::resume(None)));
|
||||
}
|
||||
if ui.button("Toggle Loop").clicked() {
|
||||
selected_cmd = Some(("cmd_toggle_loop", Request::toggle_loop(None)));
|
||||
}
|
||||
|
||||
if let Some((slot_name, req)) = selected_cmd {
|
||||
make_request_async(Request::set_hotkey_action(slot_name, &req));
|
||||
self.app_state
|
||||
.hotkey_config
|
||||
.set_slot(slot_name.to_string(), req);
|
||||
self.app_state.assigning_hotkey_slot = Some(slot_name.to_string());
|
||||
self.app_state.hotkey_capture_active = true;
|
||||
ui.close();
|
||||
}
|
||||
});
|
||||
|
||||
ui.add_space(10.0);
|
||||
|
||||
ui.add(
|
||||
TextEdit::singleline(&mut self.app_state.hotkey_search_query)
|
||||
.hint_text("Search hotkeys...")
|
||||
.desired_width(f32::INFINITY),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
fn draw_hotkeys_table(&mut self, ui: &mut Ui) -> Option<HotkeyAction> {
|
||||
let conflicts = self.app_state.hotkey_config.find_conflicts();
|
||||
let conflict_slots: std::collections::HashSet<&str> =
|
||||
conflicts.into_iter().flat_map(|(a, b)| [a, b]).collect();
|
||||
|
||||
let search = self.app_state.hotkey_search_query.to_lowercase();
|
||||
let mut action: Option<HotkeyAction> = None;
|
||||
|
||||
let slots: Vec<_> = self
|
||||
.app_state
|
||||
.hotkey_config
|
||||
.slots
|
||||
.iter()
|
||||
.filter(|s| {
|
||||
if search.is_empty() {
|
||||
return true;
|
||||
}
|
||||
s.slot.to_lowercase().contains(&search)
|
||||
|| format!("{:?}", s.action).to_lowercase().contains(&search)
|
||||
|| s.key_chord
|
||||
.as_deref()
|
||||
.unwrap_or("")
|
||||
.to_lowercase()
|
||||
.contains(&search)
|
||||
})
|
||||
.cloned()
|
||||
.collect();
|
||||
|
||||
let available_width = ui.available_width();
|
||||
let col_width = (available_width / 4.0).max(80.0);
|
||||
|
||||
TableBuilder::new(ui)
|
||||
.striped(true)
|
||||
.column(Column::exact(col_width).clip(true)) // Slot
|
||||
.column(Column::exact(col_width).clip(true)) // Sound / Action name
|
||||
.column(Column::exact(col_width).clip(true)) // Key Chord
|
||||
.column(Column::exact(col_width).clip(true)) // Actions
|
||||
.header(30.0, |mut header| {
|
||||
header.col(|ui| {
|
||||
ui.label(
|
||||
RichText::new("Slot")
|
||||
.strong()
|
||||
.monospace()
|
||||
.color(Color32::LIGHT_GRAY),
|
||||
);
|
||||
});
|
||||
header.col(|ui| {
|
||||
ui.label(
|
||||
RichText::new("Sound")
|
||||
.strong()
|
||||
.monospace()
|
||||
.color(Color32::LIGHT_GRAY),
|
||||
);
|
||||
});
|
||||
header.col(|ui| {
|
||||
ui.label(
|
||||
RichText::new("Key Chord")
|
||||
.strong()
|
||||
.monospace()
|
||||
.color(Color32::LIGHT_GRAY),
|
||||
);
|
||||
});
|
||||
header.col(|ui| {
|
||||
ui.label(
|
||||
RichText::new("Actions")
|
||||
.strong()
|
||||
.monospace()
|
||||
.color(Color32::LIGHT_GRAY),
|
||||
);
|
||||
});
|
||||
})
|
||||
.body(|mut body| {
|
||||
if slots.is_empty() {
|
||||
body.row(30.0, |mut row| {
|
||||
row.col(|_| {});
|
||||
row.col(|ui| {
|
||||
ui.label(
|
||||
RichText::new("No hotkey slots configured.")
|
||||
.color(Color32::GRAY),
|
||||
);
|
||||
});
|
||||
row.col(|_| {});
|
||||
row.col(|_| {});
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
for slot in &slots {
|
||||
body.row(30.0, |mut row| {
|
||||
// Column 1: Slot
|
||||
row.col(|ui| {
|
||||
ui.horizontal(|ui| {
|
||||
if conflict_slots.contains(slot.slot.as_str()) {
|
||||
ui.label(
|
||||
RichText::new(ICON_WARNING.codepoint)
|
||||
.color(Color32::from_rgb(255, 165, 0)),
|
||||
)
|
||||
.on_hover_text("Key chord conflict");
|
||||
}
|
||||
ui.add(
|
||||
Label::new(RichText::new(&slot.slot).monospace())
|
||||
.truncate(),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
// Column 2: Sound / Action name
|
||||
row.col(|ui| {
|
||||
let action_name = match slot.action.name.as_str() {
|
||||
"play" => {
|
||||
if let Some(file_path_str) =
|
||||
slot.action.args.get("file_path")
|
||||
{
|
||||
Path::new(file_path_str)
|
||||
.file_name()
|
||||
.unwrap_or_default()
|
||||
.to_string_lossy()
|
||||
.to_string()
|
||||
} else {
|
||||
"Play".to_string()
|
||||
}
|
||||
}
|
||||
"toggle_pause" => "Toggle Pause".to_string(),
|
||||
"pause" => "Pause Playback".to_string(),
|
||||
"resume" => "Resume Playback".to_string(),
|
||||
"stop" => "Stop Playback".to_string(),
|
||||
"toggle_loop" => "Toggle Loop".to_string(),
|
||||
other => other.to_string(),
|
||||
};
|
||||
ui.add(
|
||||
Label::new(RichText::new(action_name).monospace()).truncate(),
|
||||
);
|
||||
});
|
||||
|
||||
// Column 3: Key Chord
|
||||
row.col(|ui| {
|
||||
let chord_text = slot.key_chord.as_deref().unwrap_or("(none)");
|
||||
ui.add(
|
||||
Label::new(RichText::new(chord_text).monospace().color(
|
||||
if slot.key_chord.is_some() {
|
||||
Color32::from_rgb(100, 200, 100)
|
||||
} else {
|
||||
Color32::GRAY
|
||||
},
|
||||
))
|
||||
.truncate(),
|
||||
);
|
||||
});
|
||||
|
||||
// Column 4: Actions
|
||||
row.col(|ui| {
|
||||
ui.horizontal(|ui| {
|
||||
if ui
|
||||
.add(Button::new(ICON_DELETE).frame(false))
|
||||
.on_hover_text("Remove slot")
|
||||
.clicked()
|
||||
{
|
||||
action = Some(HotkeyAction::Remove(slot.slot.clone()));
|
||||
}
|
||||
if ui
|
||||
.add(Button::new(ICON_KEYBOARD).frame(false))
|
||||
.on_hover_text("Set key chord")
|
||||
.clicked()
|
||||
{
|
||||
action = Some(HotkeyAction::Capture(slot.slot.clone()));
|
||||
}
|
||||
if slot.key_chord.is_some()
|
||||
&& ui
|
||||
.add(Button::new(ICON_BACKSPACE).frame(false))
|
||||
.on_hover_text("Clear key chord")
|
||||
.clicked()
|
||||
{
|
||||
action = Some(HotkeyAction::ClearChord(slot.slot.clone()));
|
||||
}
|
||||
if ui
|
||||
.add(Button::new(ICON_PLAY_ARROW).frame(false))
|
||||
.on_hover_text("Play")
|
||||
.clicked()
|
||||
{
|
||||
action = Some(HotkeyAction::Play(slot.slot.clone()));
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
action
|
||||
}
|
||||
|
||||
fn handle_hotkey_action(&mut self, action: HotkeyAction) {
|
||||
match action {
|
||||
HotkeyAction::Remove(slot) => {
|
||||
make_request_async(Request::clear_hotkey(&slot));
|
||||
self.app_state.hotkey_config.remove_slot(&slot);
|
||||
}
|
||||
HotkeyAction::Capture(slot) => {
|
||||
self.app_state.assigning_hotkey_slot = Some(slot);
|
||||
self.app_state.hotkey_capture_active = true;
|
||||
}
|
||||
HotkeyAction::ClearChord(slot) => {
|
||||
make_request_async(Request::clear_hotkey_key(&slot));
|
||||
self.app_state.hotkey_config.set_key_chord(&slot, None);
|
||||
}
|
||||
HotkeyAction::Play(slot) => {
|
||||
self.play_hotkey_slot(&slot);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn draw_header(&mut self, ui: &mut Ui) {
|
||||
ui.vertical_centered_justified(|ui| {
|
||||
if self.audio_player_state.tracks.is_empty() {
|
||||
@@ -409,10 +423,9 @@ impl SoundpadGui {
|
||||
return;
|
||||
}
|
||||
|
||||
let tracks = self.audio_player_state.tracks.clone();
|
||||
let mut action = None;
|
||||
|
||||
for track in tracks {
|
||||
for track in &self.audio_player_state.tracks {
|
||||
CollapsingHeader::new(
|
||||
RichText::new(
|
||||
track
|
||||
@@ -427,7 +440,7 @@ impl SoundpadGui {
|
||||
)
|
||||
.default_open(true)
|
||||
.show(ui, |ui| {
|
||||
if let Some(act) = Self::draw_track_control(ui, &mut self.app_state, &track) {
|
||||
if let Some(act) = Self::draw_track_control(ui, &mut self.app_state, track) {
|
||||
action = Some(act);
|
||||
}
|
||||
});
|
||||
@@ -445,6 +458,99 @@ impl SoundpadGui {
|
||||
});
|
||||
}
|
||||
|
||||
fn draw_playback_controls(ui: &mut Ui, track: &TrackInfo) -> Option<TrackAction> {
|
||||
let mut action = None;
|
||||
|
||||
let play_button = Button::new(if track.paused {
|
||||
ICON_PLAY_ARROW
|
||||
} else {
|
||||
ICON_PAUSE
|
||||
})
|
||||
.corner_radius(15.0);
|
||||
|
||||
if ui.add_sized([30.0, 30.0], play_button).clicked() {
|
||||
action = Some(if track.paused {
|
||||
TrackAction::Resume(track.id)
|
||||
} else {
|
||||
TrackAction::Pause(track.id)
|
||||
});
|
||||
}
|
||||
|
||||
let loop_button = Button::new(
|
||||
RichText::new(if track.looped {
|
||||
ICON_REPEAT_ONE
|
||||
} else {
|
||||
ICON_REPEAT
|
||||
})
|
||||
.size(18.0),
|
||||
)
|
||||
.frame(false);
|
||||
|
||||
if ui.add_sized([15.0, 30.0], loop_button).clicked() {
|
||||
action = Some(TrackAction::ToggleLoop(track.id));
|
||||
}
|
||||
|
||||
action
|
||||
}
|
||||
|
||||
fn draw_position_control(
|
||||
ui: &mut Ui,
|
||||
ui_state: &mut pwsp::types::gui::TrackUiState,
|
||||
track: &TrackInfo,
|
||||
default_slider_width: f32,
|
||||
) {
|
||||
let duration = track.duration.unwrap_or(1.0);
|
||||
let position_slider = Slider::new(&mut ui_state.position_slider_value, 0.0..=duration)
|
||||
.show_value(false)
|
||||
.step_by(0.01);
|
||||
|
||||
let position_slider_width = ui.available_width()
|
||||
- (30.0 * 3.0)
|
||||
- default_slider_width
|
||||
- (ui.spacing().item_spacing.x * 6.0);
|
||||
|
||||
ui.spacing_mut().slider_width = position_slider_width;
|
||||
if ui.add_sized([30.0, 30.0], position_slider).drag_stopped() {
|
||||
ui_state.position_dragged = true;
|
||||
}
|
||||
|
||||
let time_label =
|
||||
Label::new(RichText::new(format_time_pair(track.position, duration)).monospace());
|
||||
ui.add_sized([30.0, 30.0], time_label);
|
||||
}
|
||||
|
||||
fn draw_volume_control(
|
||||
ui: &mut Ui,
|
||||
ui_state: &mut pwsp::types::gui::TrackUiState,
|
||||
track: &TrackInfo,
|
||||
default_slider_width: f32,
|
||||
) {
|
||||
let volume_icon = Self::get_volume_icon(track.volume);
|
||||
let volume_label = Label::new(RichText::new(volume_icon).size(18.0));
|
||||
ui.add_sized([30.0, 30.0], volume_label)
|
||||
.on_hover_text(format!("Volume: {:.0}%", track.volume * 100.0));
|
||||
|
||||
let volume_slider = Slider::new(&mut ui_state.volume_slider_value, 0.0..=1.0)
|
||||
.show_value(false)
|
||||
.step_by(0.01);
|
||||
|
||||
ui.spacing_mut().slider_width = default_slider_width - 30.0;
|
||||
ui.spacing_mut().item_spacing.x = 0.0;
|
||||
|
||||
if ui.add_sized([30.0, 30.0], volume_slider).drag_stopped() {
|
||||
ui_state.volume_dragged = true;
|
||||
}
|
||||
}
|
||||
|
||||
fn draw_stop_control(ui: &mut Ui, track: &TrackInfo) -> Option<TrackAction> {
|
||||
let stop_button = Button::new(ICON_CLOSE).frame(false);
|
||||
if ui.add_sized([30.0, 30.0], stop_button).clicked() {
|
||||
Some(TrackAction::Stop(track.id))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
fn draw_track_control(
|
||||
ui: &mut Ui,
|
||||
app_state: &mut AppState,
|
||||
@@ -475,93 +581,17 @@ impl SoundpadGui {
|
||||
let mut action = None;
|
||||
|
||||
ui.horizontal_top(|ui| {
|
||||
// ---------- Play Button ----------
|
||||
let play_button = Button::new(if track.paused {
|
||||
ICON_PLAY_ARROW
|
||||
} else {
|
||||
ICON_PAUSE
|
||||
})
|
||||
.corner_radius(15.0);
|
||||
|
||||
let play_button_response = ui.add_sized([30.0, 30.0], play_button);
|
||||
if play_button_response.clicked() {
|
||||
if track.paused {
|
||||
action = Some(TrackAction::Resume(track.id));
|
||||
} else {
|
||||
action = Some(TrackAction::Pause(track.id));
|
||||
}
|
||||
if let Some(act) = Self::draw_playback_controls(ui, track) {
|
||||
action = Some(act);
|
||||
}
|
||||
// --------------------------------
|
||||
|
||||
// ---------- Loop Button ----------
|
||||
let loop_button = Button::new(
|
||||
RichText::new(if track.looped {
|
||||
ICON_REPEAT_ONE
|
||||
} else {
|
||||
ICON_REPEAT
|
||||
})
|
||||
.size(18.0),
|
||||
)
|
||||
.frame(false);
|
||||
|
||||
let loop_button_response = ui.add_sized([15.0, 30.0], loop_button);
|
||||
if loop_button_response.clicked() {
|
||||
action = Some(TrackAction::ToggleLoop(track.id));
|
||||
}
|
||||
// --------------------------------
|
||||
|
||||
// ---------- Position Slider ----------
|
||||
let duration = track.duration.unwrap_or(1.0);
|
||||
let position_slider = Slider::new(&mut ui_state.position_slider_value, 0.0..=duration)
|
||||
.show_value(false)
|
||||
.step_by(0.01);
|
||||
|
||||
let default_slider_width = ui.spacing().slider_width;
|
||||
let position_slider_width = ui.available_width()
|
||||
- (30.0 * 3.0)
|
||||
- default_slider_width
|
||||
- (ui.spacing().item_spacing.x * 6.0);
|
||||
ui.spacing_mut().slider_width = position_slider_width;
|
||||
let position_slider_response = ui.add_sized([30.0, 30.0], position_slider);
|
||||
if position_slider_response.drag_stopped() {
|
||||
ui_state.position_dragged = true;
|
||||
Self::draw_position_control(ui, ui_state, track, default_slider_width);
|
||||
Self::draw_volume_control(ui, ui_state, track, default_slider_width);
|
||||
|
||||
if let Some(act) = Self::draw_stop_control(ui, track) {
|
||||
action = Some(act);
|
||||
}
|
||||
// --------------------------------
|
||||
|
||||
// ---------- Time Label ----------
|
||||
let time_label =
|
||||
Label::new(RichText::new(format_time_pair(track.position, duration)).monospace());
|
||||
ui.add_sized([30.0, 30.0], time_label);
|
||||
// --------------------------------
|
||||
|
||||
// ---------- Volume Icon ----------
|
||||
let volume_icon = Self::get_volume_icon(track.volume);
|
||||
let volume_label = Label::new(RichText::new(volume_icon).size(18.0));
|
||||
ui.add_sized([30.0, 30.0], volume_label)
|
||||
.on_hover_text(format!("Volume: {:.0}%", track.volume * 100.0));
|
||||
// --------------------------------
|
||||
|
||||
// ---------- Volume Slider ----------
|
||||
let volume_slider = Slider::new(&mut ui_state.volume_slider_value, 0.0..=1.0)
|
||||
.show_value(false)
|
||||
.step_by(0.01);
|
||||
|
||||
ui.spacing_mut().slider_width = default_slider_width - 30.0;
|
||||
ui.spacing_mut().item_spacing.x = 0.0;
|
||||
|
||||
let volume_slider_response = ui.add_sized([30.0, 30.0], volume_slider);
|
||||
if volume_slider_response.drag_stopped() {
|
||||
ui_state.volume_dragged = true;
|
||||
}
|
||||
// --------------------------------
|
||||
|
||||
// ---------- Stop Button ---------
|
||||
let stop_button = Button::new(ICON_CLOSE).frame(false);
|
||||
let stop_button_response = ui.add_sized([30.0, 30.0], stop_button);
|
||||
if stop_button_response.clicked() {
|
||||
action = Some(TrackAction::Stop(track.id));
|
||||
}
|
||||
// --------------------------------
|
||||
});
|
||||
|
||||
action
|
||||
@@ -836,11 +866,11 @@ impl SoundpadGui {
|
||||
});
|
||||
}
|
||||
|
||||
fn get_hotkey_badge(&self, path: &PathBuf) -> Option<String> {
|
||||
fn get_hotkey_badge(&self, path: &Path) -> Option<String> {
|
||||
for slot in &self.app_state.hotkey_config.slots {
|
||||
if slot.action.name == "play"
|
||||
&& let Some(file_path_str) = slot.action.args.get("file_path")
|
||||
&& Path::new(file_path_str) == path.as_path()
|
||||
&& Path::new(file_path_str) == path
|
||||
{
|
||||
if let Some(chord) = &slot.key_chord {
|
||||
return Some(format!("[{}]", chord));
|
||||
|
||||
+8
-2
@@ -9,7 +9,10 @@ use std::path::PathBuf;
|
||||
fn chord_from_event(modifiers: &Modifiers, key: &Key) -> Option<String> {
|
||||
let key_name = key.name();
|
||||
let is_valid = (key_name.len() == 1
|
||||
&& key_name.chars().next().is_some_and(|c| c.is_ascii_alphanumeric()))
|
||||
&& key_name
|
||||
.chars()
|
||||
.next()
|
||||
.is_some_and(|c| c.is_ascii_alphanumeric()))
|
||||
|| (key_name.starts_with('F')
|
||||
&& key_name.len() > 1
|
||||
&& key_name[1..].chars().all(|c| c.is_ascii_digit()));
|
||||
@@ -60,7 +63,10 @@ pub fn parse_chord(chord: &str) -> Option<(Modifiers, Key)> {
|
||||
|
||||
let key_name = parts[parts.len() - 1];
|
||||
let is_valid = (key_name.len() == 1
|
||||
&& key_name.chars().next().is_some_and(|c| c.is_ascii_alphanumeric()))
|
||||
&& key_name
|
||||
.chars()
|
||||
.next()
|
||||
.is_some_and(|c| c.is_ascii_alphanumeric()))
|
||||
|| (key_name.starts_with('F')
|
||||
&& key_name.len() > 1
|
||||
&& key_name[1..].chars().all(|c| c.is_ascii_digit()));
|
||||
|
||||
+2
-2
@@ -21,7 +21,7 @@ use pwsp::{
|
||||
use rfd::FileDialog;
|
||||
use std::{
|
||||
error::Error,
|
||||
path::PathBuf,
|
||||
path::{Path, PathBuf},
|
||||
sync::{Arc, Mutex},
|
||||
};
|
||||
|
||||
@@ -120,7 +120,7 @@ impl SoundpadGui {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn play_file(&mut self, path: &PathBuf, concurrent: bool) {
|
||||
pub fn play_file(&mut self, path: &Path, concurrent: bool) {
|
||||
make_request_async(Request::play(&path.to_string_lossy(), concurrent));
|
||||
}
|
||||
|
||||
|
||||
+114
-35
@@ -9,11 +9,11 @@ use tokio::{
|
||||
time::{Duration, timeout},
|
||||
};
|
||||
|
||||
pub fn setup_pipewire_context() -> (MainLoopRc, ContextRc) {
|
||||
pub fn setup_pipewire_context() -> Result<(MainLoopRc, ContextRc), String> {
|
||||
pipewire::init();
|
||||
let main_loop = MainLoopRc::new(None).expect("Failed to initialize pipewire main loop");
|
||||
let context = ContextRc::new(&main_loop, None).expect("Failed to create pipewire context");
|
||||
(main_loop, context)
|
||||
let main_loop = MainLoopRc::new(None).map_err(|e| e.to_string())?;
|
||||
let context = ContextRc::new(&main_loop, None).map_err(|e| e.to_string())?;
|
||||
Ok((main_loop, context))
|
||||
}
|
||||
|
||||
fn parse_global_object(
|
||||
@@ -85,8 +85,15 @@ fn parse_global_object(
|
||||
async fn pw_get_global_objects_thread(
|
||||
main_sender: mpsc::Sender<(Option<AudioDevice>, Option<Port>)>,
|
||||
pw_receiver: pipewire::channel::Receiver<Terminate>,
|
||||
init_sender: std::sync::mpsc::SyncSender<Result<(), String>>,
|
||||
) {
|
||||
let (main_loop, context) = setup_pipewire_context();
|
||||
let (main_loop, context) = match setup_pipewire_context() {
|
||||
Ok(res) => res,
|
||||
Err(e) => {
|
||||
let _ = init_sender.send(Err(e));
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
// Stop main loop on Terminate message
|
||||
let _receiver = pw_receiver.attach(main_loop.loop_(), {
|
||||
@@ -94,12 +101,24 @@ async fn pw_get_global_objects_thread(
|
||||
move |_| _main_loop.quit()
|
||||
});
|
||||
|
||||
let core = context
|
||||
.connect(None)
|
||||
.expect("Failed to connect to pipewire context");
|
||||
let registry = core
|
||||
.get_registry()
|
||||
.expect("Failed to get registry from pipewire context");
|
||||
let core = match context.connect(None) {
|
||||
Ok(core) => core,
|
||||
Err(e) => {
|
||||
let _ = init_sender.send(Err(format!("Failed to connect to pipewire context: {}", e)));
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
let registry = match core.get_registry() {
|
||||
Ok(registry) => registry,
|
||||
Err(e) => {
|
||||
let _ = init_sender.send(Err(format!(
|
||||
"Failed to get registry from pipewire context: {}",
|
||||
e
|
||||
)));
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
let _listener = registry
|
||||
.add_listener_local()
|
||||
@@ -115,6 +134,11 @@ async fn pw_get_global_objects_thread(
|
||||
})
|
||||
.register();
|
||||
|
||||
// Signal successful initialization
|
||||
if init_sender.send(Ok(())).is_err() {
|
||||
return;
|
||||
}
|
||||
|
||||
main_loop.run();
|
||||
}
|
||||
|
||||
@@ -122,10 +146,17 @@ pub async fn get_all_devices() -> Result<(Vec<AudioDevice>, Vec<AudioDevice>), B
|
||||
// Channels to communicate with pipewire thread
|
||||
let (main_sender, mut main_receiver) = mpsc::channel(10);
|
||||
let (pw_sender, pw_receiver) = pipewire::channel::channel();
|
||||
let (init_sender, init_receiver) = std::sync::mpsc::sync_channel(0);
|
||||
|
||||
// Spawn pipewire thread in background
|
||||
let _pw_thread =
|
||||
tokio::spawn(async move { pw_get_global_objects_thread(main_sender, pw_receiver).await });
|
||||
let _pw_thread = tokio::spawn(async move {
|
||||
pw_get_global_objects_thread(main_sender, pw_receiver, init_sender).await
|
||||
});
|
||||
|
||||
// Wait for initialization to complete
|
||||
if let Err(e) = init_receiver.recv()? {
|
||||
return Err(e.into());
|
||||
}
|
||||
|
||||
let mut input_devices: HashMap<u32, AudioDevice> = HashMap::new();
|
||||
let mut output_devices: HashMap<u32, AudioDevice> = HashMap::new();
|
||||
@@ -150,9 +181,7 @@ pub async fn get_all_devices() -> Result<(Vec<AudioDevice>, Vec<AudioDevice>), B
|
||||
}
|
||||
Ok(None) | Err(_) => {
|
||||
// Pipewire thread is finished and we can collect our devices
|
||||
pw_sender
|
||||
.send(Terminate {})
|
||||
.expect("Failed to terminate pipewire thread");
|
||||
let _ = pw_sender.send(Terminate {});
|
||||
|
||||
for port in ports {
|
||||
let node_id = port.node_id;
|
||||
@@ -200,8 +229,8 @@ pub async fn get_all_devices() -> Result<(Vec<AudioDevice>, Vec<AudioDevice>), B
|
||||
let mut output_devices: Vec<AudioDevice> =
|
||||
output_devices.values().cloned().collect();
|
||||
|
||||
input_devices.sort_by(|a, b| a.id.cmp(&b.id));
|
||||
output_devices.sort_by(|a, b| a.id.cmp(&b.id));
|
||||
input_devices.sort_by_key(|a| a.id);
|
||||
output_devices.sort_by_key(|a| a.id);
|
||||
|
||||
return Ok((input_devices, output_devices));
|
||||
}
|
||||
@@ -226,12 +255,24 @@ pub async fn get_device(device_name: &str) -> Result<AudioDevice, Box<dyn Error>
|
||||
|
||||
pub fn create_virtual_mic() -> Result<pipewire::channel::Sender<Terminate>, Box<dyn Error>> {
|
||||
let (pw_sender, pw_receiver) = pipewire::channel::channel::<Terminate>();
|
||||
let (init_sender, init_receiver) = std::sync::mpsc::sync_channel(0);
|
||||
|
||||
let _pw_thread = thread::spawn(move || {
|
||||
let (main_loop, context) = setup_pipewire_context();
|
||||
let core = context
|
||||
.connect(None)
|
||||
.expect("Failed to connect to pipewire context");
|
||||
let (main_loop, context) = match setup_pipewire_context() {
|
||||
Ok(res) => res,
|
||||
Err(e) => {
|
||||
let _ = init_sender.send(Err(e));
|
||||
return;
|
||||
}
|
||||
};
|
||||
let core = match context.connect(None) {
|
||||
Ok(core) => core,
|
||||
Err(e) => {
|
||||
let _ =
|
||||
init_sender.send(Err(format!("Failed to connect to pipewire context: {}", e)));
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
let props = properties!(
|
||||
"factory.name" => "support.null-audio-sink",
|
||||
@@ -243,9 +284,13 @@ pub fn create_virtual_mic() -> Result<pipewire::channel::Sender<Terminate>, Box<
|
||||
"object.linger" => "false", // Destroy the node on app exit
|
||||
);
|
||||
|
||||
let _node = core
|
||||
.create_object::<pipewire::node::Node>("adapter", &props)
|
||||
.expect("Failed to create virtual mic");
|
||||
let _node = match core.create_object::<pipewire::node::Node>("adapter", &props) {
|
||||
Ok(node) => node,
|
||||
Err(e) => {
|
||||
let _ = init_sender.send(Err(format!("Failed to create virtual mic: {}", e)));
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
let _receiver = pw_receiver.attach(main_loop.loop_(), {
|
||||
let _main_loop = main_loop.clone();
|
||||
@@ -253,9 +298,16 @@ pub fn create_virtual_mic() -> Result<pipewire::channel::Sender<Terminate>, Box<
|
||||
});
|
||||
|
||||
println!("Virtual mic created");
|
||||
if init_sender.send(Ok(())).is_err() {
|
||||
return;
|
||||
}
|
||||
main_loop.run();
|
||||
});
|
||||
|
||||
if let Err(e) = init_receiver.recv()? {
|
||||
return Err(e.into());
|
||||
}
|
||||
|
||||
Ok(pw_sender)
|
||||
}
|
||||
|
||||
@@ -304,12 +356,24 @@ pub fn create_link(
|
||||
input_fr: Port,
|
||||
) -> Result<pipewire::channel::Sender<Terminate>, Box<dyn Error>> {
|
||||
let (pw_sender, pw_receiver) = pipewire::channel::channel::<Terminate>();
|
||||
let (init_sender, init_receiver) = std::sync::mpsc::sync_channel(0);
|
||||
|
||||
let _pw_thread = thread::spawn(move || {
|
||||
let (main_loop, context) = setup_pipewire_context();
|
||||
let core = context
|
||||
.connect(None)
|
||||
.expect("Failed to connect to pipewire context");
|
||||
let (main_loop, context) = match setup_pipewire_context() {
|
||||
Ok(res) => res,
|
||||
Err(e) => {
|
||||
let _ = init_sender.send(Err(e));
|
||||
return;
|
||||
}
|
||||
};
|
||||
let core = match context.connect(None) {
|
||||
Ok(core) => core,
|
||||
Err(e) => {
|
||||
let _ =
|
||||
init_sender.send(Err(format!("Failed to connect to pipewire context: {}", e)));
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
let props_fl = properties! {
|
||||
"link.output.node" => format!("{}", output_fl.node_id).as_str(),
|
||||
@@ -324,12 +388,20 @@ pub fn create_link(
|
||||
"link.input.port" => format!("{}", input_fr.port_id).as_str(),
|
||||
};
|
||||
|
||||
let _link_fl = core
|
||||
.create_object::<Link>("link-factory", &props_fl)
|
||||
.expect("Failed to create link FL");
|
||||
let _link_fr = core
|
||||
.create_object::<Link>("link-factory", &props_fr)
|
||||
.expect("Failed to create link FR");
|
||||
let _link_fl = match core.create_object::<Link>("link-factory", &props_fl) {
|
||||
Ok(link) => link,
|
||||
Err(e) => {
|
||||
let _ = init_sender.send(Err(format!("Failed to create link FL: {}", e)));
|
||||
return;
|
||||
}
|
||||
};
|
||||
let _link_fr = match core.create_object::<Link>("link-factory", &props_fr) {
|
||||
Ok(link) => link,
|
||||
Err(e) => {
|
||||
let _ = init_sender.send(Err(format!("Failed to create link FR: {}", e)));
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
let _receiver = pw_receiver.attach(main_loop.loop_(), {
|
||||
let _main_loop = main_loop.clone();
|
||||
@@ -340,8 +412,15 @@ pub fn create_link(
|
||||
"Link created: FL: {}-{} FR: {}-{}",
|
||||
output_fl.node_id, input_fl.node_id, output_fr.node_id, input_fr.node_id
|
||||
);
|
||||
if init_sender.send(Ok(())).is_err() {
|
||||
return;
|
||||
}
|
||||
main_loop.run();
|
||||
});
|
||||
|
||||
if let Err(e) = init_receiver.recv()? {
|
||||
return Err(e.into());
|
||||
}
|
||||
|
||||
Ok(pw_sender)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user