mirror of
https://github.com/arabianq/pipewire-soundpad.git
synced 2026-04-28 14:31:23 +00:00
Compare commits
109 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 87bd6db446 | |||
| 1fc6c8829c | |||
| a63e44a4a8 | |||
| 5de29f3d14 | |||
| c4028f1d56 | |||
| e39883e133 | |||
| 7e793f428f | |||
| 238e0b464b | |||
| 59bee29609 | |||
| 12725d0add | |||
| bb83ac54ef | |||
| adfc0f25c4 | |||
| 572aa33c95 | |||
| 3850a9ce10 | |||
| b7dc54c2cb | |||
| 0357c239d5 | |||
| cb1bd42f83 | |||
| 113eb38767 | |||
| ab68648ef6 | |||
| e10b6f1449 | |||
| ede5028d35 | |||
| f721e4612a | |||
| ef9125024c | |||
| 12c70f0edb | |||
| eae455f0b8 | |||
| e0a55dffa6 | |||
| 6a755ad068 | |||
| 7809a8c9ff | |||
| 76a5f069ab | |||
| ae84b345a4 | |||
| cdd58a04ed | |||
| 271955c777 | |||
| 5b475d1f07 | |||
| 5509b80f3e | |||
| 2a31865822 | |||
| 258467d5bc | |||
| 51ab5eacbc | |||
| 1957a5e2fd | |||
| 5f852343da | |||
| aee48c8f8d | |||
| c63b220d92 | |||
| a4708f1812 | |||
| 3754121ab5 | |||
| a665939137 | |||
| 974fdc9411 | |||
| 9a1107fb41 | |||
| ad2c15f9e3 | |||
| 6d66b57d1b | |||
| 869b67738c | |||
| af3e19d794 | |||
| b42498d188 | |||
| 60975110da | |||
| 05f243b322 | |||
| 0188cac476 | |||
| 3e93ba14e1 | |||
| 939dbea12b | |||
| a4d3111c6d | |||
| 9053056dfa | |||
| e9e3f67735 | |||
| 9238e6563b | |||
| 939b01b587 | |||
| 489878c813 | |||
| c1c1bfd487 | |||
| 2028a728e0 | |||
| e627e71cf6 | |||
| dfe7a7e971 | |||
| 0535744b30 | |||
| 3170e9f30a | |||
| 7ddd2c0dab | |||
| 8590dcceae | |||
| fb6714aeee | |||
| 34886e44a6 | |||
| ede04dd3f8 | |||
| ad892dda29 | |||
| 3a02e9991c | |||
| 5d9d20417b | |||
| d1994d7226 | |||
| b526d67d2f | |||
| c641ec4f31 | |||
| 5bce45c97f | |||
| adfdf7db69 | |||
| 7a7e0f741a | |||
| d86cd6c5d3 | |||
| 61ba71d38e | |||
| 7116ccf487 | |||
| 654ef0d973 | |||
| e9756b0681 | |||
| f72fe588e3 | |||
| 53533c35ef | |||
| 382ddb0ff2 | |||
| 714f81ab34 | |||
| 3c028972fe | |||
| 7e3ff23156 | |||
| 09cec44a5b | |||
| ead17d26a9 | |||
| dfa1cfbb15 | |||
| a70c991711 | |||
| 8c0704ce57 | |||
| 00196bfe7f | |||
| 428fb4064d | |||
| e2b003be31 | |||
| 79176432de | |||
| 9e0a307106 | |||
| 428565594d | |||
| 1d0e3036e9 | |||
| b31f4c8c45 | |||
| 84b6f8ce20 | |||
| c797b204a2 | |||
| faa29d8805 |
Generated
+133
-96
@@ -233,16 +233,16 @@ dependencies = [
|
|||||||
"futures-lite",
|
"futures-lite",
|
||||||
"parking",
|
"parking",
|
||||||
"polling",
|
"polling",
|
||||||
"rustix 1.1.3",
|
"rustix 1.1.2",
|
||||||
"slab",
|
"slab",
|
||||||
"windows-sys 0.61.2",
|
"windows-sys 0.61.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "async-lock"
|
name = "async-lock"
|
||||||
version = "3.4.2"
|
version = "3.4.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "290f7f2596bd5b78a9fec8088ccd89180d7f9f55b94b0576823bbbdc72ee8311"
|
checksum = "5fd03604047cee9b6ce9de9f70c6cd540a0520c813cbd49bae61f33ab80ed1dc"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"event-listener",
|
"event-listener",
|
||||||
"event-listener-strategy",
|
"event-listener-strategy",
|
||||||
@@ -275,7 +275,7 @@ dependencies = [
|
|||||||
"cfg-if",
|
"cfg-if",
|
||||||
"event-listener",
|
"event-listener",
|
||||||
"futures-lite",
|
"futures-lite",
|
||||||
"rustix 1.1.3",
|
"rustix 1.1.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -301,7 +301,7 @@ dependencies = [
|
|||||||
"cfg-if",
|
"cfg-if",
|
||||||
"futures-core",
|
"futures-core",
|
||||||
"futures-io",
|
"futures-io",
|
||||||
"rustix 1.1.3",
|
"rustix 1.1.2",
|
||||||
"signal-hook-registry",
|
"signal-hook-registry",
|
||||||
"slab",
|
"slab",
|
||||||
"windows-sys 0.61.2",
|
"windows-sys 0.61.2",
|
||||||
@@ -415,9 +415,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bumpalo"
|
name = "bumpalo"
|
||||||
version = "3.19.1"
|
version = "3.19.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510"
|
checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bytemuck"
|
name = "bytemuck"
|
||||||
@@ -473,7 +473,7 @@ checksum = "cb9f6e1368bd4621d2c86baa7e37de77a938adf5221e5dd3d6133340101b309e"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.10.0",
|
||||||
"polling",
|
"polling",
|
||||||
"rustix 1.1.3",
|
"rustix 1.1.2",
|
||||||
"slab",
|
"slab",
|
||||||
"tracing",
|
"tracing",
|
||||||
]
|
]
|
||||||
@@ -497,16 +497,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "138efcf0940a02ebf0cc8d1eff41a1682a46b431630f4c52450d6265876021fa"
|
checksum = "138efcf0940a02ebf0cc8d1eff41a1682a46b431630f4c52450d6265876021fa"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"calloop 0.14.3",
|
"calloop 0.14.3",
|
||||||
"rustix 1.1.3",
|
"rustix 1.1.2",
|
||||||
"wayland-backend",
|
"wayland-backend",
|
||||||
"wayland-client",
|
"wayland-client",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cc"
|
name = "cc"
|
||||||
version = "1.2.51"
|
version = "1.2.49"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7a0aeaff4ff1a90589618835a598e545176939b97874f7abc7851caa0618f203"
|
checksum = "90583009037521a116abf44494efecd645ba48b6622457080f080b85544e2215"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"find-msvc-tools",
|
"find-msvc-tools",
|
||||||
"jobserver",
|
"jobserver",
|
||||||
@@ -1175,9 +1175,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "find-msvc-tools"
|
name = "find-msvc-tools"
|
||||||
version = "0.1.6"
|
version = "0.1.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "645cbb3a84e60b7531617d5ae4e57f7e27308f6445f5abf653209ea76dec8dff"
|
checksum = "3a3076410a55c90011c298b04d0cfa770b00fa04e1e3c97d3f6c9de105a03844"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "flate2"
|
name = "flate2"
|
||||||
@@ -1231,6 +1231,21 @@ dependencies = [
|
|||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "futures"
|
||||||
|
version = "0.3.31"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876"
|
||||||
|
dependencies = [
|
||||||
|
"futures-channel",
|
||||||
|
"futures-core",
|
||||||
|
"futures-executor",
|
||||||
|
"futures-io",
|
||||||
|
"futures-sink",
|
||||||
|
"futures-task",
|
||||||
|
"futures-util",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "futures-channel"
|
name = "futures-channel"
|
||||||
version = "0.3.31"
|
version = "0.3.31"
|
||||||
@@ -1238,6 +1253,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10"
|
checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"futures-core",
|
"futures-core",
|
||||||
|
"futures-sink",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -1246,6 +1262,18 @@ version = "0.3.31"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e"
|
checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "futures-executor"
|
||||||
|
version = "0.3.31"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f"
|
||||||
|
dependencies = [
|
||||||
|
"futures-core",
|
||||||
|
"futures-task",
|
||||||
|
"futures-util",
|
||||||
|
"num_cpus",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "futures-io"
|
name = "futures-io"
|
||||||
version = "0.3.31"
|
version = "0.3.31"
|
||||||
@@ -1276,6 +1304,12 @@ dependencies = [
|
|||||||
"syn",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "futures-sink"
|
||||||
|
version = "0.3.31"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "futures-task"
|
name = "futures-task"
|
||||||
version = "0.3.31"
|
version = "0.3.31"
|
||||||
@@ -1288,9 +1322,11 @@ version = "0.3.31"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81"
|
checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"futures-channel",
|
||||||
"futures-core",
|
"futures-core",
|
||||||
"futures-io",
|
"futures-io",
|
||||||
"futures-macro",
|
"futures-macro",
|
||||||
|
"futures-sink",
|
||||||
"futures-task",
|
"futures-task",
|
||||||
"memchr",
|
"memchr",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
@@ -1304,7 +1340,7 @@ version = "1.1.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1bd49230192a3797a9a4d6abe9b3eed6f7fa4c8a8a4947977c6f80025f92cbd8"
|
checksum = "1bd49230192a3797a9a4d6abe9b3eed6f7fa4c8a8a4947977c6f80025f92cbd8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"rustix 1.1.3",
|
"rustix 1.1.2",
|
||||||
"windows-link",
|
"windows-link",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -1608,9 +1644,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "itoa"
|
name = "itoa"
|
||||||
version = "1.0.17"
|
version = "1.0.15"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2"
|
checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "jni"
|
name = "jni"
|
||||||
@@ -1690,13 +1726,13 @@ checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libredox"
|
name = "libredox"
|
||||||
version = "0.1.12"
|
version = "0.1.10"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3d0b95e02c851351f877147b7deea7b1afb1df71b63aa5f8270716e0c5720616"
|
checksum = "416f7e718bdb06000964960ffa43b4335ad4012ae8b99060261aa4a8088d5ccb"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.10.0",
|
||||||
"libc",
|
"libc",
|
||||||
"redox_syscall 0.7.0",
|
"redox_syscall 0.5.18",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -1828,9 +1864,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "moxcms"
|
name = "moxcms"
|
||||||
version = "0.7.11"
|
version = "0.7.10"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ac9557c559cd6fc9867e122e20d2cbefc9ca29d80d027a8e39310920ed2f0a97"
|
checksum = "80986bbbcf925ebd3be54c26613d861255284584501595cf418320c078945608"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"num-traits",
|
"num-traits",
|
||||||
"pxfm",
|
"pxfm",
|
||||||
@@ -1980,6 +2016,16 @@ dependencies = [
|
|||||||
"libm",
|
"libm",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "num_cpus"
|
||||||
|
version = "1.17.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b"
|
||||||
|
dependencies = [
|
||||||
|
"hermit-abi",
|
||||||
|
"libc",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "num_enum"
|
name = "num_enum"
|
||||||
version = "0.7.5"
|
version = "0.7.5"
|
||||||
@@ -2486,7 +2532,7 @@ dependencies = [
|
|||||||
"concurrent-queue",
|
"concurrent-queue",
|
||||||
"hermit-abi",
|
"hermit-abi",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
"rustix 1.1.3",
|
"rustix 1.1.2",
|
||||||
"windows-sys 0.61.2",
|
"windows-sys 0.61.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -2498,9 +2544,9 @@ checksum = "2f3a9f18d041e6d0e102a0a46750538147e5e8992d3b4873aaafee2520b00ce3"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "portable-atomic"
|
name = "portable-atomic"
|
||||||
version = "1.13.0"
|
version = "1.11.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f89776e4d69bb58bc6993e99ffa1d11f228b839984854c7daeb5d37f87cbe950"
|
checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "portable-atomic-util"
|
name = "portable-atomic-util"
|
||||||
@@ -2540,9 +2586,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro2"
|
name = "proc-macro2"
|
||||||
version = "1.0.104"
|
version = "1.0.103"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9695f8df41bb4f3d222c95a67532365f569318332d03d5f3f67f37b20e6ebdf0"
|
checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
@@ -2555,7 +2601,7 @@ checksum = "3eb8486b569e12e2c32ad3e204dbaba5e4b5b216e9367044f25f1dba42341773"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pwsp"
|
name = "pwsp"
|
||||||
version = "1.3.0"
|
version = "1.1.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"clap",
|
"clap",
|
||||||
@@ -2563,6 +2609,7 @@ dependencies = [
|
|||||||
"eframe",
|
"eframe",
|
||||||
"egui",
|
"egui",
|
||||||
"egui_material_icons",
|
"egui_material_icons",
|
||||||
|
"futures",
|
||||||
"pipewire",
|
"pipewire",
|
||||||
"rfd",
|
"rfd",
|
||||||
"rodio",
|
"rodio",
|
||||||
@@ -2588,9 +2635,9 @@ checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "quick-xml"
|
name = "quick-xml"
|
||||||
version = "0.38.4"
|
version = "0.37.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b66c2058c55a409d601666cffe35f04333cf1013010882cec174a7467cd4e21c"
|
checksum = "331e97a1af0bf59823e6eadffe373d7b27f485be8748f71471c662c1f269b7fb"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"memchr",
|
"memchr",
|
||||||
]
|
]
|
||||||
@@ -2683,15 +2730,6 @@ dependencies = [
|
|||||||
"bitflags 2.10.0",
|
"bitflags 2.10.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "redox_syscall"
|
|
||||||
version = "0.7.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "49f3fe0889e69e2ae9e41f4d6c4c0181701d00e4697b356fb1f74173a5e0ee27"
|
|
||||||
dependencies = [
|
|
||||||
"bitflags 2.10.0",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "redox_users"
|
name = "redox_users"
|
||||||
version = "0.5.2"
|
version = "0.5.2"
|
||||||
@@ -2801,9 +2839,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustix"
|
name = "rustix"
|
||||||
version = "1.1.3"
|
version = "1.1.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34"
|
checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.10.0",
|
||||||
"errno",
|
"errno",
|
||||||
@@ -2818,6 +2856,12 @@ version = "1.0.22"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
|
checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ryu"
|
||||||
|
version = "1.0.20"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "same-file"
|
name = "same-file"
|
||||||
version = "1.0.6"
|
version = "1.0.6"
|
||||||
@@ -2871,15 +2915,15 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_json"
|
name = "serde_json"
|
||||||
version = "1.0.148"
|
version = "1.0.145"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3084b546a1dd6289475996f182a22aba973866ea8e8b02c51d9f46b1336a22da"
|
checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"itoa",
|
"itoa",
|
||||||
"memchr",
|
"memchr",
|
||||||
|
"ryu",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_core",
|
"serde_core",
|
||||||
"zmij",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -2895,9 +2939,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_spanned"
|
name = "serde_spanned"
|
||||||
version = "1.0.4"
|
version = "1.0.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f8bbf91e5a4d6315eee45e704372590b30e260ee83af6639d64557f51b067776"
|
checksum = "e24345aa0fe688594e73770a5f6d1b216508b4f93484c0026d521acd30134392"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde_core",
|
"serde_core",
|
||||||
]
|
]
|
||||||
@@ -2910,11 +2954,10 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "signal-hook-registry"
|
name = "signal-hook-registry"
|
||||||
version = "1.4.8"
|
version = "1.4.7"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b"
|
checksum = "7664a098b8e616bdfcc2dc0e9ac44eb231eedf41db4e9fe95d8d32ec728dedad"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"errno",
|
|
||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -2983,7 +3026,7 @@ dependencies = [
|
|||||||
"libc",
|
"libc",
|
||||||
"log",
|
"log",
|
||||||
"memmap2",
|
"memmap2",
|
||||||
"rustix 1.1.3",
|
"rustix 1.1.2",
|
||||||
"thiserror 2.0.17",
|
"thiserror 2.0.17",
|
||||||
"wayland-backend",
|
"wayland-backend",
|
||||||
"wayland-client",
|
"wayland-client",
|
||||||
@@ -3242,9 +3285,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "2.0.112"
|
version = "2.0.111"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "21f182278bf2d2bcb3c88b1b08a37df029d71ce3d3ae26168e3c653b213b99d4"
|
checksum = "390cc9a294ab71bdb1aa2e99d13be9c753cd2d7bd6560c77118597410c4d2e87"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@@ -3283,14 +3326,14 @@ checksum = "df7f62577c25e07834649fc3b39fafdc597c0a3527dc1c60129201ccfcbaa50c"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tempfile"
|
name = "tempfile"
|
||||||
version = "3.24.0"
|
version = "3.23.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "655da9c7eb6305c55742045d5a8d2037996d61d8de95806335c7c86ce0f82e9c"
|
checksum = "2d31c77bdf42a745371d260a26ca7163f1e0924b64afa0b688e61b5a9fa02f16"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"fastrand",
|
"fastrand",
|
||||||
"getrandom 0.3.4",
|
"getrandom 0.3.4",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"rustix 1.1.3",
|
"rustix 1.1.2",
|
||||||
"windows-sys 0.61.2",
|
"windows-sys 0.61.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -3388,9 +3431,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "toml"
|
name = "toml"
|
||||||
version = "0.9.10+spec-1.1.0"
|
version = "0.9.8"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0825052159284a1a8b4d6c0c86cbc801f2da5afd2b225fa548c72f2e74002f48"
|
checksum = "f0dc8b1fb61449e27716ec0e1bdf0f6b8f3e8f6b05391e8497b8b6d7804ea6d8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"indexmap",
|
"indexmap",
|
||||||
"serde_core",
|
"serde_core",
|
||||||
@@ -3403,18 +3446,18 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "toml_datetime"
|
name = "toml_datetime"
|
||||||
version = "0.7.5+spec-1.1.0"
|
version = "0.7.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347"
|
checksum = "f2cdb639ebbc97961c51720f858597f7f24c4fc295327923af55b74c3c724533"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde_core",
|
"serde_core",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "toml_edit"
|
name = "toml_edit"
|
||||||
version = "0.23.10+spec-1.0.0"
|
version = "0.23.9"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "84c8b9f757e028cee9fa244aea147aab2a9ec09d5325a9b01e0a49730c2b5269"
|
checksum = "5d7cbc3b4b49633d57a0509303158ca50de80ae32c265093b24c414705807832"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"indexmap",
|
"indexmap",
|
||||||
"toml_datetime",
|
"toml_datetime",
|
||||||
@@ -3424,24 +3467,24 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "toml_parser"
|
name = "toml_parser"
|
||||||
version = "1.0.6+spec-1.1.0"
|
version = "1.0.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a3198b4b0a8e11f09dd03e133c0280504d0801269e9afa46362ffde1cbeebf44"
|
checksum = "c0cbe268d35bdb4bb5a56a2de88d0ad0eb70af5384a99d648cd4b3d04039800e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"winnow",
|
"winnow",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "toml_writer"
|
name = "toml_writer"
|
||||||
version = "1.0.6+spec-1.1.0"
|
version = "1.0.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ab16f14aed21ee8bfd8ec22513f7287cd4a91aa92e44edfe2c17ddd004e92607"
|
checksum = "df8b2b54733674ad286d16267dcfc7a71ed5c776e4ac7aa3c3e2561f7c637bf2"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tracing"
|
name = "tracing"
|
||||||
version = "0.1.44"
|
version = "0.1.43"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100"
|
checksum = "2d15d90a0b5c19378952d479dc858407149d7bb45a14de0142f6c534b16fc647"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"log",
|
"log",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
@@ -3462,9 +3505,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tracing-core"
|
name = "tracing-core"
|
||||||
version = "0.1.36"
|
version = "0.1.35"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a"
|
checksum = "7a04e24fab5c89c6a36eb8558c9656f30d81de51dfa4d3b45f26b21d61fa0a6c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"once_cell",
|
"once_cell",
|
||||||
]
|
]
|
||||||
@@ -3645,13 +3688,13 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wayland-backend"
|
name = "wayland-backend"
|
||||||
version = "0.3.12"
|
version = "0.3.11"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fee64194ccd96bf648f42a65a7e589547096dfa702f7cadef84347b66ad164f9"
|
checksum = "673a33c33048a5ade91a6b139580fa174e19fb0d23f396dca9fa15f2e1e49b35"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cc",
|
"cc",
|
||||||
"downcast-rs",
|
"downcast-rs",
|
||||||
"rustix 1.1.3",
|
"rustix 1.1.2",
|
||||||
"scoped-tls",
|
"scoped-tls",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
"wayland-sys",
|
"wayland-sys",
|
||||||
@@ -3659,12 +3702,12 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wayland-client"
|
name = "wayland-client"
|
||||||
version = "0.31.12"
|
version = "0.31.11"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b8e6faa537fbb6c186cb9f1d41f2f811a4120d1b57ec61f50da451a0c5122bec"
|
checksum = "c66a47e840dc20793f2264eb4b3e4ecb4b75d91c0dd4af04b456128e0bdd449d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.10.0",
|
||||||
"rustix 1.1.3",
|
"rustix 1.1.2",
|
||||||
"wayland-backend",
|
"wayland-backend",
|
||||||
"wayland-scanner",
|
"wayland-scanner",
|
||||||
]
|
]
|
||||||
@@ -3682,20 +3725,20 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wayland-cursor"
|
name = "wayland-cursor"
|
||||||
version = "0.31.12"
|
version = "0.31.11"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5864c4b5b6064b06b1e8b74ead4a98a6c45a285fe7a0e784d24735f011fdb078"
|
checksum = "447ccc440a881271b19e9989f75726d60faa09b95b0200a9b7eb5cc47c3eeb29"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"rustix 1.1.3",
|
"rustix 1.1.2",
|
||||||
"wayland-client",
|
"wayland-client",
|
||||||
"xcursor",
|
"xcursor",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wayland-protocols"
|
name = "wayland-protocols"
|
||||||
version = "0.32.10"
|
version = "0.32.9"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "baeda9ffbcfc8cd6ddaade385eaf2393bd2115a69523c735f12242353c3df4f3"
|
checksum = "efa790ed75fbfd71283bd2521a1cfdc022aabcc28bdcff00851f9e4ae88d9901"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.10.0",
|
||||||
"wayland-backend",
|
"wayland-backend",
|
||||||
@@ -3718,9 +3761,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wayland-protocols-misc"
|
name = "wayland-protocols-misc"
|
||||||
version = "0.3.10"
|
version = "0.3.9"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "791c58fdeec5406aa37169dd815327d1e47f334219b523444bc26d70ceb4c34e"
|
checksum = "2dfe33d551eb8bffd03ff067a8b44bb963919157841a99957151299a6307d19c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.10.0",
|
||||||
"wayland-backend",
|
"wayland-backend",
|
||||||
@@ -3731,9 +3774,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wayland-protocols-plasma"
|
name = "wayland-protocols-plasma"
|
||||||
version = "0.3.10"
|
version = "0.3.9"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "aa98634619300a535a9a97f338aed9a5ff1e01a461943e8346ff4ae26007306b"
|
checksum = "a07a14257c077ab3279987c4f8bb987851bf57081b93710381daea94f2c2c032"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.10.0",
|
||||||
"wayland-backend",
|
"wayland-backend",
|
||||||
@@ -3744,9 +3787,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wayland-protocols-wlr"
|
name = "wayland-protocols-wlr"
|
||||||
version = "0.3.10"
|
version = "0.3.9"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e9597cdf02cf0c34cd5823786dce6b5ae8598f05c2daf5621b6e178d4f7345f3"
|
checksum = "efd94963ed43cf9938a090ca4f7da58eb55325ec8200c3848963e98dc25b78ec"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.10.0",
|
||||||
"wayland-backend",
|
"wayland-backend",
|
||||||
@@ -3757,9 +3800,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wayland-scanner"
|
name = "wayland-scanner"
|
||||||
version = "0.31.8"
|
version = "0.31.7"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5423e94b6a63e68e439803a3e153a9252d5ead12fd853334e2ad33997e3889e3"
|
checksum = "54cb1e9dc49da91950bdfd8b848c49330536d9d1fb03d4bfec8cae50caa50ae3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quick-xml",
|
"quick-xml",
|
||||||
@@ -3768,9 +3811,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wayland-sys"
|
name = "wayland-sys"
|
||||||
version = "0.31.8"
|
version = "0.31.7"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1e6dbfc3ac5ef974c92a2235805cc0114033018ae1290a72e474aa8b28cbbdfd"
|
checksum = "34949b42822155826b41db8e5d0c1be3a2bd296c747577a43a3e6daefc296142"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"dlib",
|
"dlib",
|
||||||
"log",
|
"log",
|
||||||
@@ -4307,7 +4350,7 @@ dependencies = [
|
|||||||
"libc",
|
"libc",
|
||||||
"libloading",
|
"libloading",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"rustix 1.1.3",
|
"rustix 1.1.2",
|
||||||
"x11rb-protocol",
|
"x11rb-protocol",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -4506,12 +4549,6 @@ dependencies = [
|
|||||||
"syn",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "zmij"
|
|
||||||
version = "1.0.7"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "de9211a9f64b825911bdf0240f58b7a8dac217fe260fc61f080a07f61372fbd5"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "zune-core"
|
name = "zune-core"
|
||||||
version = "0.4.12"
|
version = "0.4.12"
|
||||||
|
|||||||
+3
-2
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "pwsp"
|
name = "pwsp"
|
||||||
version = "1.3.0"
|
version = "1.1.4"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
authors = ["arabian"]
|
authors = ["arabian"]
|
||||||
description = "PWSP lets you play audio files through your microphone. Has both CLI and GUI clients."
|
description = "PWSP lets you play audio files through your microphone. Has both CLI and GUI clients."
|
||||||
@@ -13,10 +13,11 @@ keywords = ["soundpad", "pipewire", "linux", "cli", "gui"]
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
tokio = { version = "1.48.0", features = ["full"] }
|
tokio = { version = "1.48.0", features = ["full"] }
|
||||||
|
futures = { version = "0.3.31", features = ["thread-pool"] }
|
||||||
async-trait = "0.1.89"
|
async-trait = "0.1.89"
|
||||||
|
|
||||||
serde = { version = "1.0.228", features = ["derive"] }
|
serde = { version = "1.0.228", features = ["derive"] }
|
||||||
serde_json = "1.0.148"
|
serde_json = "1.0.145"
|
||||||
|
|
||||||
clap = { version = "4.5.53", default-features = false, features = ["std", "suggestions", "help", "usage", "error-context", "derive"] }
|
clap = { version = "4.5.53", default-features = false, features = ["std", "suggestions", "help", "usage", "error-context", "derive"] }
|
||||||
dirs = "6.0.0"
|
dirs = "6.0.0"
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
%global cargo_install_lib 0
|
%global cargo_install_lib 0
|
||||||
|
|
||||||
Name: pwsp
|
Name: pwsp
|
||||||
Version: 1.3.0
|
Version: 1.1.4
|
||||||
Release: %autorelease
|
Release: %autorelease
|
||||||
Summary: Lets you play audio files through your microphone
|
Summary: Lets you play audio files through your microphone
|
||||||
|
|
||||||
|
|||||||
+8
-22
@@ -14,17 +14,17 @@ struct Cli {
|
|||||||
|
|
||||||
#[derive(Subcommand, Debug)]
|
#[derive(Subcommand, Debug)]
|
||||||
enum Commands {
|
enum Commands {
|
||||||
/// Perform an action (ping, pause, resume, toggle-pause, stop, play)
|
/// Perform an action (ping, pause, resume, stop, play)
|
||||||
Action {
|
Action {
|
||||||
#[clap(subcommand)]
|
#[clap(subcommand)]
|
||||||
action: Actions,
|
action: Actions,
|
||||||
},
|
},
|
||||||
/// Get information from the player (is paused, volume, position, duration, state, current-file-path, input, inputs)
|
/// Get information from the player (is paused, volume, position, state)
|
||||||
Get {
|
Get {
|
||||||
#[clap(subcommand)]
|
#[clap(subcommand)]
|
||||||
parameter: GetCommands,
|
parameter: GetCommands,
|
||||||
},
|
},
|
||||||
/// Set information in the player (volume, position, input)
|
/// Set information in the player (volume, position)
|
||||||
Set {
|
Set {
|
||||||
#[clap(subcommand)]
|
#[clap(subcommand)]
|
||||||
parameter: SetCommands,
|
parameter: SetCommands,
|
||||||
@@ -39,14 +39,10 @@ enum Actions {
|
|||||||
Pause,
|
Pause,
|
||||||
/// Resume audio playback
|
/// Resume audio playback
|
||||||
Resume,
|
Resume,
|
||||||
/// Toggle pause
|
|
||||||
TogglePause,
|
|
||||||
/// Stop audio playback and clear the queue
|
/// Stop audio playback and clear the queue
|
||||||
Stop,
|
Stop,
|
||||||
/// Play a file
|
/// Play a file
|
||||||
Play { file_path: PathBuf },
|
Play { file_path: PathBuf },
|
||||||
/// Toggle loop
|
|
||||||
ToggleLoop,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Subcommand, Debug)]
|
#[derive(Subcommand, Debug)]
|
||||||
@@ -55,11 +51,11 @@ enum GetCommands {
|
|||||||
IsPaused,
|
IsPaused,
|
||||||
/// Playback volume
|
/// Playback volume
|
||||||
Volume,
|
Volume,
|
||||||
/// Playback position (in seconds)
|
/// Playback position
|
||||||
Position,
|
Position,
|
||||||
/// Duration of the current file
|
/// Duration of the current file
|
||||||
Duration,
|
Duration,
|
||||||
/// Player state (Playing, Paused or Stopped)
|
/// Player state
|
||||||
State,
|
State,
|
||||||
/// Current playing file path
|
/// Current playing file path
|
||||||
CurrentFilePath,
|
CurrentFilePath,
|
||||||
@@ -67,20 +63,16 @@ enum GetCommands {
|
|||||||
Input,
|
Input,
|
||||||
/// All audio inputs
|
/// All audio inputs
|
||||||
Inputs,
|
Inputs,
|
||||||
/// Is loop enabled (true or false)
|
|
||||||
Loop,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Subcommand, Debug)]
|
#[derive(Subcommand, Debug)]
|
||||||
enum SetCommands {
|
enum SetCommands {
|
||||||
/// Playback volume
|
/// Playback volume
|
||||||
Volume { volume: f32 },
|
Volume { volume: f32 },
|
||||||
/// Playback position (in seconds)
|
/// Playback position
|
||||||
Position { position: f32 },
|
Position { position: f32 },
|
||||||
/// Audio input id (see pwsp-cli get inputs)
|
/// Input
|
||||||
Input { name: String },
|
Input { name: String },
|
||||||
/// Enable or disable loop (true or false)
|
|
||||||
Loop { enabled: String },
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
@@ -94,10 +86,8 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
Actions::Ping => Request::ping(),
|
Actions::Ping => Request::ping(),
|
||||||
Actions::Pause => Request::pause(),
|
Actions::Pause => Request::pause(),
|
||||||
Actions::Resume => Request::resume(),
|
Actions::Resume => Request::resume(),
|
||||||
Actions::TogglePause => Request::toggle_pause(),
|
|
||||||
Actions::Stop => Request::stop(),
|
Actions::Stop => Request::stop(),
|
||||||
Actions::Play { file_path } => Request::play(file_path.to_str().unwrap()),
|
Actions::Play { file_path } => Request::play(file_path.to_str().unwrap()),
|
||||||
Actions::ToggleLoop => Request::toggle_loop(),
|
|
||||||
},
|
},
|
||||||
Commands::Get { parameter } => match parameter {
|
Commands::Get { parameter } => match parameter {
|
||||||
GetCommands::IsPaused => Request::get_is_paused(),
|
GetCommands::IsPaused => Request::get_is_paused(),
|
||||||
@@ -108,19 +98,15 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
GetCommands::CurrentFilePath => Request::get_current_file_path(),
|
GetCommands::CurrentFilePath => Request::get_current_file_path(),
|
||||||
GetCommands::Input => Request::get_input(),
|
GetCommands::Input => Request::get_input(),
|
||||||
GetCommands::Inputs => Request::get_inputs(),
|
GetCommands::Inputs => Request::get_inputs(),
|
||||||
GetCommands::Loop => Request::get_loop(),
|
|
||||||
},
|
},
|
||||||
Commands::Set { parameter } => match parameter {
|
Commands::Set { parameter } => match parameter {
|
||||||
SetCommands::Volume { volume } => Request::set_volume(volume),
|
SetCommands::Volume { volume } => Request::set_volume(volume),
|
||||||
SetCommands::Position { position } => Request::seek(position),
|
SetCommands::Position { position } => Request::seek(position),
|
||||||
SetCommands::Input { name } => Request::set_input(&name),
|
SetCommands::Input { name } => Request::set_input(&name),
|
||||||
SetCommands::Loop { enabled } => Request::set_loop(&enabled),
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
let response = make_request(request)
|
let response = make_request(request).await?;
|
||||||
.await
|
|
||||||
.map_err(|e| e as Box<dyn Error>)?;
|
|
||||||
println!("{} : {}", response.status, response.message);
|
println!("{} : {}", response.status, response.message);
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|||||||
+4
-48
@@ -1,8 +1,5 @@
|
|||||||
use pwsp::{
|
use pwsp::{
|
||||||
types::{
|
types::socket::{Request, Response},
|
||||||
audio_player::PlayerState,
|
|
||||||
socket::{Request, Response},
|
|
||||||
},
|
|
||||||
utils::{
|
utils::{
|
||||||
commands::parse_command,
|
commands::parse_command,
|
||||||
daemon::{
|
daemon::{
|
||||||
@@ -12,11 +9,10 @@ use pwsp::{
|
|||||||
pipewire::create_virtual_mic,
|
pipewire::create_virtual_mic,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use std::{error::Error, fs, time::Duration};
|
use std::{error::Error, fs};
|
||||||
use tokio::{
|
use tokio::{
|
||||||
io::{AsyncReadExt, AsyncWriteExt},
|
io::{AsyncReadExt, AsyncWriteExt},
|
||||||
net::UnixListener,
|
net::UnixListener,
|
||||||
time::sleep,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
@@ -48,27 +44,6 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
socket_path.to_str().unwrap_or_default()
|
socket_path.to_str().unwrap_or_default()
|
||||||
);
|
);
|
||||||
|
|
||||||
let commands_loop_handle = tokio::spawn(async {
|
|
||||||
commands_loop(listener).await.ok();
|
|
||||||
});
|
|
||||||
|
|
||||||
let player_loop_handle = tokio::spawn(async {
|
|
||||||
player_loop().await;
|
|
||||||
});
|
|
||||||
|
|
||||||
tokio::select! {
|
|
||||||
_ = commands_loop_handle => {
|
|
||||||
eprint!("Commands loop was finished, stopping program...");
|
|
||||||
}
|
|
||||||
_ = player_loop_handle => {
|
|
||||||
eprint!("Audio Player loop was finished, stopping program...");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn commands_loop(listener: UnixListener) -> Result<(), Box<dyn Error>> {
|
|
||||||
loop {
|
loop {
|
||||||
let (mut stream, _addr) = listener.accept().await?;
|
let (mut stream, _addr) = listener.accept().await?;
|
||||||
|
|
||||||
@@ -89,6 +64,7 @@ async fn commands_loop(listener: UnixListener) -> Result<(), Box<dyn Error>> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let request: Request = serde_json::from_slice(&buffer).unwrap();
|
let request: Request = serde_json::from_slice(&buffer).unwrap();
|
||||||
|
println!("Received request: {:?}", request);
|
||||||
// ---------- Read request (end) ----------
|
// ---------- Read request (end) ----------
|
||||||
|
|
||||||
// ---------- Generate response (start) ----------
|
// ---------- Generate response (start) ----------
|
||||||
@@ -113,28 +89,8 @@ async fn commands_loop(listener: UnixListener) -> Result<(), Box<dyn Error>> {
|
|||||||
eprintln!("Failed to write response to client!");
|
eprintln!("Failed to write response to client!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
println!("Sent response: {:?}", response);
|
||||||
// ---------- Send response (end) ----------
|
// ---------- Send response (end) ----------
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn player_loop() {
|
|
||||||
loop {
|
|
||||||
let mut audio_player = get_audio_player().await.lock().await;
|
|
||||||
|
|
||||||
// Start playback again if loop is enabled
|
|
||||||
let should_play = audio_player.get_state() == PlayerState::Stopped
|
|
||||||
&& audio_player.current_file_path.is_some()
|
|
||||||
&& audio_player.looped;
|
|
||||||
|
|
||||||
if should_play {
|
|
||||||
let file_path = audio_player.current_file_path.clone().unwrap();
|
|
||||||
audio_player
|
|
||||||
.play(&file_path)
|
|
||||||
.await
|
|
||||||
.expect("Something went wrong while trying to play the file");
|
|
||||||
}
|
|
||||||
|
|
||||||
sleep(Duration::from_millis(100)).await;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
+14
-41
@@ -1,7 +1,7 @@
|
|||||||
use crate::gui::{SUPPORTED_EXTENSIONS, SoundpadGui};
|
use crate::gui::SoundpadGui;
|
||||||
use egui::{
|
use egui::{
|
||||||
Align, AtomExt, Button, Color32, ComboBox, FontFamily, Label, Layout, RichText, ScrollArea,
|
AtomExt, Button, Color32, ComboBox, FontFamily, Label, RichText, ScrollArea, Slider, TextEdit,
|
||||||
Slider, TextEdit, Ui, Vec2,
|
Ui, Vec2,
|
||||||
};
|
};
|
||||||
use egui_material_icons::icons;
|
use egui_material_icons::icons;
|
||||||
use pwsp::types::audio_player::PlayerState;
|
use pwsp::types::audio_player::PlayerState;
|
||||||
@@ -48,15 +48,10 @@ impl SoundpadGui {
|
|||||||
&mut self.config.save_scale_factor,
|
&mut self.config.save_scale_factor,
|
||||||
"Always remember UI scale factor",
|
"Always remember UI scale factor",
|
||||||
);
|
);
|
||||||
let pause_on_exit_response = ui.checkbox(
|
|
||||||
&mut self.config.pause_on_exit,
|
|
||||||
"Pause audio playback when the window is closed",
|
|
||||||
);
|
|
||||||
|
|
||||||
if save_volume_response.changed()
|
if save_volume_response.changed()
|
||||||
|| save_input_response.changed()
|
|| save_input_response.changed()
|
||||||
|| save_scale_response.changed()
|
|| save_scale_response.changed()
|
||||||
|| pause_on_exit_response.changed()
|
|
||||||
{
|
{
|
||||||
self.config.save_to_file().ok();
|
self.config.save_to_file().ok();
|
||||||
}
|
}
|
||||||
@@ -108,29 +103,13 @@ impl SoundpadGui {
|
|||||||
}
|
}
|
||||||
// --------------------------------
|
// --------------------------------
|
||||||
|
|
||||||
// ---------- Loop Button ----------
|
|
||||||
let loop_button = Button::new(
|
|
||||||
RichText::new(match self.audio_player_state.looped {
|
|
||||||
true => icons::ICON_REPEAT_ONE,
|
|
||||||
false => icons::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() {
|
|
||||||
self.toggle_loop();
|
|
||||||
}
|
|
||||||
// --------------------------------
|
|
||||||
|
|
||||||
// ---------- Position Slider ----------
|
// ---------- Position Slider ----------
|
||||||
let position_slider = Slider::new(
|
let position_slider = Slider::new(
|
||||||
&mut self.app_state.position_slider_value,
|
&mut self.app_state.position_slider_value,
|
||||||
0.0..=self.audio_player_state.duration,
|
0.0..=self.audio_player_state.duration,
|
||||||
)
|
)
|
||||||
.show_value(false)
|
.show_value(false)
|
||||||
.step_by(0.01);
|
.step_by(1.0);
|
||||||
|
|
||||||
let default_slider_width = ui.spacing().slider_width;
|
let default_slider_width = ui.spacing().slider_width;
|
||||||
let position_slider_width = ui.available_width()
|
let position_slider_width = ui.available_width()
|
||||||
@@ -166,7 +145,7 @@ impl SoundpadGui {
|
|||||||
icons::ICON_VOLUME_DOWN
|
icons::ICON_VOLUME_DOWN
|
||||||
};
|
};
|
||||||
let volume_icon = Label::new(RichText::new(volume_icon).size(18.0));
|
let volume_icon = Label::new(RichText::new(volume_icon).size(18.0));
|
||||||
ui.add_sized([30.0, 30.0], volume_icon);
|
ui.add_sized([30.0, 25.0], volume_icon);
|
||||||
// --------------------------------
|
// --------------------------------
|
||||||
|
|
||||||
// ---------- Volume Slider ----------
|
// ---------- Volume Slider ----------
|
||||||
@@ -203,8 +182,6 @@ impl SoundpadGui {
|
|||||||
ui.set_min_height(area_size.y);
|
ui.set_min_height(area_size.y);
|
||||||
|
|
||||||
ScrollArea::vertical().id_salt(0).show(ui, |ui| {
|
ScrollArea::vertical().id_salt(0).show(ui, |ui| {
|
||||||
ui.set_min_width(area_size.x);
|
|
||||||
|
|
||||||
let mut dirs: Vec<PathBuf> = self.app_state.dirs.iter().cloned().collect();
|
let mut dirs: Vec<PathBuf> = self.app_state.dirs.iter().cloned().collect();
|
||||||
dirs.sort();
|
dirs.sort();
|
||||||
for path in dirs.iter() {
|
for path in dirs.iter() {
|
||||||
@@ -239,18 +216,10 @@ impl SoundpadGui {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ui.horizontal(|ui| {
|
ui.horizontal(|ui| {
|
||||||
let add_dirs_button = Button::new(icons::ICON_ADD).frame(false);
|
let add_dir_button = egui::Button::new(icons::ICON_ADD).frame(false);
|
||||||
let add_dirs_button_response = ui.add_sized([18.0, 18.0], add_dirs_button);
|
let add_dir_button_response = ui.add_sized([18.0, 18.0], add_dir_button);
|
||||||
if add_dirs_button_response.clicked() {
|
if add_dir_button_response.clicked() {
|
||||||
self.add_dirs();
|
self.add_dir();
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
ui.with_layout(Layout::bottom_up(Align::Min), |ui| {
|
|
||||||
let play_file_button = Button::new("Play file");
|
|
||||||
let play_file_button_response = ui.add(play_file_button);
|
|
||||||
if play_file_button_response.clicked() {
|
|
||||||
self.open_file();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -258,6 +227,10 @@ impl SoundpadGui {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn draw_files(&mut self, ui: &mut Ui, area_size: Vec2) {
|
fn draw_files(&mut self, ui: &mut Ui, area_size: Vec2) {
|
||||||
|
let extensions = [
|
||||||
|
"mp3", "wav", "ogg", "flac", "mp4", "m4a", "aac", "mov", "mkv", "webm", "avi",
|
||||||
|
];
|
||||||
|
|
||||||
ui.vertical(|ui| {
|
ui.vertical(|ui| {
|
||||||
ui.horizontal(|ui| {
|
ui.horizontal(|ui| {
|
||||||
let search_field = ui.add_sized(
|
let search_field = ui.add_sized(
|
||||||
@@ -283,7 +256,7 @@ impl SoundpadGui {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if !SUPPORTED_EXTENSIONS
|
if !extensions
|
||||||
.contains(&entry_path.extension().unwrap_or_default().to_str().unwrap())
|
.contains(&entry_path.extension().unwrap_or_default().to_str().unwrap())
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
+15
-43
@@ -23,10 +23,6 @@ use std::{
|
|||||||
sync::{Arc, Mutex},
|
sync::{Arc, Mutex},
|
||||||
};
|
};
|
||||||
|
|
||||||
const SUPPORTED_EXTENSIONS: [&str; 11] = [
|
|
||||||
"mp3", "wav", "ogg", "flac", "mp4", "m4a", "aac", "mov", "mkv", "webm", "avi",
|
|
||||||
];
|
|
||||||
|
|
||||||
struct SoundpadGui {
|
struct SoundpadGui {
|
||||||
pub app_state: AppState,
|
pub app_state: AppState,
|
||||||
pub config: GuiConfig,
|
pub config: GuiConfig,
|
||||||
@@ -56,39 +52,26 @@ impl SoundpadGui {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn play_toggle(&mut self) {
|
pub fn play_toggle(&mut self) {
|
||||||
let (new_state, request) = {
|
|
||||||
let guard = self.audio_player_state_shared.lock().unwrap();
|
|
||||||
match guard.state {
|
|
||||||
PlayerState::Playing => (Some(PlayerState::Paused), Some(Request::pause())),
|
|
||||||
PlayerState::Paused => (Some(PlayerState::Playing), Some(Request::resume())),
|
|
||||||
PlayerState::Stopped => (None, None),
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
if let Some(req) = request {
|
|
||||||
make_request_sync(req).ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
if let Some(state) = new_state {
|
|
||||||
let mut guard = self.audio_player_state_shared.lock().unwrap();
|
let mut guard = self.audio_player_state_shared.lock().unwrap();
|
||||||
guard.new_state = Some(state.clone());
|
guard.state = match guard.state {
|
||||||
guard.state = state;
|
PlayerState::Playing => {
|
||||||
|
make_request_sync(Request::pause()).ok();
|
||||||
|
guard.new_state = Some(PlayerState::Paused);
|
||||||
|
PlayerState::Paused
|
||||||
}
|
}
|
||||||
|
PlayerState::Paused => {
|
||||||
|
make_request_sync(Request::resume()).ok();
|
||||||
|
guard.new_state = Some(PlayerState::Playing);
|
||||||
|
PlayerState::Playing
|
||||||
|
}
|
||||||
|
PlayerState::Stopped => PlayerState::Stopped,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn open_file(&mut self) {
|
pub fn add_dir(&mut self) {
|
||||||
let file_dialog = FileDialog::new().add_filter("Audio File", &SUPPORTED_EXTENSIONS);
|
|
||||||
if let Some(path) = file_dialog.pick_file() {
|
|
||||||
self.play_file(&path);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn add_dirs(&mut self) {
|
|
||||||
let file_dialog = FileDialog::new();
|
let file_dialog = FileDialog::new();
|
||||||
if let Some(paths) = file_dialog.pick_folders() {
|
if let Some(path) = file_dialog.pick_folder() {
|
||||||
for path in paths {
|
|
||||||
self.app_state.dirs.insert(path);
|
self.app_state.dirs.insert(path);
|
||||||
}
|
|
||||||
self.config.dirs = self.app_state.dirs.clone();
|
self.config.dirs = self.app_state.dirs.clone();
|
||||||
self.config.save_to_file().ok();
|
self.config.save_to_file().ok();
|
||||||
}
|
}
|
||||||
@@ -100,7 +83,6 @@ impl SoundpadGui {
|
|||||||
&& current_dir == path
|
&& current_dir == path
|
||||||
{
|
{
|
||||||
self.app_state.current_dir = None;
|
self.app_state.current_dir = None;
|
||||||
self.app_state.files.clear();
|
|
||||||
}
|
}
|
||||||
self.config.dirs = self.app_state.dirs.clone();
|
self.config.dirs = self.app_state.dirs.clone();
|
||||||
self.config.save_to_file().ok();
|
self.config.save_to_file().ok();
|
||||||
@@ -129,10 +111,6 @@ impl SoundpadGui {
|
|||||||
daemon_config.save_to_file().ok();
|
daemon_config.save_to_file().ok();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn toggle_loop(&mut self) {
|
|
||||||
make_request_sync(Request::toggle_loop()).ok();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn run() -> Result<(), Box<dyn Error>> {
|
pub async fn run() -> Result<(), Box<dyn Error>> {
|
||||||
@@ -160,13 +138,7 @@ pub async fn run() -> Result<(), Box<dyn Error>> {
|
|||||||
Ok(Box::new(SoundpadGui::new(&cc.egui_ctx)))
|
Ok(Box::new(SoundpadGui::new(&cc.egui_ctx)))
|
||||||
}),
|
}),
|
||||||
) {
|
) {
|
||||||
Ok(_) => {
|
Ok(_) => Ok(()),
|
||||||
let config = get_gui_config();
|
|
||||||
if config.pause_on_exit {
|
|
||||||
make_request_sync(Request::pause()).ok();
|
|
||||||
}
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
Err(e) => Err(e.into()),
|
Err(e) => Err(e.into()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,8 +33,6 @@ pub struct AudioPlayer {
|
|||||||
pub duration: Option<f32>,
|
pub duration: Option<f32>,
|
||||||
|
|
||||||
pub current_file_path: Option<PathBuf>,
|
pub current_file_path: Option<PathBuf>,
|
||||||
|
|
||||||
pub looped: bool,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl AudioPlayer {
|
impl AudioPlayer {
|
||||||
@@ -64,8 +62,6 @@ impl AudioPlayer {
|
|||||||
duration: None,
|
duration: None,
|
||||||
|
|
||||||
current_file_path: None,
|
current_file_path: None,
|
||||||
|
|
||||||
looped: false,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if default_input_device.is_some() {
|
if default_input_device.is_some() {
|
||||||
@@ -151,7 +147,7 @@ impl AudioPlayer {
|
|||||||
self.sink.is_paused()
|
self.sink.is_paused()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_state(&self) -> PlayerState {
|
pub fn get_state(&mut self) -> PlayerState {
|
||||||
if self.sink.len() == 0 {
|
if self.sink.len() == 0 {
|
||||||
return PlayerState::Stopped;
|
return PlayerState::Stopped;
|
||||||
}
|
}
|
||||||
@@ -168,7 +164,7 @@ impl AudioPlayer {
|
|||||||
self.sink.set_volume(volume);
|
self.sink.set_volume(volume);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_position(&self) -> f32 {
|
pub fn get_position(&mut self) -> f32 {
|
||||||
if self.get_state() == PlayerState::Stopped {
|
if self.get_state() == PlayerState::Stopped {
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
@@ -226,7 +222,7 @@ impl AudioPlayer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_current_file_path(&mut self) -> &Option<PathBuf> {
|
pub fn get_current_file_path(&mut self) -> &Option<PathBuf> {
|
||||||
if self.get_state() == PlayerState::Stopped && !self.looped {
|
if self.get_state() == PlayerState::Stopped {
|
||||||
self.current_file_path = None;
|
self.current_file_path = None;
|
||||||
}
|
}
|
||||||
&self.current_file_path
|
&self.current_file_path
|
||||||
|
|||||||
+3
-64
@@ -1,5 +1,5 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
types::{audio_player::PlayerState, socket::Response},
|
types::socket::Response,
|
||||||
utils::{daemon::get_audio_player, pipewire::get_all_devices},
|
utils::{daemon::get_audio_player, pipewire::get_all_devices},
|
||||||
};
|
};
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
@@ -16,8 +16,6 @@ pub struct PauseCommand {}
|
|||||||
|
|
||||||
pub struct ResumeCommand {}
|
pub struct ResumeCommand {}
|
||||||
|
|
||||||
pub struct TogglePauseCommand {}
|
|
||||||
|
|
||||||
pub struct StopCommand {}
|
pub struct StopCommand {}
|
||||||
|
|
||||||
pub struct IsPausedCommand {}
|
pub struct IsPausedCommand {}
|
||||||
@@ -52,14 +50,6 @@ pub struct SetCurrentInputCommand {
|
|||||||
pub name: Option<String>,
|
pub name: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct GetLoopCommand {}
|
|
||||||
|
|
||||||
pub struct SetLoopCommand {
|
|
||||||
pub enabled: Option<bool>,
|
|
||||||
}
|
|
||||||
|
|
||||||
pub struct ToggleLoopCommand {}
|
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl Executable for PingCommand {
|
impl Executable for PingCommand {
|
||||||
async fn execute(&self) -> Response {
|
async fn execute(&self) -> Response {
|
||||||
@@ -85,25 +75,6 @@ impl Executable for ResumeCommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[async_trait]
|
|
||||||
impl Executable for TogglePauseCommand {
|
|
||||||
async fn execute(&self) -> Response {
|
|
||||||
let mut audio_player = get_audio_player().await.lock().await;
|
|
||||||
|
|
||||||
if audio_player.get_state() == PlayerState::Stopped {
|
|
||||||
return Response::new(false, "Audio is not playing");
|
|
||||||
}
|
|
||||||
|
|
||||||
if audio_player.is_paused() {
|
|
||||||
audio_player.resume();
|
|
||||||
Response::new(true, "Audio was resumed")
|
|
||||||
} else {
|
|
||||||
audio_player.pause();
|
|
||||||
Response::new(true, "Audio was paused")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl Executable for StopCommand {
|
impl Executable for StopCommand {
|
||||||
async fn execute(&self) -> Response {
|
async fn execute(&self) -> Response {
|
||||||
@@ -125,7 +96,7 @@ impl Executable for IsPausedCommand {
|
|||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl Executable for GetStateCommand {
|
impl Executable for GetStateCommand {
|
||||||
async fn execute(&self) -> Response {
|
async fn execute(&self) -> Response {
|
||||||
let audio_player = get_audio_player().await.lock().await;
|
let mut audio_player = get_audio_player().await.lock().await;
|
||||||
let state = audio_player.get_state();
|
let state = audio_player.get_state();
|
||||||
Response::new(true, serde_json::to_string(&state).unwrap())
|
Response::new(true, serde_json::to_string(&state).unwrap())
|
||||||
}
|
}
|
||||||
@@ -156,7 +127,7 @@ impl Executable for SetVolumeCommand {
|
|||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl Executable for GetPositionCommand {
|
impl Executable for GetPositionCommand {
|
||||||
async fn execute(&self) -> Response {
|
async fn execute(&self) -> Response {
|
||||||
let audio_player = get_audio_player().await.lock().await;
|
let mut audio_player = get_audio_player().await.lock().await;
|
||||||
let position = audio_player.get_position();
|
let position = audio_player.get_position();
|
||||||
Response::new(true, position.to_string())
|
Response::new(true, position.to_string())
|
||||||
}
|
}
|
||||||
@@ -264,35 +235,3 @@ impl Executable for SetCurrentInputCommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[async_trait]
|
|
||||||
impl Executable for GetLoopCommand {
|
|
||||||
async fn execute(&self) -> Response {
|
|
||||||
let audio_player = get_audio_player().await.lock().await;
|
|
||||||
Response::new(true, audio_player.looped.to_string())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[async_trait]
|
|
||||||
impl Executable for SetLoopCommand {
|
|
||||||
async fn execute(&self) -> Response {
|
|
||||||
let mut audio_player = get_audio_player().await.lock().await;
|
|
||||||
|
|
||||||
match self.enabled {
|
|
||||||
Some(enabled) => {
|
|
||||||
audio_player.looped = enabled;
|
|
||||||
Response::new(true, format!("Loop was set to {}", enabled))
|
|
||||||
}
|
|
||||||
None => Response::new(false, "Invalid enabled value"),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[async_trait]
|
|
||||||
impl Executable for ToggleLoopCommand {
|
|
||||||
async fn execute(&self) -> Response {
|
|
||||||
let mut audio_player = get_audio_player().await.lock().await;
|
|
||||||
audio_player.looped = !audio_player.looped;
|
|
||||||
Response::new(true, format!("Loop was set to {}", audio_player.looped))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ pub struct GuiConfig {
|
|||||||
pub save_volume: bool,
|
pub save_volume: bool,
|
||||||
pub save_input: bool,
|
pub save_input: bool,
|
||||||
pub save_scale_factor: bool,
|
pub save_scale_factor: bool,
|
||||||
pub pause_on_exit: bool,
|
|
||||||
|
|
||||||
pub dirs: HashSet<PathBuf>,
|
pub dirs: HashSet<PathBuf>,
|
||||||
}
|
}
|
||||||
@@ -49,7 +48,6 @@ impl Default for GuiConfig {
|
|||||||
save_volume: false,
|
save_volume: false,
|
||||||
save_input: false,
|
save_input: false,
|
||||||
save_scale_factor: false,
|
save_scale_factor: false,
|
||||||
pause_on_exit: false,
|
|
||||||
|
|
||||||
dirs: HashSet::default(),
|
dirs: HashSet::default(),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ pub struct AudioPlayerState {
|
|||||||
pub current_file_path: PathBuf,
|
pub current_file_path: PathBuf,
|
||||||
|
|
||||||
pub is_paused: bool,
|
pub is_paused: bool,
|
||||||
pub looped: bool,
|
|
||||||
|
|
||||||
pub volume: f32,
|
pub volume: f32,
|
||||||
pub new_volume: Option<f32>,
|
pub new_volume: Option<f32>,
|
||||||
|
|||||||
@@ -32,10 +32,6 @@ impl Request {
|
|||||||
Request::new("resume", vec![])
|
Request::new("resume", vec![])
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn toggle_pause() -> Self {
|
|
||||||
Request::new("toggle_pause", vec![])
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn stop() -> Self {
|
pub fn stop() -> Self {
|
||||||
Request::new("stop", vec![])
|
Request::new("stop", vec![])
|
||||||
}
|
}
|
||||||
@@ -87,18 +83,6 @@ impl Request {
|
|||||||
pub fn set_input(name: &str) -> Self {
|
pub fn set_input(name: &str) -> Self {
|
||||||
Request::new("set_input", vec![("input_name", name)])
|
Request::new("set_input", vec![("input_name", name)])
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_loop() -> Self {
|
|
||||||
Request::new("get_loop", vec![])
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn set_loop(enabled: &str) -> Self {
|
|
||||||
Request::new("set_loop", vec![("enabled", enabled)])
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn toggle_loop() -> Self {
|
|
||||||
Request::new("toggle_loop", vec![])
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default, Debug, Clone, Serialize, Deserialize)]
|
#[derive(Default, Debug, Clone, Serialize, Deserialize)]
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ pub fn parse_command(request: &Request) -> Option<Box<dyn Executable + Send>> {
|
|||||||
"ping" => Some(Box::new(PingCommand {})),
|
"ping" => Some(Box::new(PingCommand {})),
|
||||||
"pause" => Some(Box::new(PauseCommand {})),
|
"pause" => Some(Box::new(PauseCommand {})),
|
||||||
"resume" => Some(Box::new(ResumeCommand {})),
|
"resume" => Some(Box::new(ResumeCommand {})),
|
||||||
"toggle_pause" => Some(Box::new(TogglePauseCommand {})),
|
|
||||||
"stop" => Some(Box::new(StopCommand {})),
|
"stop" => Some(Box::new(StopCommand {})),
|
||||||
"is_paused" => Some(Box::new(IsPausedCommand {})),
|
"is_paused" => Some(Box::new(IsPausedCommand {})),
|
||||||
"get_state" => Some(Box::new(GetStateCommand {})),
|
"get_state" => Some(Box::new(GetStateCommand {})),
|
||||||
@@ -48,17 +47,6 @@ pub fn parse_command(request: &Request) -> Option<Box<dyn Executable + Send>> {
|
|||||||
let name = Some(request.args.get("input_name").unwrap_or(&String::new())).cloned();
|
let name = Some(request.args.get("input_name").unwrap_or(&String::new())).cloned();
|
||||||
Some(Box::new(SetCurrentInputCommand { name }))
|
Some(Box::new(SetCurrentInputCommand { name }))
|
||||||
}
|
}
|
||||||
"get_loop" => Some(Box::new(GetLoopCommand {})),
|
|
||||||
"set_loop" => {
|
|
||||||
let enabled = request
|
|
||||||
.args
|
|
||||||
.get("enabled")
|
|
||||||
.unwrap_or(&String::new())
|
|
||||||
.parse::<bool>()
|
|
||||||
.ok();
|
|
||||||
Some(Box::new(SetLoopCommand { enabled }))
|
|
||||||
}
|
|
||||||
"toggle_loop" => Some(Box::new(ToggleLoopCommand {})),
|
|
||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -124,7 +124,7 @@ pub async fn wait_for_daemon() -> Result<(), Box<dyn Error>> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn make_request(request: Request) -> Result<Response, Box<dyn Error + Send + Sync>> {
|
pub async fn make_request(request: Request) -> Result<Response, Box<dyn Error>> {
|
||||||
let socket_path = get_runtime_dir().join("daemon.sock");
|
let socket_path = get_runtime_dir().join("daemon.sock");
|
||||||
let mut stream = UnixStream::connect(socket_path).await?;
|
let mut stream = UnixStream::connect(socket_path).await?;
|
||||||
|
|
||||||
|
|||||||
+10
-43
@@ -24,11 +24,7 @@ pub fn get_gui_config() -> GuiConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn make_request_sync(request: Request) -> Result<Response, Box<dyn Error>> {
|
pub fn make_request_sync(request: Request) -> Result<Response, Box<dyn Error>> {
|
||||||
tokio::task::block_in_place(|| {
|
futures::executor::block_on(make_request(request))
|
||||||
tokio::runtime::Handle::current()
|
|
||||||
.block_on(make_request(request))
|
|
||||||
.map_err(|e| e as Box<dyn Error>)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn format_time_pair(position: f32, duration: f32) -> String {
|
pub fn format_time_pair(position: f32, duration: f32) -> String {
|
||||||
@@ -44,7 +40,7 @@ pub fn format_time_pair(position: f32, duration: f32) -> String {
|
|||||||
|
|
||||||
pub fn start_app_state_thread(audio_player_state_shared: Arc<Mutex<AudioPlayerState>>) {
|
pub fn start_app_state_thread(audio_player_state_shared: Arc<Mutex<AudioPlayerState>>) {
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
let sleep_duration = Duration::from_secs_f32(1.0 / 60.0);
|
let sleep_duration = Duration::from_millis(100);
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
wait_for_daemon().await.ok();
|
wait_for_daemon().await.ok();
|
||||||
@@ -57,39 +53,15 @@ pub fn start_app_state_thread(audio_player_state_shared: Arc<Mutex<AudioPlayerSt
|
|||||||
let duration_req = Request::get_duration();
|
let duration_req = Request::get_duration();
|
||||||
let current_input_req = Request::get_input();
|
let current_input_req = Request::get_input();
|
||||||
let all_inputs_req = Request::get_inputs();
|
let all_inputs_req = Request::get_inputs();
|
||||||
let looped_req = Request::get_loop();
|
|
||||||
|
|
||||||
let (
|
let state_res = make_request(state_req).await.unwrap_or_default();
|
||||||
state_res,
|
let file_path_res = make_request(file_path_req).await.unwrap_or_default();
|
||||||
file_path_res,
|
let is_paused_res = make_request(is_paused_req).await.unwrap_or_default();
|
||||||
is_paused_res,
|
let volume_res = make_request(volume_req).await.unwrap_or_default();
|
||||||
volume_res,
|
let position_res = make_request(position_req).await.unwrap_or_default();
|
||||||
position_res,
|
let duration_res = make_request(duration_req).await.unwrap_or_default();
|
||||||
duration_res,
|
let current_input_res = make_request(current_input_req).await.unwrap_or_default();
|
||||||
current_input_res,
|
let all_inputs_res = make_request(all_inputs_req).await.unwrap_or_default();
|
||||||
all_inputs_res,
|
|
||||||
looped_res,
|
|
||||||
) = tokio::join!(
|
|
||||||
make_request(state_req),
|
|
||||||
make_request(file_path_req),
|
|
||||||
make_request(is_paused_req),
|
|
||||||
make_request(volume_req),
|
|
||||||
make_request(position_req),
|
|
||||||
make_request(duration_req),
|
|
||||||
make_request(current_input_req),
|
|
||||||
make_request(all_inputs_req),
|
|
||||||
make_request(looped_req),
|
|
||||||
);
|
|
||||||
|
|
||||||
let state_res = state_res.unwrap_or_default();
|
|
||||||
let file_path_res = file_path_res.unwrap_or_default();
|
|
||||||
let is_paused_res = is_paused_res.unwrap_or_default();
|
|
||||||
let volume_res = volume_res.unwrap_or_default();
|
|
||||||
let position_res = position_res.unwrap_or_default();
|
|
||||||
let duration_res = duration_res.unwrap_or_default();
|
|
||||||
let current_input_res = current_input_res.unwrap_or_default();
|
|
||||||
let all_inputs_res = all_inputs_res.unwrap_or_default();
|
|
||||||
let looped_res = looped_res.unwrap_or_default();
|
|
||||||
|
|
||||||
let state = match state_res.status {
|
let state = match state_res.status {
|
||||||
true => serde_json::from_str::<PlayerState>(&state_res.message).unwrap(),
|
true => serde_json::from_str::<PlayerState>(&state_res.message).unwrap(),
|
||||||
@@ -144,10 +116,6 @@ pub fn start_app_state_thread(audio_player_state_shared: Arc<Mutex<AudioPlayerSt
|
|||||||
.collect::<HashMap<String, String>>(),
|
.collect::<HashMap<String, String>>(),
|
||||||
false => HashMap::new(),
|
false => HashMap::new(),
|
||||||
};
|
};
|
||||||
let looped = match looped_res.status {
|
|
||||||
true => looped_res.message.parse::<bool>().unwrap_or_default(),
|
|
||||||
false => false,
|
|
||||||
};
|
|
||||||
|
|
||||||
{
|
{
|
||||||
let mut guard = audio_player_state_shared.lock().unwrap();
|
let mut guard = audio_player_state_shared.lock().unwrap();
|
||||||
@@ -178,7 +146,6 @@ pub fn start_app_state_thread(audio_player_state_shared: Arc<Mutex<AudioPlayerSt
|
|||||||
guard.duration = if duration > 0.0 { duration } else { 1.0 };
|
guard.duration = if duration > 0.0 { duration } else { 1.0 };
|
||||||
guard.current_input = current_input;
|
guard.current_input = current_input;
|
||||||
guard.all_inputs = all_inputs;
|
guard.all_inputs = all_inputs;
|
||||||
guard.looped = looped;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sleep(sleep_duration).await;
|
sleep(sleep_duration).await;
|
||||||
|
|||||||
Reference in New Issue
Block a user