From b3b3b185f714ce40e893aaafb0d9283a9bd30c76 Mon Sep 17 00:00:00 2001 From: herrernst Date: Sun, 1 Mar 2020 17:37:30 +0100 Subject: [PATCH 1/8] upgrade coreaudio-sys, fixes some build errors on macos --- Cargo.lock | 219 +++++++++++++++++++---------------------------------- 1 file changed, 79 insertions(+), 140 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0ed09115..f7ff7315 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -43,7 +43,7 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "0.6.10" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -80,14 +80,6 @@ dependencies = [ "pkg-config 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "ansi_term" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "approx" version = "0.3.2" @@ -162,21 +154,20 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.32.3" +version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cexpr 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cexpr 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "clang-sys 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)", - "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", - "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "clang-sys 0.28.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "which 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-hash 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "shlex 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -283,10 +274,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "cexpr" -version = "0.2.3" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "nom 3.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -307,26 +298,12 @@ dependencies = [ [[package]] name = "clang-sys" -version = "0.21.2" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "libloading 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "clap" -version = "2.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", - "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libloading 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -351,15 +328,15 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "coreaudio-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "coreaudio-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "coreaudio-sys" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bindgen 0.32.3 (registry+https://github.com/rust-lang/crates.io-index)", + "bindgen 0.51.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -450,15 +427,6 @@ dependencies = [ "pkg-config 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "env_logger" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "env_logger" version = "0.6.2" @@ -573,7 +541,7 @@ dependencies = [ [[package]] name = "glob" -version = "0.2.11" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -733,6 +701,15 @@ dependencies = [ "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "libloading" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.47 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "libm" version = "0.1.4" @@ -974,14 +951,6 @@ dependencies = [ "rawpointer 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "memchr" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "memchr" version = "2.2.1" @@ -1125,10 +1094,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "nom" -version = "3.2.1" +version = "4.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "memchr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1301,7 +1271,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "proc-macro2" -version = "0.2.3" +version = "0.4.30" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1309,10 +1279,10 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "0.4.30" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1342,14 +1312,6 @@ name = "quick-error" version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "quote" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "proc-macro2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "quote" version = "0.6.13" @@ -1358,6 +1320,14 @@ dependencies = [ "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "quote" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "rand" version = "0.3.23" @@ -1544,23 +1514,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "regex" -version = "0.2.11" +version = "1.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "aho-corasick 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", + "aho-corasick 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "regex-syntax 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", - "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "utf8-ranges 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)", + "thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "regex-syntax" -version = "0.5.6" +version = "0.6.15" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "ucd-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", -] [[package]] name = "relay" @@ -1603,6 +1569,11 @@ name = "rustc-demangle" version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "rustc_version" version = "0.2.3" @@ -1731,6 +1702,11 @@ name = "shell-words" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "shlex" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "signal-hook" version = "0.1.10" @@ -1815,11 +1791,6 @@ dependencies = [ "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "strsim" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "subtle" version = "1.0.0" @@ -1872,17 +1843,9 @@ dependencies = [ "wincolor 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "textwrap" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "thread_local" -version = "0.3.6" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2154,11 +2117,6 @@ name = "typenum" version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "ucd-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "unicase" version = "2.4.0" @@ -2193,6 +2151,11 @@ name = "unicode-xid" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "unicode-xid" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "url" version = "1.7.2" @@ -2203,11 +2166,6 @@ dependencies = [ "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "utf8-ranges" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "uuid" version = "0.7.4" @@ -2216,11 +2174,6 @@ dependencies = [ "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "vec_map" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "vergen" version = "3.0.4" @@ -2299,14 +2252,6 @@ dependencies = [ "try-lock 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "which" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "winapi" version = "0.2.8" @@ -2367,11 +2312,10 @@ dependencies = [ "checksum aes-ctr 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d2e5b0458ea3beae0d1d8c0f3946564f8e10f90646cf78c06b4351052058d1ee" "checksum aes-soft 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cfd7e7ae3f9a1fb5c03b389fc6bb9a51400d0c13053f0dca698c832bfd893a0d" "checksum aesni 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2f70a6b5f971e473091ab7cfb5ffac6cde81666c4556751d8d5620ead8abf100" -"checksum aho-corasick 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "81ce3d38065e618af2d7b77e10c5ad9a069859b4be3c2250f674af3840d9c8a5" +"checksum aho-corasick 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)" = "d5e63fd144e18ba274ae7095c0197a870a7b9468abc801dd62f190d80817d2ec" "checksum alga 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d708cb68c7106ed1844de68f50f0157a7788c2909a6926fad5a87546ef6a4ff8" "checksum alsa 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b4a0d4ebc8b23041c5de9bc9aee13b4bad844a589479701f31a5934cfe4aeb32" "checksum alsa-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b0edcbbf9ef68f15ae1b620f722180b82a98b6f0628d30baa6b8d2a5abc87d58" -"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" "checksum approx 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f0e60b75072ecd4168020818c0107f2857bb6c4e64252d8d3983f6263b40a5c3" "checksum arc-swap 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)" = "bc4662175ead9cd84451d5c35070517777949a2ed84551764129cedb88384841" "checksum arrayvec 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)" = "b8d73f9beda665eaa98ab9e4f7442bd4e7de6652587de55b2525e52e29c1b0ba" @@ -2381,7 +2325,7 @@ dependencies = [ "checksum backtrace-sys 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)" = "82a830b4ef2d1124a711c71d263c5abdc710ef8e907bd508c88be475cebc422b" "checksum base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" "checksum base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643" -"checksum bindgen 0.32.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8b242e11a8f446f5fc7b76b37e81d737cabca562a927bd33766dac55b5f1177f" +"checksum bindgen 0.51.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ebd71393f1ec0509b553aa012b9b58e81dadbdff7130bd3b8cba576e69b32f75" "checksum bit-set 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e84c238982c4b1e1ee668d136c510c67a13465279c0cb367ea6baf6310620a80" "checksum bit-vec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f59bbe95d4e52a6398ec21238d31577f2b28a9d86807f06ca59d191d8440d0bb" "checksum bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "32866f4d103c4e438b1db1158aa1b1a80ee078e5d77a59a2f906fd62a577389c" @@ -2397,15 +2341,14 @@ dependencies = [ "checksum bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" "checksum c2-chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7d64d04786e0f528460fc884753cf8dddcc466be308f6026f8e355c41a0e4101" "checksum cc 1.0.47 (registry+https://github.com/rust-lang/crates.io-index)" = "aa87058dce70a3ff5621797f1506cb837edd02ac4c0ae642b4542dce802908b8" -"checksum cexpr 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "42aac45e9567d97474a834efdee3081b3c942b2205be932092f53354ce503d6c" +"checksum cexpr 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "fce5b5fb86b0c57c20c834c1b412fd09c77c8a59b9473f86272709e78874cd1d" "checksum cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "b486ce3ccf7ffd79fdeb678eac06a9e6c09fc88d33836340becb8fffe87c5e33" "checksum chrono 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "77d81f58b7301084de3b958691458a53c3f7e0b1d702f77e550b6a88e3a88abe" -"checksum clang-sys 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e414af9726e1d11660801e73ccc7fb81803fb5f49e5903a25b348b2b3b480d2e" -"checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" +"checksum clang-sys 0.28.1 (registry+https://github.com/rust-lang/crates.io-index)" = "81de550971c976f176130da4b2978d3b524eaa0fd9ac31f3ceb5ae1231fb4853" "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" "checksum core-foundation-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "716c271e8613ace48344f723b60b900a93150271e5be206212d052bbc0883efa" "checksum coreaudio-rs 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f229761965dad3e9b11081668a6ea00f1def7aa46062321b5ec245b834f6e491" -"checksum coreaudio-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "78fdbabf58d5b1f461e31b94a571c109284f384cec619a3d96e66ec55b4de82b" +"checksum coreaudio-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7e8f5954c1c7ccb55340443e8b29fca24013545a5e7d72c1ca7db4fc02b982ce" "checksum cpal 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d58ae1ed6536b1b233f5e3aeb6997a046ddb4d05e3f61701b58a92eb254a829e" "checksum crossbeam-deque 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b18cd2e169ad86297e6bc0ad9aa679aee9daa4f19e8163860faf7c164e4f5a71" "checksum crossbeam-epoch 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "fedcd6772e37f3da2a9af9bf12ebe046c0dfe657992377b4df982a2b54cd37a9" @@ -2415,7 +2358,6 @@ dependencies = [ "checksum ctr 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "022cd691704491df67d25d006fe8eca083098253c4d43516c2206479c58c6736" "checksum digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" "checksum dns-sd 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d748509dea20228f63ba519bf142ce2593396386125b01f5b0d6412dab972087" -"checksum env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3ddf21e73e016298f5cb37d6ef8e8da8e39f91f9ec8b0df44b7deb16a9f8cd5b" "checksum env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "aafcde04e90a5226a6443b7aabdb016ba2f8307c847d524724bd9b346dd1a2d3" "checksum error-chain 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3ab49e9dcb602294bc42f9a7dfc9bc6e936fca4418ea300dbfb84fe16de0b7d9" "checksum failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "795bd83d3abeb9220f257e597aa0080a508b27533824adf336529648f6abf7e2" @@ -2431,7 +2373,7 @@ dependencies = [ "checksum generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" "checksum getopts 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)" = "72327b15c228bfe31f1390f93dd5e9279587f0463836393c9df719ce62a3e450" "checksum getrandom 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "e65cce4e5084b14874c4e7097f38cab54f47ee554f9194673456ea379dcc4c55" -"checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" +"checksum glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" "checksum hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" "checksum hmac 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5dcb5e64cda4c23119ab41ba960d1e170a774c8e4b9d9e6a9bc18aabf5e59695" "checksum httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" @@ -2449,6 +2391,7 @@ dependencies = [ "checksum lewton 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8d542c1a317036c45c2aa1cf10cc9d403ca91eb2d333ef1a4917e5cb10628bd0" "checksum libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)" = "1a31a0627fdf1f6a39ec0dd577e101440b7db22672c0901fe00a9a6fbb5c24e8" "checksum libloading 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "fd38073de8f7965d0c17d30546d4bb6da311ab428d1c7a3fc71dff7f9d4979b9" +"checksum libloading 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" "checksum libm 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" "checksum libmdns 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "fa04490b2ddac499769cfd1e59e68326c6d52dced8aa262512ad3c82cefba374" "checksum libpulse-sys 0.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9bb11b06faf883500c1b625cf4453e6c7737e9df9c7ba01df3f84b22b083e4ac" @@ -2459,7 +2402,6 @@ dependencies = [ "checksum log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "c275b6ad54070ac2d665eef9197db647b32239c9d244bfb6f041a766d00da5b3" "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" "checksum matrixmultiply 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dcfed72d871629daa12b25af198f110e8095d7650f5f4c61c5bac28364604f9b" -"checksum memchr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "148fab2e51b4f1cfc66da2a7c32981d1d3c083a803978268bb11fe4b86925e7a" "checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" "checksum memoffset 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ce6075db033bbbb7ee5a0bbd3a3186bbae616f57fb001c485c7ff77955f8177f" "checksum mime 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)" = "3e27ca21f40a310bd06d9031785f4801710d566c184a6e15bad4f1d9b65f9425" @@ -2474,7 +2416,7 @@ dependencies = [ "checksum nix 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b7fd5681d13fda646462cfbd4e5f2051279a89a544d50eb98c365b507246839f" "checksum nix 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a2c5afeb0198ec7be8569d666644b574345aad2e95a53baf3a532da3e0f3fb32" "checksum nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9667ddcc6cc8a43afc9b7917599d7216aa09c463919ea32c59ed6cac8bc945" -"checksum nom 3.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05aec50c70fd288702bcd93284a8444607f3292dbdf2a30de5ea5dcdbe72287b" +"checksum nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6" "checksum num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "4703ad64153382334aa8db57c637364c322d3372e097840c72000dabdcf6156e" "checksum num-bigint 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "57450397855d951f1a41305e54851b1a7b8f5d2e349543a02a2effe25459f718" "checksum num-complex 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "fcb0cf31fb3ff77e6d2a6ebd6800df7fdcd106f2ad89113c9130bcd07f93dffc" @@ -2495,14 +2437,14 @@ dependencies = [ "checksum portaudio-rs 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fc0e6b38f00fae9dde9a9832a2b54405988c6dcaf2870e6f9551546b447bbd7f" "checksum portaudio-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5194a4fa953b4ffd851c320ef6f0484cd7278cb7169ea9d6c433e49b23f7b7f5" "checksum ppv-lite86 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e3cbf9f658cdb5000fcf6f362b8ea2ba154b9f146a61c7a20d647034c6b6561b" -"checksum proc-macro2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cd07deb3c6d1d9ff827999c7f9b04cdfd66b1b17ae508e14fe47b620f2282ae0" "checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" +"checksum proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6c09721c6781493a2a492a96b5a5bf19b65917fe6728884e7c44dd0c60ca3435" "checksum protobuf 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "40361836defdd5871ff7e84096c6f6444af7fc157f8ef1789f54f147687caa20" "checksum protobuf-codegen 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "12c6abd78435445fc86898ebbd0521a68438063d4a73e23527b7134e6bf58b4a" "checksum protobuf-codegen-pure 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c1646acda5319f5b28b0bff4a484324df43ddae2c0f5a3f3e63c0b26095cd600" "checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" -"checksum quote 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1eca14c727ad12702eb4b6bfb5a232287dcf8385cb8ca83a3eeaf6519c44c408" "checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" +"checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" "checksum rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)" = "64ac302d8f83c0c1974bf758f6b041c6c8ada916fbb44a609158ca8b064cc76c" "checksum rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" "checksum rand 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c618c47cd3ebd209790115ab837de41425723956ad3ce2e6a7f09890947cacb9" @@ -2523,13 +2465,14 @@ dependencies = [ "checksum rawpointer 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ebac11a9d2e11f2af219b8b8d833b76b1ea0e054aa0e8d8e9e4cbde353bdf019" "checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" "checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" -"checksum regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9329abc99e39129fcceabd24cf5d85b4671ef7c29c50e972bc5afe32438ec384" -"checksum regex-syntax 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7d707a4fa2637f2dca2ef9fd02225ec7661fe01a53623c1e6515b6916511f7a7" +"checksum regex 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "322cf97724bea3ee221b78fe25ac9c46114ebb51747ad5babd51a2fc6a8235a8" +"checksum regex-syntax 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7246cd0a0a6ec2239a5405b2b16e3f404fa0dcc6d28f5f5b877bf80e33e0f294" "checksum relay 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1576e382688d7e9deecea24417e350d3062d97e32e45d70b1cde65994ff1489a" "checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" "checksum rodio 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5d0f961b254e66d147a7b550c78b01308934c97d807a34b417fd0f5a0a0f3a2d" "checksum rpassword 3.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c34fa7bcae7fca3c8471e8417088bbc3ad9af8066b0ecf4f3c0d98a0d772716e" "checksum rustc-demangle 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)" = "a7f4dccf6f4891ebcc0c39f9b6eb1a83b9bf5d747cb439ec6fba4f3b977038af" +"checksum rustc-hash 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" "checksum ryu 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c92464b447c0ee8c4fb3824ecc8383b81717b9f1e74ba2e72540aef7b9f82997" "checksum safemem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8dca453248a96cb0749e36ccdfe2b0b4e54a61bfef89fb97ec621eb8e0a93dd9" @@ -2547,6 +2490,7 @@ dependencies = [ "checksum sha2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b4d8bfd0e469f417657573d8451fb33d16cfe0989359b93baf3a1ffc639543d" "checksum shannon 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7ea5b41c9427b56caa7b808cb548a04fb50bb5b9e98590b53f28064ff4174561" "checksum shell-words 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "39acde55a154c4cd3ae048ac78cc21c25f3a0145e44111b523279113dce0d94a" +"checksum shlex 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" "checksum signal-hook 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4f61c4d59f3aaa9f61bba6450a9b80ba48362fd7d651689e7a10c453b1f6dc68" "checksum signal-hook-registry 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "913661ac8848a61e39684a3c3e7a7a14a4deec7f54b4976d0641e70dda3939b1" "checksum slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17b4fcaed89ab08ef143da37bc52adbcc04d4a69014f4c1208d6b51f0c47bc23" @@ -2559,15 +2503,13 @@ dependencies = [ "checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" "checksum stdweb 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ef5430c8e36b713e13b48a9f709cc21e046723fe44ce34587b73a830203b533e" "checksum stream-cipher 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8861bc80f649f5b4c9bd38b696ae9af74499d479dbfb327f0607de6b326a36bc" -"checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" "checksum subtle 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" "checksum syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)" = "eadc09306ca51a40555dd6fc2b415538e9e18bc9f870e47b1a524a79fe2dcf5e" "checksum synstructure 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "02353edf96d6e4dc81aea2d8490a7e9db177bf8acb0e951c24940bf866cb313f" "checksum take 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b157868d8ac1f56b64604539990685fa7611d8fa9e5476cf0c02cf34d32917c5" "checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" "checksum termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "96d6098003bde162e4277c70665bd87c326f5a0c3f3fbfb285787fa482d54e6e" -"checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -"checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" +"checksum thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" "checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" "checksum tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)" = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" "checksum tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5c501eceaf96f0e1793cf26beb63da3d11c738c4a943fdf3746d81d64684c39f" @@ -2589,16 +2531,14 @@ dependencies = [ "checksum tokio-uds 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "037ffc3ba0e12a0ab4aca92e5234e0dedeb48fddf6ccd260f1f150a36a9f2445" "checksum try-lock 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee2aa4715743892880f70885373966c83d73ef1b0838a664ef0c76fffd35e7c2" "checksum typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "612d636f949607bdf9b123b4a6f6d966dedf3ff669f7f045890d3a4a73948169" -"checksum ucd-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fa9b3b49edd3468c0e6565d85783f51af95212b6fa3986a5500954f00b460874" "checksum unicase 2.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a84e5511b2a947f3ae965dcb29b13b7b1691b6e7332cf5dbc1744138d5acb7f6" "checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" "checksum unicode-normalization 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "141339a08b982d942be2ca06ff8b076563cbe223d1befd5450716790d44e2426" "checksum unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "882386231c45df4700b275c7ff55b6f3698780a650026380e72dabe76fa46526" "checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" +"checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" "checksum url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" -"checksum utf8-ranges 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9d50aa7650df78abf942826607c62468ce18d9019673d4a2ebe1865dbb96ffde" "checksum uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "90dbc611eb48397705a6b0f6e917da23ae517e4d127123d2cf7674206627d32a" -"checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" "checksum vergen 3.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "6aba5e34f93dc7051dfad05b98a18e9156f27e7b431fe1d2398cb6061c0a1dba" "checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" @@ -2607,7 +2547,6 @@ dependencies = [ "checksum vorbis-sys 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)" = "729e1f15395850b4e6d19ca0cd1d42ef44707503a53b69d40ff49182b3c5589d" "checksum vorbisfile-sys 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)" = "4f4306d7e1ac4699b55e20de9483750b90c250913188efd7484db6bfbe9042d1" "checksum want 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a05d9d966753fa4b5c8db73fcab5eed4549cfe0e1e4e66911e5564a0085c35d1" -"checksum which 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e84a603e7e0b1ce1aa1ee2b109c7be00155ce52df5081590d1ffb93f4f515cb2" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" "checksum winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "f10e386af2b13e47c89e7236a7a14a086791a2b88ebad6df9bf42040195cf770" "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" From c9117542eb290795b458f59fd4af99e6f6cd03da Mon Sep 17 00:00:00 2001 From: Konstantin Seiler Date: Thu, 12 Mar 2020 23:01:45 +1100 Subject: [PATCH 2/8] Refactor TrackMetaData in the player and add the metadata to the player events. Fire more events in the --onevent script and set more variables. --- playback/src/player.rs | 354 +++++++++++++++++++----------------- src/main.rs | 1 + src/player_event_handler.rs | 29 +++ 3 files changed, 217 insertions(+), 167 deletions(-) diff --git a/playback/src/player.rs b/playback/src/player.rs index a26d3583..def9371c 100644 --- a/playback/src/player.rs +++ b/playback/src/player.rs @@ -66,44 +66,62 @@ enum PlayerCommand { #[derive(Debug, Clone)] pub enum PlayerEvent { + // Fired when the player is stopped (e.g. by issuing a "stop" command to the player). Stopped { play_request_id: u64, track_id: SpotifyId, }, - Loading { - play_request_id: u64, - track_id: SpotifyId, - position_ms: u32, - }, + // The player started working on playback of a track while it was in a stopped state. + // This is always immediately followed up by a "Loading" or "Playing" event. Started { play_request_id: u64, track_id: SpotifyId, position_ms: u32, }, + // Same as started but in the case that the player already had a track loaded. + // The player was either playing the loaded track or it was paused. Changed { old_track_id: SpotifyId, new_track_id: SpotifyId, }, + // The player is delayed by loading a track. + Loading { + play_request_id: u64, + track_id: SpotifyId, + position_ms: u32, + }, + // The player is playing a track. + // This event is issued at the start of playback of whenever the position must be communicated + // because it is out of sync. This includes: + // start of a track + // un-pausing + // after a seek + // after a buffer-underrun Playing { play_request_id: u64, - track_id: SpotifyId, + track_meta_data: TrackMetaData, position_ms: u32, - duration_ms: u32, }, + // The player entered a paused state. Paused { play_request_id: u64, - track_id: SpotifyId, + track_meta_data: TrackMetaData, position_ms: u32, - duration_ms: u32, }, + // The player thinks it's a good idea to issue a preload command for the next track now. + // This event is intended for use within spirc. TimeToPreloadNextTrack { play_request_id: u64, track_id: SpotifyId, }, + // The player reached the end of a track. + // This event is intended for use within spirc. Spirc will respond by issuing another command + // which will trigger another event (e.g. Changed or Stopped) EndOfTrack { play_request_id: u64, - track_id: SpotifyId, + track_meta_data: TrackMetaData, }, + // The mixer volume was set to a new level. VolumeSet { volume: u16, }, @@ -306,12 +324,19 @@ impl Drop for Player { } } +#[derive(Debug, Clone)] +pub struct TrackMetaData { + pub track_id: SpotifyId, + pub normalisation_factor: f32, + pub duration_ms: u32, + pub bytes_per_second: usize, + pub title: String, +} + struct PlayerLoadedTrackData { + track_meta_data: TrackMetaData, decoder: Decoder, - normalisation_factor: f32, stream_loader_controller: StreamLoaderController, - bytes_per_second: usize, - duration_ms: u32, stream_position_pcm: u64, } @@ -322,7 +347,6 @@ enum PlayerPreload { loader: Box>, }, Ready { - track_id: SpotifyId, loaded_track: PlayerLoadedTrackData, }, } @@ -338,32 +362,25 @@ enum PlayerState { loader: Box>, }, Paused { - track_id: SpotifyId, + track_meta_data: TrackMetaData, play_request_id: u64, decoder: Decoder, - normalisation_factor: f32, stream_loader_controller: StreamLoaderController, - bytes_per_second: usize, - duration_ms: u32, stream_position_pcm: u64, suggested_to_preload_next_track: bool, }, Playing { - track_id: SpotifyId, + track_meta_data: TrackMetaData, play_request_id: u64, decoder: Decoder, - normalisation_factor: f32, stream_loader_controller: StreamLoaderController, - bytes_per_second: usize, - duration_ms: u32, stream_position_pcm: u64, reported_nominal_start_time: Option, suggested_to_preload_next_track: bool, }, EndOfTrack { - track_id: SpotifyId, play_request_id: u64, - loaded_track: Option, + loaded_track: PlayerLoadedTrackData, }, Invalid, } @@ -420,27 +437,21 @@ impl PlayerState { use self::PlayerState::*; match mem::replace(self, Invalid) { Playing { - track_id, + track_meta_data, play_request_id, decoder, - duration_ms, - bytes_per_second, - normalisation_factor, stream_loader_controller, stream_position_pcm, .. } => { *self = EndOfTrack { - track_id, play_request_id, - loaded_track: Some(PlayerLoadedTrackData { + loaded_track: PlayerLoadedTrackData { + track_meta_data, decoder, - duration_ms, - bytes_per_second, - normalisation_factor, stream_loader_controller, stream_position_pcm, - }), + }, }; } _ => panic!("Called playing_to_end_of_track in non-playing state."), @@ -451,24 +462,18 @@ impl PlayerState { use self::PlayerState::*; match ::std::mem::replace(self, Invalid) { Paused { - track_id, + track_meta_data, play_request_id, decoder, - normalisation_factor, stream_loader_controller, - duration_ms, - bytes_per_second, stream_position_pcm, suggested_to_preload_next_track, } => { *self = Playing { - track_id, + track_meta_data, play_request_id, decoder, - normalisation_factor, stream_loader_controller, - duration_ms, - bytes_per_second, stream_position_pcm, reported_nominal_start_time: None, suggested_to_preload_next_track, @@ -482,25 +487,19 @@ impl PlayerState { use self::PlayerState::*; match ::std::mem::replace(self, Invalid) { Playing { - track_id, + track_meta_data, play_request_id, decoder, - normalisation_factor, stream_loader_controller, - duration_ms, - bytes_per_second, stream_position_pcm, reported_nominal_start_time: _, suggested_to_preload_next_track, } => { *self = Paused { - track_id, + track_meta_data, play_request_id, decoder, - normalisation_factor, stream_loader_controller, - duration_ms, - bytes_per_second, stream_position_pcm, suggested_to_preload_next_track, }; @@ -670,11 +669,15 @@ impl PlayerTrackLoader { let stream_position_pcm = PlayerInternal::position_ms_to_pcm(position_ms); info!("<{}> ({} ms) loaded", audio.name, audio.duration); Some(PlayerLoadedTrackData { + track_meta_data: TrackMetaData { + track_id: spotify_id, + normalisation_factor, + bytes_per_second, + duration_ms, + title: audio.name.clone(), + }, decoder, - normalisation_factor, stream_loader_controller, - bytes_per_second, - duration_ms, stream_position_pcm, }) } @@ -709,19 +712,14 @@ impl Future for PlayerInternal { // Handle loading of a new track to play if let PlayerState::Loading { ref mut loader, - track_id, start_playback, play_request_id, + .. } = self.state { match loader.poll() { Ok(Async::Ready(loaded_track)) => { - self.start_playback( - track_id, - play_request_id, - loaded_track, - start_playback, - ); + self.start_playback(play_request_id, loaded_track, start_playback); if let PlayerState::Loading { .. } = self.state { panic!("The state wasn't changed by start_playback()"); } @@ -735,17 +733,10 @@ impl Future for PlayerInternal { } // handle pending preload requests. - if let PlayerPreload::Loading { - ref mut loader, - track_id, - } = self.preload - { + if let PlayerPreload::Loading { ref mut loader, .. } = self.preload { match loader.poll() { Ok(Async::Ready(loaded_track)) => { - self.preload = PlayerPreload::Ready { - track_id, - loaded_track, - }; + self.preload = PlayerPreload::Ready { loaded_track }; } Ok(Async::NotReady) => (), Err(_) => { @@ -758,16 +749,16 @@ impl Future for PlayerInternal { self.ensure_sink_running(); if let PlayerState::Playing { - track_id, + ref track_meta_data, play_request_id, ref mut decoder, - normalisation_factor, ref mut stream_position_pcm, ref mut reported_nominal_start_time, - duration_ms, .. } = self.state { + let track_meta_data = track_meta_data.clone(); + let normalisation_factor = track_meta_data.normalisation_factor; let packet = decoder.next_packet().expect("Vorbis error"); if let Some(ref packet) = packet { @@ -795,10 +786,9 @@ impl Future for PlayerInternal { - Duration::from_millis(stream_position_millis as u64), ); self.send_event(PlayerEvent::Playing { - track_id, + track_meta_data, play_request_id, position_ms: stream_position_millis as u32, - duration_ms, }); } } @@ -810,18 +800,16 @@ impl Future for PlayerInternal { } if let PlayerState::Playing { - track_id, + ref track_meta_data, play_request_id, - duration_ms, stream_position_pcm, ref mut stream_loader_controller, ref mut suggested_to_preload_next_track, .. } | PlayerState::Paused { - track_id, + ref track_meta_data, play_request_id, - duration_ms, stream_position_pcm, ref mut stream_loader_controller, ref mut suggested_to_preload_next_track, @@ -829,13 +817,15 @@ impl Future for PlayerInternal { } = self.state { if (!*suggested_to_preload_next_track) - && ((duration_ms as i64 - Self::position_pcm_to_ms(stream_position_pcm) as i64) + && ((track_meta_data.duration_ms as i64 + - Self::position_pcm_to_ms(stream_position_pcm) as i64) < PRELOAD_NEXT_TRACK_BEFORE_END_DURATION_MS as i64) && stream_loader_controller.range_to_end_available() { *suggested_to_preload_next_track = true; + let track_meta_data = track_meta_data.clone(); self.send_event(PlayerEvent::TimeToPreloadNextTrack { - track_id, + track_id: track_meta_data.track_id, play_request_id, }); } @@ -882,17 +872,21 @@ impl PlayerInternal { fn handle_player_stop(&mut self) { match self.state { PlayerState::Playing { - track_id, + track_meta_data: TrackMetaData { track_id, .. }, play_request_id, .. } | PlayerState::Paused { - track_id, + track_meta_data: TrackMetaData { track_id, .. }, play_request_id, .. } | PlayerState::EndOfTrack { - track_id, + loaded_track: + PlayerLoadedTrackData { + track_meta_data: TrackMetaData { track_id, .. }, + .. + }, play_request_id, .. } @@ -915,21 +909,20 @@ impl PlayerInternal { fn handle_play(&mut self) { if let PlayerState::Paused { - track_id, + ref track_meta_data, play_request_id, stream_position_pcm, - duration_ms, .. } = self.state { + let track_meta_data = track_meta_data.clone(); self.state.paused_to_playing(); let position_ms = Self::position_pcm_to_ms(stream_position_pcm); self.send_event(PlayerEvent::Playing { - track_id, + track_meta_data, play_request_id, position_ms, - duration_ms, }); self.ensure_sink_running(); } else { @@ -939,22 +932,22 @@ impl PlayerInternal { fn handle_pause(&mut self) { if let PlayerState::Playing { - track_id, + ref track_meta_data, play_request_id, stream_position_pcm, - duration_ms, .. } = self.state { + let track_meta_data = track_meta_data.clone(); + self.state.playing_to_paused(); self.ensure_sink_stopped(); let position_ms = Self::position_pcm_to_ms(stream_position_pcm); self.send_event(PlayerEvent::Paused { - track_id, + track_meta_data, play_request_id, position_ms, - duration_ms, }); } else { warn!("Player::pause called from invalid state"); @@ -985,13 +978,18 @@ impl PlayerInternal { None => { self.state.playing_to_end_of_track(); if let PlayerState::EndOfTrack { - track_id, + loaded_track: + PlayerLoadedTrackData { + ref track_meta_data, + .. + }, play_request_id, .. } = self.state { + let track_meta_data = track_meta_data.clone(); self.send_event(PlayerEvent::EndOfTrack { - track_id, + track_meta_data, play_request_id, }) } else { @@ -1003,7 +1001,6 @@ impl PlayerInternal { fn start_playback( &mut self, - track_id: SpotifyId, play_request_id: u64, loaded_track: PlayerLoadedTrackData, start_playback: bool, @@ -1014,20 +1011,16 @@ impl PlayerInternal { self.ensure_sink_running(); self.send_event(PlayerEvent::Playing { - track_id, + track_meta_data: loaded_track.track_meta_data.clone(), play_request_id, position_ms, - duration_ms: loaded_track.duration_ms, }); self.state = PlayerState::Playing { - track_id: track_id, + track_meta_data: loaded_track.track_meta_data, play_request_id: play_request_id, decoder: loaded_track.decoder, - normalisation_factor: loaded_track.normalisation_factor, stream_loader_controller: loaded_track.stream_loader_controller, - duration_ms: loaded_track.duration_ms, - bytes_per_second: loaded_track.bytes_per_second, stream_position_pcm: loaded_track.stream_position_pcm, reported_nominal_start_time: Some( Instant::now() - Duration::from_millis(position_ms as u64), @@ -1037,23 +1030,21 @@ impl PlayerInternal { } else { self.ensure_sink_stopped(); + let track_meta_data = loaded_track.track_meta_data.clone(); + self.state = PlayerState::Paused { - track_id: track_id, + track_meta_data: loaded_track.track_meta_data, play_request_id: play_request_id, decoder: loaded_track.decoder, - normalisation_factor: loaded_track.normalisation_factor, stream_loader_controller: loaded_track.stream_loader_controller, - duration_ms: loaded_track.duration_ms, - bytes_per_second: loaded_track.bytes_per_second, stream_position_pcm: loaded_track.stream_position_pcm, suggested_to_preload_next_track: false, }; self.send_event(PlayerEvent::Paused { - track_id, + track_meta_data, play_request_id, position_ms, - duration_ms: loaded_track.duration_ms, }); } } @@ -1071,15 +1062,31 @@ impl PlayerInternal { // emit the correct player event match self.state { PlayerState::Playing { - track_id: old_track_id, + track_meta_data: + TrackMetaData { + track_id: old_track_id, + .. + }, .. } | PlayerState::Paused { - track_id: old_track_id, + track_meta_data: + TrackMetaData { + track_id: old_track_id, + .. + }, .. } | PlayerState::EndOfTrack { - track_id: old_track_id, + loaded_track: + PlayerLoadedTrackData { + track_meta_data: + TrackMetaData { + track_id: old_track_id, + .. + }, + .. + }, .. } | PlayerState::Loading { @@ -1103,49 +1110,56 @@ impl PlayerInternal { // Check if there's a matching loaded track in the EndOfTrack player state. // This is the case if we're repeating the same track again. if let PlayerState::EndOfTrack { - track_id: previous_track_id, ref mut loaded_track, .. } = self.state { - if previous_track_id == track_id { - let loaded_track = mem::replace(&mut *loaded_track, None); - if let Some(mut loaded_track) = loaded_track { - if Self::position_ms_to_pcm(position_ms) != loaded_track.stream_position_pcm { - loaded_track - .stream_loader_controller - .set_random_access_mode(); - let _ = loaded_track.decoder.seek(position_ms as i64); // This may be blocking. - // But most likely the track is fully - // loaded already because we played - // to the end of it. - loaded_track.stream_loader_controller.set_stream_mode(); - loaded_track.stream_position_pcm = Self::position_ms_to_pcm(position_ms); - } - self.preload = PlayerPreload::None; - self.start_playback(track_id, play_request_id, loaded_track, play); - return; + if loaded_track.track_meta_data.track_id == track_id { + let mut loaded_track = match mem::replace(&mut self.state, PlayerState::Invalid) { + PlayerState::EndOfTrack { loaded_track, .. } => loaded_track, + _ => unreachable!(), + }; + + //let loaded_track = mem::replace(&mut *loaded_track, None); + //if let Some(mut loaded_track) = loaded_track { + if Self::position_ms_to_pcm(position_ms) != loaded_track.stream_position_pcm { + loaded_track + .stream_loader_controller + .set_random_access_mode(); + let _ = loaded_track.decoder.seek(position_ms as i64); // This may be blocking. + // But most likely the track is fully + // loaded already because we played + // to the end of it. + loaded_track.stream_loader_controller.set_stream_mode(); + loaded_track.stream_position_pcm = Self::position_ms_to_pcm(position_ms); } + self.preload = PlayerPreload::None; + self.start_playback(play_request_id, loaded_track, play); + if let PlayerState::Invalid = self.state { + panic!("start_playback() hasn't set a valid player state."); + } + return; + //} } } // Check if we are already playing the track. If so, just do a seek and update our info. if let PlayerState::Playing { - track_id: current_track_id, + ref track_meta_data, ref mut stream_position_pcm, ref mut decoder, ref mut stream_loader_controller, .. } | PlayerState::Paused { - track_id: current_track_id, + ref track_meta_data, ref mut stream_position_pcm, ref mut decoder, ref mut stream_loader_controller, .. } = self.state { - if current_track_id == track_id { + if track_meta_data.track_id == track_id { // we can use the current decoder. Ensure it's at the correct position. if Self::position_ms_to_pcm(position_ms) != *stream_position_pcm { stream_loader_controller.set_random_access_mode(); @@ -1159,35 +1173,29 @@ impl PlayerInternal { let old_state = mem::replace(&mut self.state, PlayerState::Invalid); if let PlayerState::Playing { + track_meta_data, stream_position_pcm, decoder, stream_loader_controller, - bytes_per_second, - duration_ms, - normalisation_factor, .. } | PlayerState::Paused { + track_meta_data, stream_position_pcm, decoder, stream_loader_controller, - bytes_per_second, - duration_ms, - normalisation_factor, .. } = old_state { let loaded_track = PlayerLoadedTrackData { + track_meta_data, decoder, - normalisation_factor, stream_loader_controller, - bytes_per_second, - duration_ms, stream_position_pcm, }; self.preload = PlayerPreload::None; - self.start_playback(track_id, play_request_id, loaded_track, play); + self.start_playback(play_request_id, loaded_track, play); if let PlayerState::Invalid = self.state { panic!("start_playback() hasn't set a valid player state."); @@ -1202,17 +1210,17 @@ impl PlayerInternal { // Check if the requested track has been preloaded already. If so use the preloaded data. if let PlayerPreload::Ready { - track_id: loaded_track_id, + loaded_track: + PlayerLoadedTrackData { + ref track_meta_data, + .. + }, .. } = self.preload { - if track_id == loaded_track_id { + if track_id == track_meta_data.track_id { let preload = std::mem::replace(&mut self.preload, PlayerPreload::None); - if let PlayerPreload::Ready { - track_id, - mut loaded_track, - } = preload - { + if let PlayerPreload::Ready { mut loaded_track } = preload { if Self::position_ms_to_pcm(position_ms) != loaded_track.stream_position_pcm { loaded_track .stream_loader_controller @@ -1220,7 +1228,7 @@ impl PlayerInternal { let _ = loaded_track.decoder.seek(position_ms as i64); // This may be blocking loaded_track.stream_loader_controller.set_stream_mode(); } - self.start_playback(track_id, play_request_id, loaded_track, play); + self.start_playback(play_request_id, loaded_track, play); return; } else { unreachable!(); @@ -1285,7 +1293,15 @@ impl PlayerInternal { .. } | PlayerPreload::Ready { - track_id: currently_loading, + loaded_track: + PlayerLoadedTrackData { + track_meta_data: + TrackMetaData { + track_id: currently_loading, + .. + }, + .. + }, .. } = self.preload { @@ -1299,25 +1315,29 @@ impl PlayerInternal { } if let PlayerState::Playing { - track_id: current_track_id, + ref track_meta_data, .. } | PlayerState::Paused { - track_id: current_track_id, + ref track_meta_data, .. } | PlayerState::EndOfTrack { - track_id: current_track_id, + loaded_track: + PlayerLoadedTrackData { + ref track_meta_data, + .. + }, .. } = self.state { - if current_track_id == track_id { + if track_meta_data.track_id == track_id { // we already have the requested track loaded. preload_track = false; } } - // schedule the preload if the current track if desired. + // schedule the preload of the current track if desired. if preload_track { let loader = self.load_track(track_id, 0); self.preload = PlayerPreload::Loading { track_id, loader } @@ -1358,34 +1378,32 @@ impl PlayerInternal { self.preload_data_before_playback(); if let PlayerState::Playing { - track_id, + ref track_meta_data, play_request_id, ref mut reported_nominal_start_time, - duration_ms, .. } = self.state { *reported_nominal_start_time = Some(Instant::now() - Duration::from_millis(position_ms as u64)); + let track_meta_data = track_meta_data.clone(); self.send_event(PlayerEvent::Playing { - track_id, + track_meta_data, play_request_id, position_ms, - duration_ms, }); } if let PlayerState::Paused { - track_id, + ref track_meta_data, play_request_id, - duration_ms, .. } = self.state { + let track_meta_data = track_meta_data.clone(); self.send_event(PlayerEvent::Paused { - track_id, + track_meta_data, play_request_id, position_ms, - duration_ms, }); } } @@ -1462,7 +1480,7 @@ impl PlayerInternal { fn preload_data_before_playback(&mut self) { if let PlayerState::Playing { - bytes_per_second, + ref track_meta_data, ref mut stream_loader_controller, .. } = self.state @@ -1471,8 +1489,9 @@ impl PlayerInternal { let request_data_length = max( (READ_AHEAD_DURING_PLAYBACK_ROUNDTRIPS * (0.001 * stream_loader_controller.ping_time_ms() as f64) - * bytes_per_second as f64) as usize, - (READ_AHEAD_DURING_PLAYBACK_SECONDS * bytes_per_second as f64) as usize, + * track_meta_data.bytes_per_second as f64) as usize, + (READ_AHEAD_DURING_PLAYBACK_SECONDS * track_meta_data.bytes_per_second as f64) + as usize, ); stream_loader_controller.fetch_next(request_data_length); @@ -1480,8 +1499,9 @@ impl PlayerInternal { let wait_for_data_length = max( (READ_AHEAD_BEFORE_PLAYBACK_ROUNDTRIPS * (0.001 * stream_loader_controller.ping_time_ms() as f64) - * bytes_per_second as f64) as usize, - (READ_AHEAD_BEFORE_PLAYBACK_SECONDS * bytes_per_second as f64) as usize, + * track_meta_data.bytes_per_second as f64) as usize, + (READ_AHEAD_BEFORE_PLAYBACK_SECONDS * track_meta_data.bytes_per_second as f64) + as usize, ); stream_loader_controller.fetch_next_blocking(wait_for_data_length); } diff --git a/src/main.rs b/src/main.rs index ef8dbd7b..bdf13e80 100644 --- a/src/main.rs +++ b/src/main.rs @@ -543,6 +543,7 @@ impl Future for Main { if let Some(ref mut player_event_channel) = self.player_event_channel { if let Async::Ready(Some(event)) = player_event_channel.poll().unwrap() { + progress = true; if let Some(ref program) = self.player_event_program { if let Some(child) = run_program_on_events(event, program) { let child = child diff --git a/src/player_event_handler.rs b/src/player_event_handler.rs index 2fa34d2b..36c5adc1 100644 --- a/src/player_event_handler.rs +++ b/src/player_event_handler.rs @@ -1,4 +1,5 @@ use librespot::playback::player::PlayerEvent; +use librespot_playback::player::TrackMetaData; use log::info; use std::collections::HashMap; use std::io; @@ -14,6 +15,12 @@ fn run_program(program: &str, env_vars: HashMap<&str, String>) -> io::Result, track_meta_data: TrackMetaData) { + env_vars.insert("TRACK_ID", track_meta_data.track_id.to_base62()); + env_vars.insert("DURATION_MS", track_meta_data.duration_ms.to_string()); + env_vars.insert("TITLE", track_meta_data.title); +} + pub fn run_program_on_events(event: PlayerEvent, onevent: &str) -> Option> { let mut env_vars = HashMap::new(); match event { @@ -33,6 +40,28 @@ pub fn run_program_on_events(event: PlayerEvent, onevent: &str) -> Option { + env_vars.insert("PLAYER_EVENT", "playing".to_string()); + add_meta_data_to_env_vars(&mut env_vars, track_meta_data); + env_vars.insert("POSITION_MS", position_ms.to_string()); + } + PlayerEvent::Paused { + track_meta_data, + position_ms, + .. + } => { + env_vars.insert("PLAYER_EVENT", "paused".to_string()); + add_meta_data_to_env_vars(&mut env_vars, track_meta_data); + env_vars.insert("POSITION_MS", position_ms.to_string()); + } + PlayerEvent::VolumeSet { volume } => { + env_vars.insert("PLAYER_EVENT", "volume_set".to_string()); + env_vars.insert("VOLUME", volume.to_string()); + } _ => return None, } Some(run_program(onevent, env_vars)) From b562ec6015f3caf709a3d5bf2375cad7eaa4f945 Mon Sep 17 00:00:00 2001 From: Konstantin Seiler Date: Thu, 12 Mar 2020 23:29:24 +1100 Subject: [PATCH 3/8] rename variable. --- src/player_event_handler.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/player_event_handler.rs b/src/player_event_handler.rs index 36c5adc1..4809fc22 100644 --- a/src/player_event_handler.rs +++ b/src/player_event_handler.rs @@ -18,7 +18,7 @@ fn run_program(program: &str, env_vars: HashMap<&str, String>) -> io::Result, track_meta_data: TrackMetaData) { env_vars.insert("TRACK_ID", track_meta_data.track_id.to_base62()); env_vars.insert("DURATION_MS", track_meta_data.duration_ms.to_string()); - env_vars.insert("TITLE", track_meta_data.title); + env_vars.insert("TRACK_TITLE", track_meta_data.title); } pub fn run_program_on_events(event: PlayerEvent, onevent: &str) -> Option> { From 223b8d611e7c354cb1d784f71b89d8a3d851af19 Mon Sep 17 00:00:00 2001 From: Konstantin Seiler Date: Fri, 20 Mar 2020 17:31:18 +1100 Subject: [PATCH 4/8] Roll back the meta data processing. --- playback/src/player.rs | 282 ++++++++++++++++++------------------ src/player_event_handler.rs | 19 +-- 2 files changed, 151 insertions(+), 150 deletions(-) diff --git a/playback/src/player.rs b/playback/src/player.rs index def9371c..2dd8f3bd 100644 --- a/playback/src/player.rs +++ b/playback/src/player.rs @@ -99,14 +99,16 @@ pub enum PlayerEvent { // after a buffer-underrun Playing { play_request_id: u64, - track_meta_data: TrackMetaData, + track_id: SpotifyId, position_ms: u32, + duration_ms: u32, }, // The player entered a paused state. Paused { play_request_id: u64, - track_meta_data: TrackMetaData, + track_id: SpotifyId, position_ms: u32, + duration_ms: u32, }, // The player thinks it's a good idea to issue a preload command for the next track now. // This event is intended for use within spirc. @@ -119,7 +121,7 @@ pub enum PlayerEvent { // which will trigger another event (e.g. Changed or Stopped) EndOfTrack { play_request_id: u64, - track_meta_data: TrackMetaData, + track_id: SpotifyId, }, // The mixer volume was set to a new level. VolumeSet { @@ -324,19 +326,12 @@ impl Drop for Player { } } -#[derive(Debug, Clone)] -pub struct TrackMetaData { - pub track_id: SpotifyId, - pub normalisation_factor: f32, - pub duration_ms: u32, - pub bytes_per_second: usize, - pub title: String, -} - struct PlayerLoadedTrackData { - track_meta_data: TrackMetaData, decoder: Decoder, + normalisation_factor: f32, stream_loader_controller: StreamLoaderController, + bytes_per_second: usize, + duration_ms: u32, stream_position_pcm: u64, } @@ -347,6 +342,7 @@ enum PlayerPreload { loader: Box>, }, Ready { + track_id: SpotifyId, loaded_track: PlayerLoadedTrackData, }, } @@ -362,23 +358,30 @@ enum PlayerState { loader: Box>, }, Paused { - track_meta_data: TrackMetaData, + track_id: SpotifyId, play_request_id: u64, decoder: Decoder, + normalisation_factor: f32, stream_loader_controller: StreamLoaderController, + bytes_per_second: usize, + duration_ms: u32, stream_position_pcm: u64, suggested_to_preload_next_track: bool, }, Playing { - track_meta_data: TrackMetaData, + track_id: SpotifyId, play_request_id: u64, decoder: Decoder, + normalisation_factor: f32, stream_loader_controller: StreamLoaderController, + bytes_per_second: usize, + duration_ms: u32, stream_position_pcm: u64, reported_nominal_start_time: Option, suggested_to_preload_next_track: bool, }, EndOfTrack { + track_id: SpotifyId, play_request_id: u64, loaded_track: PlayerLoadedTrackData, }, @@ -437,18 +440,24 @@ impl PlayerState { use self::PlayerState::*; match mem::replace(self, Invalid) { Playing { - track_meta_data, + track_id, play_request_id, decoder, + duration_ms, + bytes_per_second, + normalisation_factor, stream_loader_controller, stream_position_pcm, .. } => { *self = EndOfTrack { + track_id, play_request_id, loaded_track: PlayerLoadedTrackData { - track_meta_data, decoder, + duration_ms, + bytes_per_second, + normalisation_factor, stream_loader_controller, stream_position_pcm, }, @@ -462,18 +471,24 @@ impl PlayerState { use self::PlayerState::*; match ::std::mem::replace(self, Invalid) { Paused { - track_meta_data, + track_id, play_request_id, decoder, + normalisation_factor, stream_loader_controller, + duration_ms, + bytes_per_second, stream_position_pcm, suggested_to_preload_next_track, } => { *self = Playing { - track_meta_data, + track_id, play_request_id, decoder, + normalisation_factor, stream_loader_controller, + duration_ms, + bytes_per_second, stream_position_pcm, reported_nominal_start_time: None, suggested_to_preload_next_track, @@ -487,19 +502,25 @@ impl PlayerState { use self::PlayerState::*; match ::std::mem::replace(self, Invalid) { Playing { - track_meta_data, + track_id, play_request_id, decoder, + normalisation_factor, stream_loader_controller, + duration_ms, + bytes_per_second, stream_position_pcm, reported_nominal_start_time: _, suggested_to_preload_next_track, } => { *self = Paused { - track_meta_data, + track_id, play_request_id, decoder, + normalisation_factor, stream_loader_controller, + duration_ms, + bytes_per_second, stream_position_pcm, suggested_to_preload_next_track, }; @@ -669,15 +690,11 @@ impl PlayerTrackLoader { let stream_position_pcm = PlayerInternal::position_ms_to_pcm(position_ms); info!("<{}> ({} ms) loaded", audio.name, audio.duration); Some(PlayerLoadedTrackData { - track_meta_data: TrackMetaData { - track_id: spotify_id, - normalisation_factor, - bytes_per_second, - duration_ms, - title: audio.name.clone(), - }, decoder, + normalisation_factor, stream_loader_controller, + bytes_per_second, + duration_ms, stream_position_pcm, }) } @@ -712,14 +729,19 @@ impl Future for PlayerInternal { // Handle loading of a new track to play if let PlayerState::Loading { ref mut loader, + track_id, start_playback, play_request_id, - .. } = self.state { match loader.poll() { Ok(Async::Ready(loaded_track)) => { - self.start_playback(play_request_id, loaded_track, start_playback); + self.start_playback( + track_id, + play_request_id, + loaded_track, + start_playback, + ); if let PlayerState::Loading { .. } = self.state { panic!("The state wasn't changed by start_playback()"); } @@ -733,10 +755,17 @@ impl Future for PlayerInternal { } // handle pending preload requests. - if let PlayerPreload::Loading { ref mut loader, .. } = self.preload { + if let PlayerPreload::Loading { + ref mut loader, + track_id, + } = self.preload + { match loader.poll() { Ok(Async::Ready(loaded_track)) => { - self.preload = PlayerPreload::Ready { loaded_track }; + self.preload = PlayerPreload::Ready { + track_id, + loaded_track, + }; } Ok(Async::NotReady) => (), Err(_) => { @@ -749,16 +778,16 @@ impl Future for PlayerInternal { self.ensure_sink_running(); if let PlayerState::Playing { - ref track_meta_data, + track_id, play_request_id, ref mut decoder, + normalisation_factor, ref mut stream_position_pcm, ref mut reported_nominal_start_time, + duration_ms, .. } = self.state { - let track_meta_data = track_meta_data.clone(); - let normalisation_factor = track_meta_data.normalisation_factor; let packet = decoder.next_packet().expect("Vorbis error"); if let Some(ref packet) = packet { @@ -786,9 +815,10 @@ impl Future for PlayerInternal { - Duration::from_millis(stream_position_millis as u64), ); self.send_event(PlayerEvent::Playing { - track_meta_data, + track_id, play_request_id, position_ms: stream_position_millis as u32, + duration_ms, }); } } @@ -800,16 +830,18 @@ impl Future for PlayerInternal { } if let PlayerState::Playing { - ref track_meta_data, + track_id, play_request_id, + duration_ms, stream_position_pcm, ref mut stream_loader_controller, ref mut suggested_to_preload_next_track, .. } | PlayerState::Paused { - ref track_meta_data, + track_id, play_request_id, + duration_ms, stream_position_pcm, ref mut stream_loader_controller, ref mut suggested_to_preload_next_track, @@ -817,15 +849,13 @@ impl Future for PlayerInternal { } = self.state { if (!*suggested_to_preload_next_track) - && ((track_meta_data.duration_ms as i64 - - Self::position_pcm_to_ms(stream_position_pcm) as i64) + && ((duration_ms as i64 - Self::position_pcm_to_ms(stream_position_pcm) as i64) < PRELOAD_NEXT_TRACK_BEFORE_END_DURATION_MS as i64) && stream_loader_controller.range_to_end_available() { *suggested_to_preload_next_track = true; - let track_meta_data = track_meta_data.clone(); self.send_event(PlayerEvent::TimeToPreloadNextTrack { - track_id: track_meta_data.track_id, + track_id, play_request_id, }); } @@ -872,21 +902,17 @@ impl PlayerInternal { fn handle_player_stop(&mut self) { match self.state { PlayerState::Playing { - track_meta_data: TrackMetaData { track_id, .. }, + track_id, play_request_id, .. } | PlayerState::Paused { - track_meta_data: TrackMetaData { track_id, .. }, + track_id, play_request_id, .. } | PlayerState::EndOfTrack { - loaded_track: - PlayerLoadedTrackData { - track_meta_data: TrackMetaData { track_id, .. }, - .. - }, + track_id, play_request_id, .. } @@ -909,20 +935,21 @@ impl PlayerInternal { fn handle_play(&mut self) { if let PlayerState::Paused { - ref track_meta_data, + track_id, play_request_id, stream_position_pcm, + duration_ms, .. } = self.state { - let track_meta_data = track_meta_data.clone(); self.state.paused_to_playing(); let position_ms = Self::position_pcm_to_ms(stream_position_pcm); self.send_event(PlayerEvent::Playing { - track_meta_data, + track_id, play_request_id, position_ms, + duration_ms, }); self.ensure_sink_running(); } else { @@ -932,22 +959,22 @@ impl PlayerInternal { fn handle_pause(&mut self) { if let PlayerState::Playing { - ref track_meta_data, + track_id, play_request_id, stream_position_pcm, + duration_ms, .. } = self.state { - let track_meta_data = track_meta_data.clone(); - self.state.playing_to_paused(); self.ensure_sink_stopped(); let position_ms = Self::position_pcm_to_ms(stream_position_pcm); self.send_event(PlayerEvent::Paused { - track_meta_data, + track_id, play_request_id, position_ms, + duration_ms, }); } else { warn!("Player::pause called from invalid state"); @@ -978,18 +1005,13 @@ impl PlayerInternal { None => { self.state.playing_to_end_of_track(); if let PlayerState::EndOfTrack { - loaded_track: - PlayerLoadedTrackData { - ref track_meta_data, - .. - }, + track_id, play_request_id, .. } = self.state { - let track_meta_data = track_meta_data.clone(); self.send_event(PlayerEvent::EndOfTrack { - track_meta_data, + track_id, play_request_id, }) } else { @@ -1001,6 +1023,7 @@ impl PlayerInternal { fn start_playback( &mut self, + track_id: SpotifyId, play_request_id: u64, loaded_track: PlayerLoadedTrackData, start_playback: bool, @@ -1011,16 +1034,20 @@ impl PlayerInternal { self.ensure_sink_running(); self.send_event(PlayerEvent::Playing { - track_meta_data: loaded_track.track_meta_data.clone(), + track_id, play_request_id, position_ms, + duration_ms: loaded_track.duration_ms, }); self.state = PlayerState::Playing { - track_meta_data: loaded_track.track_meta_data, + track_id: track_id, play_request_id: play_request_id, decoder: loaded_track.decoder, + normalisation_factor: loaded_track.normalisation_factor, stream_loader_controller: loaded_track.stream_loader_controller, + duration_ms: loaded_track.duration_ms, + bytes_per_second: loaded_track.bytes_per_second, stream_position_pcm: loaded_track.stream_position_pcm, reported_nominal_start_time: Some( Instant::now() - Duration::from_millis(position_ms as u64), @@ -1030,21 +1057,23 @@ impl PlayerInternal { } else { self.ensure_sink_stopped(); - let track_meta_data = loaded_track.track_meta_data.clone(); - self.state = PlayerState::Paused { - track_meta_data: loaded_track.track_meta_data, + track_id: track_id, play_request_id: play_request_id, decoder: loaded_track.decoder, + normalisation_factor: loaded_track.normalisation_factor, stream_loader_controller: loaded_track.stream_loader_controller, + duration_ms: loaded_track.duration_ms, + bytes_per_second: loaded_track.bytes_per_second, stream_position_pcm: loaded_track.stream_position_pcm, suggested_to_preload_next_track: false, }; self.send_event(PlayerEvent::Paused { - track_meta_data, + track_id, play_request_id, position_ms, + duration_ms: loaded_track.duration_ms, }); } } @@ -1062,31 +1091,15 @@ impl PlayerInternal { // emit the correct player event match self.state { PlayerState::Playing { - track_meta_data: - TrackMetaData { - track_id: old_track_id, - .. - }, + track_id: old_track_id, .. } | PlayerState::Paused { - track_meta_data: - TrackMetaData { - track_id: old_track_id, - .. - }, + track_id: old_track_id, .. } | PlayerState::EndOfTrack { - loaded_track: - PlayerLoadedTrackData { - track_meta_data: - TrackMetaData { - track_id: old_track_id, - .. - }, - .. - }, + track_id: old_track_id, .. } | PlayerState::Loading { @@ -1110,18 +1123,16 @@ impl PlayerInternal { // Check if there's a matching loaded track in the EndOfTrack player state. // This is the case if we're repeating the same track again. if let PlayerState::EndOfTrack { - ref mut loaded_track, + track_id: previous_track_id, .. } = self.state { - if loaded_track.track_meta_data.track_id == track_id { + if previous_track_id == track_id { let mut loaded_track = match mem::replace(&mut self.state, PlayerState::Invalid) { PlayerState::EndOfTrack { loaded_track, .. } => loaded_track, _ => unreachable!(), }; - //let loaded_track = mem::replace(&mut *loaded_track, None); - //if let Some(mut loaded_track) = loaded_track { if Self::position_ms_to_pcm(position_ms) != loaded_track.stream_position_pcm { loaded_track .stream_loader_controller @@ -1134,32 +1145,31 @@ impl PlayerInternal { loaded_track.stream_position_pcm = Self::position_ms_to_pcm(position_ms); } self.preload = PlayerPreload::None; - self.start_playback(play_request_id, loaded_track, play); + self.start_playback(track_id, play_request_id, loaded_track, play); if let PlayerState::Invalid = self.state { panic!("start_playback() hasn't set a valid player state."); } return; - //} } } // Check if we are already playing the track. If so, just do a seek and update our info. if let PlayerState::Playing { - ref track_meta_data, + track_id: current_track_id, ref mut stream_position_pcm, ref mut decoder, ref mut stream_loader_controller, .. } | PlayerState::Paused { - ref track_meta_data, + track_id: current_track_id, ref mut stream_position_pcm, ref mut decoder, ref mut stream_loader_controller, .. } = self.state { - if track_meta_data.track_id == track_id { + if current_track_id == track_id { // we can use the current decoder. Ensure it's at the correct position. if Self::position_ms_to_pcm(position_ms) != *stream_position_pcm { stream_loader_controller.set_random_access_mode(); @@ -1173,29 +1183,35 @@ impl PlayerInternal { let old_state = mem::replace(&mut self.state, PlayerState::Invalid); if let PlayerState::Playing { - track_meta_data, stream_position_pcm, decoder, stream_loader_controller, + bytes_per_second, + duration_ms, + normalisation_factor, .. } | PlayerState::Paused { - track_meta_data, stream_position_pcm, decoder, stream_loader_controller, + bytes_per_second, + duration_ms, + normalisation_factor, .. } = old_state { let loaded_track = PlayerLoadedTrackData { - track_meta_data, decoder, + normalisation_factor, stream_loader_controller, + bytes_per_second, + duration_ms, stream_position_pcm, }; self.preload = PlayerPreload::None; - self.start_playback(play_request_id, loaded_track, play); + self.start_playback(track_id, play_request_id, loaded_track, play); if let PlayerState::Invalid = self.state { panic!("start_playback() hasn't set a valid player state."); @@ -1210,17 +1226,17 @@ impl PlayerInternal { // Check if the requested track has been preloaded already. If so use the preloaded data. if let PlayerPreload::Ready { - loaded_track: - PlayerLoadedTrackData { - ref track_meta_data, - .. - }, + track_id: loaded_track_id, .. } = self.preload { - if track_id == track_meta_data.track_id { + if track_id == loaded_track_id { let preload = std::mem::replace(&mut self.preload, PlayerPreload::None); - if let PlayerPreload::Ready { mut loaded_track } = preload { + if let PlayerPreload::Ready { + track_id, + mut loaded_track, + } = preload + { if Self::position_ms_to_pcm(position_ms) != loaded_track.stream_position_pcm { loaded_track .stream_loader_controller @@ -1228,7 +1244,7 @@ impl PlayerInternal { let _ = loaded_track.decoder.seek(position_ms as i64); // This may be blocking loaded_track.stream_loader_controller.set_stream_mode(); } - self.start_playback(play_request_id, loaded_track, play); + self.start_playback(track_id, play_request_id, loaded_track, play); return; } else { unreachable!(); @@ -1293,15 +1309,7 @@ impl PlayerInternal { .. } | PlayerPreload::Ready { - loaded_track: - PlayerLoadedTrackData { - track_meta_data: - TrackMetaData { - track_id: currently_loading, - .. - }, - .. - }, + track_id: currently_loading, .. } = self.preload { @@ -1315,23 +1323,19 @@ impl PlayerInternal { } if let PlayerState::Playing { - ref track_meta_data, + track_id: current_track_id, .. } | PlayerState::Paused { - ref track_meta_data, + track_id: current_track_id, .. } | PlayerState::EndOfTrack { - loaded_track: - PlayerLoadedTrackData { - ref track_meta_data, - .. - }, + track_id: current_track_id, .. } = self.state { - if track_meta_data.track_id == track_id { + if current_track_id == track_id { // we already have the requested track loaded. preload_track = false; } @@ -1378,32 +1382,34 @@ impl PlayerInternal { self.preload_data_before_playback(); if let PlayerState::Playing { - ref track_meta_data, + track_id, play_request_id, ref mut reported_nominal_start_time, + duration_ms, .. } = self.state { *reported_nominal_start_time = Some(Instant::now() - Duration::from_millis(position_ms as u64)); - let track_meta_data = track_meta_data.clone(); self.send_event(PlayerEvent::Playing { - track_meta_data, + track_id, play_request_id, position_ms, + duration_ms, }); } if let PlayerState::Paused { - ref track_meta_data, + track_id, play_request_id, + duration_ms, .. } = self.state { - let track_meta_data = track_meta_data.clone(); self.send_event(PlayerEvent::Paused { - track_meta_data, + track_id, play_request_id, position_ms, + duration_ms, }); } } @@ -1480,7 +1486,7 @@ impl PlayerInternal { fn preload_data_before_playback(&mut self) { if let PlayerState::Playing { - ref track_meta_data, + bytes_per_second, ref mut stream_loader_controller, .. } = self.state @@ -1489,9 +1495,8 @@ impl PlayerInternal { let request_data_length = max( (READ_AHEAD_DURING_PLAYBACK_ROUNDTRIPS * (0.001 * stream_loader_controller.ping_time_ms() as f64) - * track_meta_data.bytes_per_second as f64) as usize, - (READ_AHEAD_DURING_PLAYBACK_SECONDS * track_meta_data.bytes_per_second as f64) - as usize, + * bytes_per_second as f64) as usize, + (READ_AHEAD_DURING_PLAYBACK_SECONDS * bytes_per_second as f64) as usize, ); stream_loader_controller.fetch_next(request_data_length); @@ -1499,9 +1504,8 @@ impl PlayerInternal { let wait_for_data_length = max( (READ_AHEAD_BEFORE_PLAYBACK_ROUNDTRIPS * (0.001 * stream_loader_controller.ping_time_ms() as f64) - * track_meta_data.bytes_per_second as f64) as usize, - (READ_AHEAD_BEFORE_PLAYBACK_SECONDS * track_meta_data.bytes_per_second as f64) - as usize, + * bytes_per_second as f64) as usize, + (READ_AHEAD_BEFORE_PLAYBACK_SECONDS * bytes_per_second as f64) as usize, ); stream_loader_controller.fetch_next_blocking(wait_for_data_length); } diff --git a/src/player_event_handler.rs b/src/player_event_handler.rs index 4809fc22..f2ac0c62 100644 --- a/src/player_event_handler.rs +++ b/src/player_event_handler.rs @@ -1,5 +1,4 @@ use librespot::playback::player::PlayerEvent; -use librespot_playback::player::TrackMetaData; use log::info; use std::collections::HashMap; use std::io; @@ -15,12 +14,6 @@ fn run_program(program: &str, env_vars: HashMap<&str, String>) -> io::Result, track_meta_data: TrackMetaData) { - env_vars.insert("TRACK_ID", track_meta_data.track_id.to_base62()); - env_vars.insert("DURATION_MS", track_meta_data.duration_ms.to_string()); - env_vars.insert("TRACK_TITLE", track_meta_data.title); -} - pub fn run_program_on_events(event: PlayerEvent, onevent: &str) -> Option> { let mut env_vars = HashMap::new(); match event { @@ -41,21 +34,25 @@ pub fn run_program_on_events(event: PlayerEvent, onevent: &str) -> Option { env_vars.insert("PLAYER_EVENT", "playing".to_string()); - add_meta_data_to_env_vars(&mut env_vars, track_meta_data); + env_vars.insert("TRACK_ID", track_id.to_base62()); + env_vars.insert("DURATION_MS", duration_ms.to_string()); env_vars.insert("POSITION_MS", position_ms.to_string()); } PlayerEvent::Paused { - track_meta_data, + track_id, + duration_ms, position_ms, .. } => { env_vars.insert("PLAYER_EVENT", "paused".to_string()); - add_meta_data_to_env_vars(&mut env_vars, track_meta_data); + env_vars.insert("TRACK_ID", track_id.to_base62()); + env_vars.insert("DURATION_MS", duration_ms.to_string()); env_vars.insert("POSITION_MS", position_ms.to_string()); } PlayerEvent::VolumeSet { volume } => { From 9fe82ef7811bcbc18c4ce7a483c4d0373ad2d499 Mon Sep 17 00:00:00 2001 From: kaymes Date: Sat, 25 Apr 2020 21:27:21 +1000 Subject: [PATCH 5/8] Enable pulseaudio device names (#450) Fixes #207 --- playback/src/audio_backend/pulseaudio.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/playback/src/audio_backend/pulseaudio.rs b/playback/src/audio_backend/pulseaudio.rs index e844b0d6..8a833d65 100644 --- a/playback/src/audio_backend/pulseaudio.rs +++ b/playback/src/audio_backend/pulseaudio.rs @@ -12,6 +12,7 @@ pub struct PulseAudioSink { ss: pa_sample_spec, name: CString, desc: CString, + device: Option, } fn call_pulseaudio( @@ -56,10 +57,6 @@ impl Open for PulseAudioSink { fn open(device: Option) -> PulseAudioSink { debug!("Using PulseAudio sink"); - if device.is_some() { - panic!("pulseaudio sink does not support specifying a device name"); - } - let ss = pa_sample_spec { format: PA_SAMPLE_S16LE, channels: 2, // stereo @@ -74,6 +71,7 @@ impl Open for PulseAudioSink { ss: ss, name: name, desc: description, + device: device.and_then(|s| CString::new(s).ok()), } } } @@ -81,13 +79,17 @@ impl Open for PulseAudioSink { impl Sink for PulseAudioSink { fn start(&mut self) -> io::Result<()> { if self.s == null_mut() { + let device = match &self.device { + None => null(), + Some(device) => device.as_ptr(), + }; self.s = call_pulseaudio( |err| unsafe { pa_simple_new( null(), // Use the default server. self.name.as_ptr(), // Our application's name. PA_STREAM_PLAYBACK, - null(), // Use the default device. + device, self.desc.as_ptr(), // desc of our stream. &self.ss, // Our sample format. null(), // Use default channel map From ed0e1eed5a99336b2841006b5a20399676f8bf2b Mon Sep 17 00:00:00 2001 From: v1ne Date: Sat, 2 May 2020 12:14:53 +0200 Subject: [PATCH 6/8] Synchronise name and help: softvol (#470) Using "softmixer" as a mixer backend does not work. Co-authored-by: v1ne --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index ef8dbd7b..64927361 100644 --- a/src/main.rs +++ b/src/main.rs @@ -129,7 +129,7 @@ fn setup(args: &[String]) -> Setup { "Audio device to use. Use '?' to list options if using portaudio or alsa", "DEVICE", ) - .optopt("", "mixer", "Mixer to use (alsa or softmixer)", "MIXER") + .optopt("", "mixer", "Mixer to use (alsa or softvol)", "MIXER") .optopt( "m", "mixer-name", From 98e69ab0c43f435cdc355c5ddec09b18f3ad6318 Mon Sep 17 00:00:00 2001 From: ashthespy Date: Sat, 9 May 2020 16:33:06 +0200 Subject: [PATCH 7/8] Fetch context for Spotify Collection types as well Liked songs for example --- connect/src/spirc.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/connect/src/spirc.rs b/connect/src/spirc.rs index 453327c5..77785e3c 100644 --- a/connect/src/spirc.rs +++ b/connect/src/spirc.rs @@ -917,7 +917,9 @@ impl SpircTask { ); let context_uri = self.state.get_context_uri().to_owned(); if (context_uri.starts_with("spotify:station:") - || context_uri.starts_with("spotify:dailymix:")) + || context_uri.starts_with("spotify:dailymix:") + // spotify:user:xxx:collection + || context_uri.starts_with(&format!("spotify:user:{}:collection",self.session.username()))) && ((self.state.get_track().len() as u32) - new_index) < CONTEXT_FETCH_THRESHOLD { self.context_fut = self.resolve_station(&context_uri); From e47ae83f3313828a345ee1858010790eb5b5a532 Mon Sep 17 00:00:00 2001 From: Ash Date: Sun, 10 May 2020 13:22:19 +0200 Subject: [PATCH 8/8] libmdns housekeeping (#467) * Rename log hooks (mdns-> libmdns) * Bump libmdns --- Cargo.lock | 85 +++++++++++++++++++++++++++------------------- connect/Cargo.toml | 2 +- src/main.rs | 4 +-- 3 files changed, 53 insertions(+), 38 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f7ff7315..cfa63a12 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -267,6 +267,11 @@ dependencies = [ "ppv-lite86 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "c_linked_list" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "cc" version = "1.0.47" @@ -522,6 +527,26 @@ dependencies = [ "typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "get_if_addrs" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "c_linked_list 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "get_if_addrs-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "get_if_addrs-sys" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "gcc 0.3.55 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "getopts" version = "0.2.19" @@ -558,6 +583,16 @@ dependencies = [ "digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "hostname" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "match_cfg 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "httparse" version = "1.3.4" @@ -717,22 +752,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "libmdns" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "get_if_addrs 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "hostname 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "multimap 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", - "nix 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", - "socket2 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -802,7 +834,7 @@ dependencies = [ "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", "hmac 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.11.27 (registry+https://github.com/rust-lang/crates.io-index)", - "libmdns 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "libmdns 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "librespot-core 0.1.1", "librespot-playback 0.1.1", "librespot-protocol 0.1.1", @@ -938,6 +970,11 @@ dependencies = [ "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "match_cfg" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "matches" version = "0.1.8" @@ -1074,19 +1111,6 @@ dependencies = [ "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "nix" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "gcc 0.3.55 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "nodrop" version = "0.1.13" @@ -1745,18 +1769,6 @@ name = "smallvec" version = "0.6.10" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "socket2" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "socket2" version = "0.3.10" @@ -2340,6 +2352,7 @@ dependencies = [ "checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" "checksum bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" "checksum c2-chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7d64d04786e0f528460fc884753cf8dddcc466be308f6026f8e355c41a0e4101" +"checksum c_linked_list 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4964518bd3b4a8190e832886cdc0da9794f12e8e6c1613a9e90ff331c4c8724b" "checksum cc 1.0.47 (registry+https://github.com/rust-lang/crates.io-index)" = "aa87058dce70a3ff5621797f1506cb837edd02ac4c0ae642b4542dce802908b8" "checksum cexpr 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "fce5b5fb86b0c57c20c834c1b412fd09c77c8a59b9473f86272709e78874cd1d" "checksum cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "b486ce3ccf7ffd79fdeb678eac06a9e6c09fc88d33836340becb8fffe87c5e33" @@ -2371,11 +2384,14 @@ dependencies = [ "checksum futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" "checksum gcc 0.3.55 (registry+https://github.com/rust-lang/crates.io-index)" = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2" "checksum generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" +"checksum get_if_addrs 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "abddb55a898d32925f3148bd281174a68eeb68bbfd9a5938a57b18f506ee4ef7" +"checksum get_if_addrs-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0d04f9fb746cf36b191c00f3ede8bde9c8e64f9f4b05ae2694a9ccf5e3f5ab48" "checksum getopts 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)" = "72327b15c228bfe31f1390f93dd5e9279587f0463836393c9df719ce62a3e450" "checksum getrandom 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "e65cce4e5084b14874c4e7097f38cab54f47ee554f9194673456ea379dcc4c55" "checksum glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" "checksum hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" "checksum hmac 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5dcb5e64cda4c23119ab41ba960d1e170a774c8e4b9d9e6a9bc18aabf5e59695" +"checksum hostname 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dc5260e6c63877196b6fca5a7fb4eaff751134045ad3415716192baa36f5b9a0" "checksum httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" "checksum humantime 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3ca7e5f2e110db35f93b837c81797f3714500b81d517bf20c431b16d3ca4f114" "checksum hyper 0.11.27 (registry+https://github.com/rust-lang/crates.io-index)" = "34a590ca09d341e94cddf8e5af0bbccde205d5fbc2fa3c09dd67c7f85cea59d7" @@ -2393,13 +2409,14 @@ dependencies = [ "checksum libloading 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "fd38073de8f7965d0c17d30546d4bb6da311ab428d1c7a3fc71dff7f9d4979b9" "checksum libloading 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" "checksum libm 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" -"checksum libmdns 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "fa04490b2ddac499769cfd1e59e68326c6d52dced8aa262512ad3c82cefba374" +"checksum libmdns 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "cbf720e60dd4443fc6694f2791974061b38f9f332c2f30796fa7c3ac66f367f8" "checksum libpulse-sys 0.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9bb11b06faf883500c1b625cf4453e6c7737e9df9c7ba01df3f84b22b083e4ac" "checksum librespot-tremor 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b155a7dc4e4d272e01c37a1b85c1ee1bee7f04980ad4a7784c1a6e0f2de5929b" "checksum linear-map 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bfae20f6b19ad527b550c223fddc3077a547fc70cda94b9b566575423fd303ee" "checksum lock_api 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "62ebf1391f6acad60e5c8b43706dde4582df75c06698ab44511d15016bc2442c" "checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" "checksum log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "c275b6ad54070ac2d665eef9197db647b32239c9d244bfb6f041a766d00da5b3" +"checksum match_cfg 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" "checksum matrixmultiply 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dcfed72d871629daa12b25af198f110e8095d7650f5f4c61c5bac28364604f9b" "checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" @@ -2413,7 +2430,6 @@ dependencies = [ "checksum multimap 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2eb04b9f127583ed176e163fb9ec6f3e793b87e21deedd5734a69386a18a0151" "checksum nalgebra 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8e12856109b5cb8e2934b5e45e4624839416e1c6c1f7d286711a7a66b79db29d" "checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88" -"checksum nix 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b7fd5681d13fda646462cfbd4e5f2051279a89a544d50eb98c365b507246839f" "checksum nix 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a2c5afeb0198ec7be8569d666644b574345aad2e95a53baf3a532da3e0f3fb32" "checksum nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9667ddcc6cc8a43afc9b7917599d7216aa09c463919ea32c59ed6cac8bc945" "checksum nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6" @@ -2497,7 +2513,6 @@ dependencies = [ "checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" "checksum smallvec 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4c8cbcd6df1e117c2210e13ab5109635ad68a929fcbb8964dc965b76cb5ee013" "checksum smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "ab606a9c5e214920bb66c458cd7be8ef094f813f20fe77a54cc7dbfff220d4b7" -"checksum socket2 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "36b4896961171cd3317c7e9603d88f379f8c6e45342212235d356496680c68fd" "checksum socket2 0.3.10 (registry+https://github.com/rust-lang/crates.io-index)" = "df028e0e632c2a1823d920ad74895e7f9128e6438cbc4bc6fd1f180e644767b9" "checksum spin 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "44363f6f51401c34e7be73db0db371c04705d35efbe9f7d6082e03a921a32c55" "checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" diff --git a/connect/Cargo.toml b/connect/Cargo.toml index 25b49635..67bce1eb 100644 --- a/connect/Cargo.toml +++ b/connect/Cargo.toml @@ -35,7 +35,7 @@ aes-ctr = "0.3" block-modes = "0.3" dns-sd = { version = "0.1.3", optional = true } -libmdns = { version = "0.2.4", optional = true } +libmdns = { version = "0.2.5", optional = true } [features] default = ["libmdns"] diff --git a/src/main.rs b/src/main.rs index 64927361..130d6235 100644 --- a/src/main.rs +++ b/src/main.rs @@ -51,9 +51,9 @@ fn setup_logging(verbose: bool) { } Err(_) => { if verbose { - builder.parse_filters("mdns=info,librespot=trace"); + builder.parse_filters("libmdns=info,librespot=trace"); } else { - builder.parse_filters("mdns=info,librespot=info"); + builder.parse_filters("libmdns=info,librespot=info"); } builder.init(); }