From cb2323bc3276c3f1194c9a7857522e6fb50d57e5 Mon Sep 17 00:00:00 2001 From: joren Date: Tue, 24 Mar 2026 00:41:04 +0100 Subject: [PATCH] feat: initial qobuz-qt source Lightweight Qt6 desktop client for Qobuz with a Rust audio backend (Symphonia/CPAL via staticlib FFI). Mirrors the spotify-qt layout: toolbar with playback controls, library/context docks on the left, tabbed search side panel on the right, queue panel, now-playing dock. Co-Authored-By: Claude Sonnet 4.6 --- .gitignore | 7 +- BUILD.md | 24 + CMakeLists.txt | 41 +- Cargo.lock | 2602 ++++++++++++++++++++++ res.qrc | 66 +- res/icons/application-exit.svg | 13 + res/icons/application-menu.svg | 14 + res/icons/audio-volume-high.svg | 13 + res/icons/audio-volume-low.svg | 12 + res/icons/audio-volume-medium.svg | 13 + res/icons/configure.svg | 13 + res/icons/data-error.svg | 9 + res/icons/data-information.svg | 9 + res/icons/data-warning.svg | 9 + res/icons/description.svg | 14 + res/icons/dialog-cancel.svg | 14 + res/icons/dialog-ok.svg | 14 + res/icons/document-edit.svg | 14 + res/icons/document-preview.svg | 11 + res/icons/document-properties.svg | 14 + res/icons/document-save.svg | 14 + res/icons/document-share.svg | 14 + res/icons/download.svg | 14 + res/icons/draw-brush.svg | 14 + res/icons/draw-donut.svg | 9 + res/icons/edit-copy.svg | 11 + res/icons/edit-find.svg | 14 + res/icons/edit-undo.svg | 14 + res/icons/exception.svg | 14 + res/icons/folder-temp.svg | 13 + res/icons/folder-txt.svg | 14 + res/icons/go-down.svg | 14 + res/icons/go-previous.svg | 14 + res/icons/go-up.svg | 10 + res/icons/headphones.svg | 14 + res/icons/help-about.svg | 14 + res/icons/hint.svg | 14 + res/icons/im-user-away.svg | 7 + res/icons/list-add.svg | 14 + res/icons/list-remove.svg | 10 + res/icons/media-optical-audio.svg | 14 + res/icons/media-playback-pause.svg | 8 + res/icons/media-playback-start.svg | 8 + res/icons/media-playlist-append.svg | 14 + res/icons/media-playlist-repeat-song.svg | 12 + res/icons/media-playlist-repeat.svg | 10 + res/icons/media-playlist-shuffle.svg | 14 + res/icons/media-skip-backward.svg | 8 + res/icons/media-skip-forward.svg | 8 + res/icons/media-track-show-active.svg | 22 + res/icons/non-starred-symbolic.svg | 10 + res/icons/speaker.svg | 14 + res/icons/starred-symbolic.svg | 10 + res/icons/view-calendar.svg | 14 + res/icons/view-media-album-cover.svg | 14 + res/icons/view-media-artist.svg | 14 + res/icons/view-media-lyrics.svg | 17 + res/icons/view-media-playlist.svg | 14 + res/icons/view-media-track.svg | 14 + res/icons/view-refresh.svg | 8 + res/icons/view-sort-ascending.svg | 12 + res/icons/view-statistics.svg | 14 + res/icons/visibility.svg | 14 + res/icons/window-close.svg | 10 + res/icons/window-maximize.svg | 10 + res/icons/window-minimize.svg | 14 + res/icons/window-restore.svg | 10 + res/icons/window.svg | 14 + src/CMakeLists.txt | 7 + src/list/tracks.cpp | 119 +- src/list/tracks.hpp | 17 +- src/mainwindow.cpp | 126 +- src/mainwindow.hpp | 22 +- src/model/tracklistmodel.cpp | 125 +- src/model/tracklistmodel.hpp | 34 +- src/playqueue.hpp | 225 ++ src/util/icon.hpp | 36 +- src/view/context/view.cpp | 88 + src/view/context/view.hpp | 32 + src/view/maincontent.cpp | 20 +- src/view/maincontent.hpp | 15 +- src/view/maintoolbar.cpp | 161 +- src/view/maintoolbar.hpp | 41 +- src/view/queuepanel.cpp | 111 + src/view/queuepanel.hpp | 27 + 85 files changed, 4484 insertions(+), 249 deletions(-) create mode 100644 Cargo.lock create mode 100644 res/icons/application-exit.svg create mode 100644 res/icons/application-menu.svg create mode 100644 res/icons/audio-volume-high.svg create mode 100644 res/icons/audio-volume-low.svg create mode 100644 res/icons/audio-volume-medium.svg create mode 100644 res/icons/configure.svg create mode 100644 res/icons/data-error.svg create mode 100644 res/icons/data-information.svg create mode 100644 res/icons/data-warning.svg create mode 100644 res/icons/description.svg create mode 100644 res/icons/dialog-cancel.svg create mode 100644 res/icons/dialog-ok.svg create mode 100644 res/icons/document-edit.svg create mode 100644 res/icons/document-preview.svg create mode 100644 res/icons/document-properties.svg create mode 100644 res/icons/document-save.svg create mode 100644 res/icons/document-share.svg create mode 100644 res/icons/download.svg create mode 100644 res/icons/draw-brush.svg create mode 100644 res/icons/draw-donut.svg create mode 100644 res/icons/edit-copy.svg create mode 100644 res/icons/edit-find.svg create mode 100644 res/icons/edit-undo.svg create mode 100644 res/icons/exception.svg create mode 100644 res/icons/folder-temp.svg create mode 100644 res/icons/folder-txt.svg create mode 100644 res/icons/go-down.svg create mode 100644 res/icons/go-previous.svg create mode 100644 res/icons/go-up.svg create mode 100644 res/icons/headphones.svg create mode 100644 res/icons/help-about.svg create mode 100644 res/icons/hint.svg create mode 100644 res/icons/im-user-away.svg create mode 100644 res/icons/list-add.svg create mode 100644 res/icons/list-remove.svg create mode 100644 res/icons/media-optical-audio.svg create mode 100644 res/icons/media-playback-pause.svg create mode 100644 res/icons/media-playback-start.svg create mode 100644 res/icons/media-playlist-append.svg create mode 100644 res/icons/media-playlist-repeat-song.svg create mode 100644 res/icons/media-playlist-repeat.svg create mode 100644 res/icons/media-playlist-shuffle.svg create mode 100644 res/icons/media-skip-backward.svg create mode 100644 res/icons/media-skip-forward.svg create mode 100644 res/icons/media-track-show-active.svg create mode 100644 res/icons/non-starred-symbolic.svg create mode 100644 res/icons/speaker.svg create mode 100644 res/icons/starred-symbolic.svg create mode 100644 res/icons/view-calendar.svg create mode 100644 res/icons/view-media-album-cover.svg create mode 100644 res/icons/view-media-artist.svg create mode 100644 res/icons/view-media-lyrics.svg create mode 100644 res/icons/view-media-playlist.svg create mode 100644 res/icons/view-media-track.svg create mode 100644 res/icons/view-refresh.svg create mode 100644 res/icons/view-sort-ascending.svg create mode 100644 res/icons/view-statistics.svg create mode 100644 res/icons/visibility.svg create mode 100644 res/icons/window-close.svg create mode 100644 res/icons/window-maximize.svg create mode 100644 res/icons/window-minimize.svg create mode 100644 res/icons/window-restore.svg create mode 100644 res/icons/window.svg create mode 100644 src/playqueue.hpp create mode 100644 src/view/context/view.cpp create mode 100644 src/view/context/view.hpp create mode 100644 src/view/queuepanel.cpp create mode 100644 src/view/queuepanel.hpp diff --git a/.gitignore b/.gitignore index 98ee006..20f46fc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ build/ target/ -*.o -*.a -*.so -Cargo.lock +.cache/ +*.user +*.autosave diff --git a/BUILD.md b/BUILD.md index aa818aa..a611440 100644 --- a/BUILD.md +++ b/BUILD.md @@ -20,6 +20,30 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh source "$HOME/.cargo/env" ``` +### Alpine Linux +```bash +sudo apk add \ + cmake \ + ninja \ + qt6-qtbase-dev \ + qt6-qtsvg-dev \ + openssl-dev \ + alsa-lib-dev \ + dbus-dev \ + pkgconf \ + curl \ + musl-dev \ + gcc \ + g++ + +# Rust toolchain +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh +source "$HOME/.cargo/env" +``` + +> **Note:** CPAL uses ALSA on Alpine. If you prefer PipeWire/PulseAudio, +> install `pipewire-alsa` so ALSA routes through it automatically. + ### Arch Linux ```bash sudo pacman -S cmake ninja qt6-base qt6-svg openssl alsa-lib rust diff --git a/CMakeLists.txt b/CMakeLists.txt index 40a8f72..665936f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,16 +25,35 @@ if (USE_DBUS) find_package(Qt6 OPTIONAL_COMPONENTS DBus QUIET) endif () -# ----- Rust backend via corrosion ----- -include(FetchContent) -FetchContent_Declare( - Corrosion - GIT_REPOSITORY https://github.com/corrosion-rs/corrosion.git - GIT_TAG v0.5 -) -FetchContent_MakeAvailable(Corrosion) +# ----- Rust backend (cargo) ----- +# Don't use find_program — it caches a full path that may differ across machines. +# 'cargo' is resolved via PATH at build time. +set(CARGO_CMD cargo) -corrosion_import_crate(MANIFEST_PATH rust/Cargo.toml CRATES qobuz-backend) +if(CMAKE_BUILD_TYPE STREQUAL "Release") + set(CARGO_PROFILE release) + set(CARGO_PROFILE_FLAG --release) +else() + set(CARGO_PROFILE debug) + set(CARGO_PROFILE_FLAG "") +endif() + +set(RUST_LIB "${CMAKE_SOURCE_DIR}/target/${CARGO_PROFILE}/libqobuz_backend.a") + +add_custom_target(rust_backend ALL + COMMAND ${CARGO_CMD} build ${CARGO_PROFILE_FLAG} + --manifest-path "${CMAKE_SOURCE_DIR}/Cargo.toml" + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" + COMMENT "Building Rust backend (cargo ${CARGO_PROFILE})" + BYPRODUCTS "${RUST_LIB}" +) + +# Imported static library so CMake knows it's a link input +add_library(qobuz_backend_lib STATIC IMPORTED GLOBAL) +set_target_properties(qobuz_backend_lib PROPERTIES + IMPORTED_LOCATION "${RUST_LIB}" +) +add_dependencies(qobuz_backend_lib rust_backend) # Create main executable add_executable(qobuz-qt res.qrc) @@ -42,6 +61,8 @@ add_executable(qobuz-qt res.qrc) # Source files add_subdirectory(src) +add_dependencies(qobuz-qt rust_backend) + # Include paths target_include_directories(qobuz-qt PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/src" @@ -59,7 +80,7 @@ target_link_libraries(qobuz-qt PRIVATE Qt6::Network Qt6::Gui Qt6::Svg - qobuz-backend + qobuz_backend_lib ) # Platform-specific system libs needed by the Rust audio stack (cpal/ALSA) diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..f9fdd46 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,2602 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "aho-corasick" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" +dependencies = [ + "memchr", +] + +[[package]] +name = "alsa" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed7572b7ba83a31e20d1b48970ee402d2e3e0537dcfe0a3ff4d6eb7508617d43" +dependencies = [ + "alsa-sys", + "bitflags 2.11.0", + "cfg-if", + "libc", +] + +[[package]] +name = "alsa-sys" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db8fee663d06c4e303404ef5f40488a53e062f89ba8bfed81f42325aafad1527" +dependencies = [ + "libc", + "pkg-config", +] + +[[package]] +name = "anyhow" +version = "1.0.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bindgen" +version = "0.72.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "993776b509cfb49c750f11b8f07a46fa23e0a1386ffc01fb1e7d343efc387895" +dependencies = [ + "bitflags 2.11.0", + "cexpr", + "clang-sys", + "itertools", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" + +[[package]] +name = "bumpalo" +version = "3.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" + +[[package]] +name = "bytemuck" +version = "1.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8efb64bd706a16a1bdde310ae86b351e4d21550d98d056f22f8a7f7a2183fec" + +[[package]] +name = "bytes" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" + +[[package]] +name = "cc" +version = "1.2.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a0dd1ca384932ff3641c8718a02769f1698e7563dc6974ffd03346116310423" +dependencies = [ + "find-msvc-tools", + "jobserver", + "libc", + "shlex", +] + +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading 0.8.9", +] + +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "coreaudio-rs" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "321077172d79c662f64f5071a03120748d5bb652f5231570141be24cfcd2bace" +dependencies = [ + "bitflags 1.3.2", + "core-foundation-sys", + "coreaudio-sys", +] + +[[package]] +name = "coreaudio-sys" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ceec7a6067e62d6f931a2baf6f3a751f4a892595bcec1461a3c94ef9949864b6" +dependencies = [ + "bindgen", +] + +[[package]] +name = "cpal" +version = "0.15.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "873dab07c8f743075e57f524c583985fbaf745602acbe916a01539364369a779" +dependencies = [ + "alsa", + "core-foundation-sys", + "coreaudio-rs", + "dasp_sample", + "jack", + "jni", + "js-sys", + "libc", + "mach2", + "ndk", + "ndk-context", + "oboe", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "windows", +] + +[[package]] +name = "dasp_sample" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c87e182de0887fd5361989c677c4e8f5000cd9491d6d563161a8f3a5519fc7f" + +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "encoding_rs" +version = "0.8.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "extended" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af9673d8203fcb076b19dfd17e38b3d4ae9f44959416ea532ce72415a6020365" + +[[package]] +name = "find-msvc-tools" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures-channel" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" + +[[package]] +name = "futures-io" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" + +[[package]] +name = "futures-macro" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" + +[[package]] +name = "futures-task" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" + +[[package]] +name = "futures-util" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" +dependencies = [ + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "slab", +] + +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "r-efi", + "wasip2", + "wasm-bindgen", +] + +[[package]] +name = "glob" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" + +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" + +[[package]] +name = "http" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" +dependencies = [ + "bytes", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "hyper" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ab2d4f250c3d7b1c9fcdff1cece94ea4e2dfbec68614f7b87cb205f24ca9d11" +dependencies = [ + "atomic-waker", + "bytes", + "futures-channel", + "futures-core", + "http", + "http-body", + "httparse", + "itoa", + "pin-project-lite", + "pin-utils", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" +dependencies = [ + "http", + "hyper", + "hyper-util", + "rustls", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "tower-service", + "webpki-roots", +] + +[[package]] +name = "hyper-util" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" +dependencies = [ + "base64", + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "ipnet", + "libc", + "percent-encoding", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", +] + +[[package]] +name = "icu_collections" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43" +dependencies = [ + "displaydoc", + "potential_utf", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" + +[[package]] +name = "icu_properties" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec" +dependencies = [ + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af" + +[[package]] +name = "icu_provider" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indexmap" +version = "2.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "ipnet" +version = "2.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2" + +[[package]] +name = "iri-string" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8e7418f59cc01c88316161279a7f665217ae316b388e58a0d10e29f54f1e5eb" +dependencies = [ + "memchr", + "serde", +] + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "jack" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e5a18a3c2aefb354fb77111ade228b20267bdc779de84e7a4ccf7ea96b9a6cd" +dependencies = [ + "bitflags 1.3.2", + "jack-sys", + "lazy_static", + "libc", + "log", +] + +[[package]] +name = "jack-sys" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6013b7619b95a22b576dfb43296faa4ecbe40abbdb97dfd22ead520775fc86ab" +dependencies = [ + "bitflags 1.3.2", + "lazy_static", + "libc", + "libloading 0.7.4", + "log", + "pkg-config", +] + +[[package]] +name = "jni" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +dependencies = [ + "cesu8", + "cfg-if", + "combine", + "jni-sys 0.3.1", + "log", + "thiserror 1.0.69", + "walkdir", + "windows-sys 0.45.0", +] + +[[package]] +name = "jni-sys" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41a652e1f9b6e0275df1f15b32661cf0d4b78d4d87ddec5e0c3c20f097433258" +dependencies = [ + "jni-sys 0.4.1", +] + +[[package]] +name = "jni-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6377a88cb3910bee9b0fa88d4f42e1d2da8e79915598f65fb0c7ee14c878af2" +dependencies = [ + "jni-sys-macros", +] + +[[package]] +name = "jni-sys-macros" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "jobserver" +version = "0.1.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" +dependencies = [ + "getrandom 0.3.4", + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b49715b7073f385ba4bc528e5747d02e66cb39c6146efb66b781f131f0fb399c" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.183" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b646652bf6661599e1da8901b3b9522896f01e736bad5f723fe7a3a27f899d" + +[[package]] +name = "libloading" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +dependencies = [ + "cfg-if", + "winapi", +] + +[[package]] +name = "libloading" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55" +dependencies = [ + "cfg-if", + "windows-link", +] + +[[package]] +name = "libredox" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1744e39d1d6a9948f4f388969627434e31128196de472883b39f148769bfe30a" +dependencies = [ + "libc", +] + +[[package]] +name = "litemap" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" + +[[package]] +name = "lru-slab" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" + +[[package]] +name = "mach2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d640282b302c0bb0a2a8e0233ead9035e3bed871f0b7e81fe4a1ec829765db44" +dependencies = [ + "libc", +] + +[[package]] +name = "md5" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" + +[[package]] +name = "memchr" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "mio" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.61.2", +] + +[[package]] +name = "ndk" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2076a31b7010b17a38c01907c45b945e8f11495ee4dd588309718901b1f7a5b7" +dependencies = [ + "bitflags 2.11.0", + "jni-sys 0.3.1", + "log", + "ndk-sys", + "num_enum", + "thiserror 1.0.69", +] + +[[package]] +name = "ndk-context" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" + +[[package]] +name = "ndk-sys" +version = "0.5.0+25.2.9519653" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c196769dd60fd4f363e11d948139556a344e79d451aeb2fa2fd040738ef7691" +dependencies = [ + "jni-sys 0.3.1", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_enum" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d0bca838442ec211fa11de3a8b0e0e8f3a4522575b5c4c06ed722e005036f26" +dependencies = [ + "num_enum_derive", + "rustversion", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "680998035259dcfcafe653688bf2aa6d3e2dc05e98be6ab46afb089dc84f1df8" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "oboe" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8b61bebd49e5d43f5f8cc7ee2891c16e0f41ec7954d36bcb6c14c5e0de867fb" +dependencies = [ + "jni", + "ndk", + "ndk-context", + "num-derive", + "num-traits", + "oboe-sys", +] + +[[package]] +name = "oboe-sys" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8bb09a4a2b1d668170cfe0a7d5bc103f8999fb316c98099b6a9939c9f2e79d" +dependencies = [ + "cc", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link", +] + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[package]] +name = "potential_utf" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" +dependencies = [ + "zerovec", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "proc-macro-crate" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" +dependencies = [ + "toml_edit 0.25.8+spec-1.1.0", +] + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "qobuz-backend" +version = "0.1.0" +dependencies = [ + "anyhow", + "cpal", + "dirs", + "md5", + "rb", + "reqwest", + "serde", + "serde_json", + "symphonia", + "thiserror 2.0.18", + "tokio", + "toml", +] + +[[package]] +name = "quinn" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" +dependencies = [ + "bytes", + "cfg_aliases", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror 2.0.18", + "tokio", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-proto" +version = "0.11.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "434b42fec591c96ef50e21e886936e66d3cc3f737104fdb9b737c40ffb94c098" +dependencies = [ + "bytes", + "getrandom 0.3.4", + "lru-slab", + "rand", + "ring", + "rustc-hash", + "rustls", + "rustls-pki-types", + "slab", + "thiserror 2.0.18", + "tinyvec", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-udp" +version = "0.5.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" +dependencies = [ + "cfg_aliases", + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.60.2", +] + +[[package]] +name = "quote" +version = "1.0.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "rand" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" +dependencies = [ + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" +dependencies = [ + "getrandom 0.3.4", +] + +[[package]] +name = "rb" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a27f4c5756bd2bfb5942758d8168805655c62388eef0544e581a2bfa5b532f15" + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags 2.11.0", +] + +[[package]] +name = "redox_users" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +dependencies = [ + "getrandom 0.2.17", + "libredox", + "thiserror 1.0.69", +] + +[[package]] +name = "regex" +version = "1.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" + +[[package]] +name = "reqwest" +version = "0.12.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147" +dependencies = [ + "base64", + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-util", + "js-sys", + "log", + "percent-encoding", + "pin-project-lite", + "quinn", + "rustls", + "rustls-pki-types", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tokio-rustls", + "tokio-util", + "tower", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", + "webpki-roots", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.17", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustc-hash" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" + +[[package]] +name = "rustls" +version = "0.23.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "758025cb5fccfd3bc2fd74708fd4682be41d99e5dff73c377c0646c6012c73a4" +dependencies = [ + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pki-types" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd" +dependencies = [ + "web-time", + "zeroize", +] + +[[package]] +name = "rustls-webpki" +version = "0.103.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df33b2b81ac578cabaf06b89b0631153a3f416b0a886e8a7a1707fb51abbd1ef" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "ryu" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.149" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "serde_spanned" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook-registry" +version = "1.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" +dependencies = [ + "errno", + "libc", +] + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "socket2" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "symphonia" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5773a4c030a19d9bfaa090f49746ff35c75dfddfa700df7a5939d5e076a57039" +dependencies = [ + "lazy_static", + "symphonia-bundle-flac", + "symphonia-bundle-mp3", + "symphonia-codec-aac", + "symphonia-codec-adpcm", + "symphonia-codec-alac", + "symphonia-codec-pcm", + "symphonia-codec-vorbis", + "symphonia-core", + "symphonia-format-caf", + "symphonia-format-isomp4", + "symphonia-format-mkv", + "symphonia-format-ogg", + "symphonia-format-riff", + "symphonia-metadata", +] + +[[package]] +name = "symphonia-bundle-flac" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c91565e180aea25d9b80a910c546802526ffd0072d0b8974e3ebe59b686c9976" +dependencies = [ + "log", + "symphonia-core", + "symphonia-metadata", + "symphonia-utils-xiph", +] + +[[package]] +name = "symphonia-bundle-mp3" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4872dd6bb56bf5eac799e3e957aa1981086c3e613b27e0ac23b176054f7c57ed" +dependencies = [ + "lazy_static", + "log", + "symphonia-core", + "symphonia-metadata", +] + +[[package]] +name = "symphonia-codec-aac" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c263845aa86881416849c1729a54c7f55164f8b96111dba59de46849e73a790" +dependencies = [ + "lazy_static", + "log", + "symphonia-core", +] + +[[package]] +name = "symphonia-codec-adpcm" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dddc50e2bbea4cfe027441eece77c46b9f319748605ab8f3443350129ddd07f" +dependencies = [ + "log", + "symphonia-core", +] + +[[package]] +name = "symphonia-codec-alac" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8413fa754942ac16a73634c9dfd1500ed5c61430956b33728567f667fdd393ab" +dependencies = [ + "log", + "symphonia-core", +] + +[[package]] +name = "symphonia-codec-pcm" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e89d716c01541ad3ebe7c91ce4c8d38a7cf266a3f7b2f090b108fb0cb031d95" +dependencies = [ + "log", + "symphonia-core", +] + +[[package]] +name = "symphonia-codec-vorbis" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f025837c309cd69ffef572750b4a2257b59552c5399a5e49707cc5b1b85d1c73" +dependencies = [ + "log", + "symphonia-core", + "symphonia-utils-xiph", +] + +[[package]] +name = "symphonia-core" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea00cc4f79b7f6bb7ff87eddc065a1066f3a43fe1875979056672c9ef948c2af" +dependencies = [ + "arrayvec", + "bitflags 1.3.2", + "bytemuck", + "lazy_static", + "log", +] + +[[package]] +name = "symphonia-format-caf" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8faf379316b6b6e6bbc274d00e7a592e0d63ff1a7e182ce8ba25e24edd3d096" +dependencies = [ + "log", + "symphonia-core", + "symphonia-metadata", +] + +[[package]] +name = "symphonia-format-isomp4" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "243739585d11f81daf8dac8d9f3d18cc7898f6c09a259675fc364b382c30e0a5" +dependencies = [ + "encoding_rs", + "log", + "symphonia-core", + "symphonia-metadata", + "symphonia-utils-xiph", +] + +[[package]] +name = "symphonia-format-mkv" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "122d786d2c43a49beb6f397551b4a050d8229eaa54c7ddf9ee4b98899b8742d0" +dependencies = [ + "lazy_static", + "log", + "symphonia-core", + "symphonia-metadata", + "symphonia-utils-xiph", +] + +[[package]] +name = "symphonia-format-ogg" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b4955c67c1ed3aa8ae8428d04ca8397fbef6a19b2b051e73b5da8b1435639cb" +dependencies = [ + "log", + "symphonia-core", + "symphonia-metadata", + "symphonia-utils-xiph", +] + +[[package]] +name = "symphonia-format-riff" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2d7c3df0e7d94efb68401d81906eae73c02b40d5ec1a141962c592d0f11a96f" +dependencies = [ + "extended", + "log", + "symphonia-core", + "symphonia-metadata", +] + +[[package]] +name = "symphonia-metadata" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36306ff42b9ffe6e5afc99d49e121e0bd62fe79b9db7b9681d48e29fa19e6b16" +dependencies = [ + "encoding_rs", + "lazy_static", + "log", + "symphonia-core", +] + +[[package]] +name = "symphonia-utils-xiph" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27c85ab799a338446b68eec77abf42e1a6f1bb490656e121c6e27bfbab9f16" +dependencies = [ + "symphonia-core", + "symphonia-metadata", +] + +[[package]] +name = "syn" +version = "2.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +dependencies = [ + "thiserror-impl 2.0.18", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tinystr" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27ad5e34374e03cfffefc301becb44e9dc3c17584f414349ebe29ed26661822d" +dependencies = [ + "bytes", + "libc", + "mio", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.61.2", +] + +[[package]] +name = "tokio-macros" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c55a2eff8b69ce66c84f85e1da1c233edc36ceb85a2058d11b0d6a3c7e7569c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime 0.6.11", + "toml_edit 0.22.27", +] + +[[package]] +name = "toml_datetime" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_datetime" +version = "1.1.0+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97251a7c317e03ad83774a8752a7e81fb6067740609f75ea2b585b569a59198f" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_edit" +version = "0.22.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime 0.6.11", + "toml_write", + "winnow 0.7.15", +] + +[[package]] +name = "toml_edit" +version = "0.25.8+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16bff38f1d86c47f9ff0647e6838d7bb362522bdf44006c7068c2b1e606f1f3c" +dependencies = [ + "indexmap", + "toml_datetime 1.1.0+spec-1.1.0", + "toml_parser", + "winnow 1.0.0", +] + +[[package]] +name = "toml_parser" +version = "1.1.0+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2334f11ee363607eb04df9b8fc8a13ca1715a72ba8662a26ac285c98aabb4011" +dependencies = [ + "winnow 1.0.0", +] + +[[package]] +name = "toml_write" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" + +[[package]] +name = "tower" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-http" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" +dependencies = [ + "bitflags 2.11.0", + "bytes", + "futures-util", + "http", + "http-body", + "iri-string", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasip2" +version = "1.0.2+wasi-0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6532f9a5c1ece3798cb1c2cfdba640b9b3ba884f5db45973a6f442510a87d38e" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9c5522b3a28661442748e09d40924dfb9ca614b21c00d3fd135720e48b67db8" +dependencies = [ + "cfg-if", + "futures-util", + "js-sys", + "once_cell", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18a2d50fcf105fb33bb15f00e7a77b772945a2ee45dcf454961fd843e74c18e6" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03ce4caeaac547cdf713d280eda22a730824dd11e6b8c3ca9e42247b25c631e3" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75a326b8c223ee17883a4251907455a2431acc2791c98c26279376490c378c16" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasm-streams" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "web-sys" +version = "0.3.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "854ba17bb104abfb26ba36da9729addc7ce7f06f5c0f90f3c391f8461cca21f9" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-roots" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22cfaf3c063993ff62e73cb4311efde4db1efb31ab78a3e5c457939ad5cc0bed" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.54.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9252e5725dbed82865af151df558e754e4a3c2c30818359eb17465f1346a1b49" +dependencies = [ + "windows-core", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.54.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12661b9c89351d684a50a8a643ce5f608e20243b9fb84687800163429f161d65" +dependencies = [ + "windows-result", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-result" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.5", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm 0.53.1", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" + +[[package]] +name = "winnow" +version = "0.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945" +dependencies = [ + "memchr", +] + +[[package]] +name = "winnow" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a90e88e4667264a994d34e6d1ab2d26d398dcdca8b7f52bec8668957517fc7d8" +dependencies = [ + "memchr", +] + +[[package]] +name = "wit-bindgen" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" + +[[package]] +name = "writeable" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" + +[[package]] +name = "yoke" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.8.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efbb2a062be311f2ba113ce66f697a4dc589f85e78a4aea276200804cea0ed87" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e8bc7269b54418e7aeeef514aa68f8690b8c0489a06b0136e5f57c4c5ccab89" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" + +[[package]] +name = "zerotrie" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zmij" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" diff --git a/res.qrc b/res.qrc index 34c02d5..bf91b06 100644 --- a/res.qrc +++ b/res.qrc @@ -1,6 +1,68 @@ - - + + res/icons/application-exit.svg + res/icons/application-menu.svg + res/icons/audio-volume-high.svg + res/icons/audio-volume-low.svg + res/icons/audio-volume-medium.svg + res/icons/configure.svg + res/icons/data-error.svg + res/icons/data-information.svg + res/icons/data-warning.svg + res/icons/description.svg + res/icons/dialog-cancel.svg + res/icons/dialog-ok.svg + res/icons/document-edit.svg + res/icons/document-preview.svg + res/icons/document-properties.svg + res/icons/document-save.svg + res/icons/document-share.svg + res/icons/download.svg + res/icons/draw-brush.svg + res/icons/draw-donut.svg + res/icons/edit-copy.svg + res/icons/edit-find.svg + res/icons/edit-undo.svg + res/icons/exception.svg + res/icons/folder-temp.svg + res/icons/folder-txt.svg + res/icons/go-down.svg + res/icons/go-previous.svg + res/icons/go-up.svg + res/icons/headphones.svg + res/icons/help-about.svg + res/icons/hint.svg + res/icons/im-user-away.svg + res/icons/list-add.svg + res/icons/list-remove.svg + res/icons/media-optical-audio.svg + res/icons/media-playback-pause.svg + res/icons/media-playback-start.svg + res/icons/media-playlist-append.svg + res/icons/media-playlist-repeat-song.svg + res/icons/media-playlist-repeat.svg + res/icons/media-playlist-shuffle.svg + res/icons/media-skip-backward.svg + res/icons/media-skip-forward.svg + res/icons/media-track-show-active.svg + res/icons/non-starred-symbolic.svg + res/icons/speaker.svg + res/icons/starred-symbolic.svg + res/icons/view-calendar.svg + res/icons/view-media-album-cover.svg + res/icons/view-media-artist.svg + res/icons/view-media-lyrics.svg + res/icons/view-media-playlist.svg + res/icons/view-media-track.svg + res/icons/view-refresh.svg + res/icons/view-sort-ascending.svg + res/icons/view-statistics.svg + res/icons/visibility.svg + res/icons/window-close.svg + res/icons/window-maximize.svg + res/icons/window-minimize.svg + res/icons/window-restore.svg + res/icons/window.svg diff --git a/res/icons/application-exit.svg b/res/icons/application-exit.svg new file mode 100644 index 0000000..941976a --- /dev/null +++ b/res/icons/application-exit.svg @@ -0,0 +1,13 @@ + + + + + + diff --git a/res/icons/application-menu.svg b/res/icons/application-menu.svg new file mode 100644 index 0000000..f685e76 --- /dev/null +++ b/res/icons/application-menu.svg @@ -0,0 +1,14 @@ + + + + + + diff --git a/res/icons/audio-volume-high.svg b/res/icons/audio-volume-high.svg new file mode 100644 index 0000000..e964066 --- /dev/null +++ b/res/icons/audio-volume-high.svg @@ -0,0 +1,13 @@ + + + + + + + + + diff --git a/res/icons/audio-volume-low.svg b/res/icons/audio-volume-low.svg new file mode 100644 index 0000000..144c991 --- /dev/null +++ b/res/icons/audio-volume-low.svg @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/res/icons/audio-volume-medium.svg b/res/icons/audio-volume-medium.svg new file mode 100644 index 0000000..195a01e --- /dev/null +++ b/res/icons/audio-volume-medium.svg @@ -0,0 +1,13 @@ + + + + + + + + + diff --git a/res/icons/configure.svg b/res/icons/configure.svg new file mode 100644 index 0000000..6f08b2a --- /dev/null +++ b/res/icons/configure.svg @@ -0,0 +1,13 @@ + + + + + + diff --git a/res/icons/data-error.svg b/res/icons/data-error.svg new file mode 100644 index 0000000..6fc3137 --- /dev/null +++ b/res/icons/data-error.svg @@ -0,0 +1,9 @@ + + + + + diff --git a/res/icons/data-information.svg b/res/icons/data-information.svg new file mode 100644 index 0000000..f77d91b --- /dev/null +++ b/res/icons/data-information.svg @@ -0,0 +1,9 @@ + + + + + diff --git a/res/icons/data-warning.svg b/res/icons/data-warning.svg new file mode 100644 index 0000000..1dc4d0f --- /dev/null +++ b/res/icons/data-warning.svg @@ -0,0 +1,9 @@ + + + + + diff --git a/res/icons/description.svg b/res/icons/description.svg new file mode 100644 index 0000000..5781b48 --- /dev/null +++ b/res/icons/description.svg @@ -0,0 +1,14 @@ + + + + + + diff --git a/res/icons/dialog-cancel.svg b/res/icons/dialog-cancel.svg new file mode 100644 index 0000000..ebd42d7 --- /dev/null +++ b/res/icons/dialog-cancel.svg @@ -0,0 +1,14 @@ + + + + + + diff --git a/res/icons/dialog-ok.svg b/res/icons/dialog-ok.svg new file mode 100644 index 0000000..b56280e --- /dev/null +++ b/res/icons/dialog-ok.svg @@ -0,0 +1,14 @@ + + + + + + diff --git a/res/icons/document-edit.svg b/res/icons/document-edit.svg new file mode 100644 index 0000000..a45de5a --- /dev/null +++ b/res/icons/document-edit.svg @@ -0,0 +1,14 @@ + + + + + + diff --git a/res/icons/document-preview.svg b/res/icons/document-preview.svg new file mode 100644 index 0000000..6f6e346 --- /dev/null +++ b/res/icons/document-preview.svg @@ -0,0 +1,11 @@ + + + + + + + diff --git a/res/icons/document-properties.svg b/res/icons/document-properties.svg new file mode 100644 index 0000000..bc89485 --- /dev/null +++ b/res/icons/document-properties.svg @@ -0,0 +1,14 @@ + + + + + + diff --git a/res/icons/document-save.svg b/res/icons/document-save.svg new file mode 100644 index 0000000..64c3df3 --- /dev/null +++ b/res/icons/document-save.svg @@ -0,0 +1,14 @@ + + + + + + diff --git a/res/icons/document-share.svg b/res/icons/document-share.svg new file mode 100644 index 0000000..4306008 --- /dev/null +++ b/res/icons/document-share.svg @@ -0,0 +1,14 @@ + + + + + + diff --git a/res/icons/download.svg b/res/icons/download.svg new file mode 100644 index 0000000..ef6df42 --- /dev/null +++ b/res/icons/download.svg @@ -0,0 +1,14 @@ + + + + + + diff --git a/res/icons/draw-brush.svg b/res/icons/draw-brush.svg new file mode 100644 index 0000000..669d40b --- /dev/null +++ b/res/icons/draw-brush.svg @@ -0,0 +1,14 @@ + + + + + + diff --git a/res/icons/draw-donut.svg b/res/icons/draw-donut.svg new file mode 100644 index 0000000..3fa07e3 --- /dev/null +++ b/res/icons/draw-donut.svg @@ -0,0 +1,9 @@ + + + + + + + diff --git a/res/icons/edit-copy.svg b/res/icons/edit-copy.svg new file mode 100644 index 0000000..fe4a36a --- /dev/null +++ b/res/icons/edit-copy.svg @@ -0,0 +1,11 @@ + + + + + + + diff --git a/res/icons/edit-find.svg b/res/icons/edit-find.svg new file mode 100644 index 0000000..2709591 --- /dev/null +++ b/res/icons/edit-find.svg @@ -0,0 +1,14 @@ + + + + + + diff --git a/res/icons/edit-undo.svg b/res/icons/edit-undo.svg new file mode 100644 index 0000000..0e2124b --- /dev/null +++ b/res/icons/edit-undo.svg @@ -0,0 +1,14 @@ + + + + + + diff --git a/res/icons/exception.svg b/res/icons/exception.svg new file mode 100644 index 0000000..df35907 --- /dev/null +++ b/res/icons/exception.svg @@ -0,0 +1,14 @@ + + + + + + diff --git a/res/icons/folder-temp.svg b/res/icons/folder-temp.svg new file mode 100644 index 0000000..ccc13c8 --- /dev/null +++ b/res/icons/folder-temp.svg @@ -0,0 +1,13 @@ + + + + + + diff --git a/res/icons/folder-txt.svg b/res/icons/folder-txt.svg new file mode 100644 index 0000000..f965fa5 --- /dev/null +++ b/res/icons/folder-txt.svg @@ -0,0 +1,14 @@ + + + + + + diff --git a/res/icons/go-down.svg b/res/icons/go-down.svg new file mode 100644 index 0000000..eedfbbb --- /dev/null +++ b/res/icons/go-down.svg @@ -0,0 +1,14 @@ + + + + + + diff --git a/res/icons/go-previous.svg b/res/icons/go-previous.svg new file mode 100644 index 0000000..e150678 --- /dev/null +++ b/res/icons/go-previous.svg @@ -0,0 +1,14 @@ + + + + + + diff --git a/res/icons/go-up.svg b/res/icons/go-up.svg new file mode 100644 index 0000000..32d5dfc --- /dev/null +++ b/res/icons/go-up.svg @@ -0,0 +1,10 @@ + + + + diff --git a/res/icons/headphones.svg b/res/icons/headphones.svg new file mode 100644 index 0000000..d91145d --- /dev/null +++ b/res/icons/headphones.svg @@ -0,0 +1,14 @@ + + + + + + diff --git a/res/icons/help-about.svg b/res/icons/help-about.svg new file mode 100644 index 0000000..b9e829f --- /dev/null +++ b/res/icons/help-about.svg @@ -0,0 +1,14 @@ + + + + + + diff --git a/res/icons/hint.svg b/res/icons/hint.svg new file mode 100644 index 0000000..a046928 --- /dev/null +++ b/res/icons/hint.svg @@ -0,0 +1,14 @@ + + + + + + diff --git a/res/icons/im-user-away.svg b/res/icons/im-user-away.svg new file mode 100644 index 0000000..904e3ac --- /dev/null +++ b/res/icons/im-user-away.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/res/icons/list-add.svg b/res/icons/list-add.svg new file mode 100644 index 0000000..0d6166a --- /dev/null +++ b/res/icons/list-add.svg @@ -0,0 +1,14 @@ + + + + + + diff --git a/res/icons/list-remove.svg b/res/icons/list-remove.svg new file mode 100644 index 0000000..81adb13 --- /dev/null +++ b/res/icons/list-remove.svg @@ -0,0 +1,10 @@ + + + + + + diff --git a/res/icons/media-optical-audio.svg b/res/icons/media-optical-audio.svg new file mode 100644 index 0000000..ce71a04 --- /dev/null +++ b/res/icons/media-optical-audio.svg @@ -0,0 +1,14 @@ + + + + + + diff --git a/res/icons/media-playback-pause.svg b/res/icons/media-playback-pause.svg new file mode 100644 index 0000000..49d9941 --- /dev/null +++ b/res/icons/media-playback-pause.svg @@ -0,0 +1,8 @@ + + + + diff --git a/res/icons/media-playback-start.svg b/res/icons/media-playback-start.svg new file mode 100644 index 0000000..bbe84eb --- /dev/null +++ b/res/icons/media-playback-start.svg @@ -0,0 +1,8 @@ + + + + diff --git a/res/icons/media-playlist-append.svg b/res/icons/media-playlist-append.svg new file mode 100644 index 0000000..4853b40 --- /dev/null +++ b/res/icons/media-playlist-append.svg @@ -0,0 +1,14 @@ + + + + + + diff --git a/res/icons/media-playlist-repeat-song.svg b/res/icons/media-playlist-repeat-song.svg new file mode 100644 index 0000000..67318e7 --- /dev/null +++ b/res/icons/media-playlist-repeat-song.svg @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/res/icons/media-playlist-repeat.svg b/res/icons/media-playlist-repeat.svg new file mode 100644 index 0000000..e2d5091 --- /dev/null +++ b/res/icons/media-playlist-repeat.svg @@ -0,0 +1,10 @@ + + + + + + diff --git a/res/icons/media-playlist-shuffle.svg b/res/icons/media-playlist-shuffle.svg new file mode 100644 index 0000000..bb0fcf1 --- /dev/null +++ b/res/icons/media-playlist-shuffle.svg @@ -0,0 +1,14 @@ + + + + + + diff --git a/res/icons/media-skip-backward.svg b/res/icons/media-skip-backward.svg new file mode 100644 index 0000000..e4f1c48 --- /dev/null +++ b/res/icons/media-skip-backward.svg @@ -0,0 +1,8 @@ + + + + diff --git a/res/icons/media-skip-forward.svg b/res/icons/media-skip-forward.svg new file mode 100644 index 0000000..97c4e72 --- /dev/null +++ b/res/icons/media-skip-forward.svg @@ -0,0 +1,8 @@ + + + + diff --git a/res/icons/media-track-show-active.svg b/res/icons/media-track-show-active.svg new file mode 100644 index 0000000..d64c20b --- /dev/null +++ b/res/icons/media-track-show-active.svg @@ -0,0 +1,22 @@ + + + + + + + diff --git a/res/icons/non-starred-symbolic.svg b/res/icons/non-starred-symbolic.svg new file mode 100644 index 0000000..24b767a --- /dev/null +++ b/res/icons/non-starred-symbolic.svg @@ -0,0 +1,10 @@ + + + + diff --git a/res/icons/speaker.svg b/res/icons/speaker.svg new file mode 100644 index 0000000..ff4fdf6 --- /dev/null +++ b/res/icons/speaker.svg @@ -0,0 +1,14 @@ + + + + + + diff --git a/res/icons/starred-symbolic.svg b/res/icons/starred-symbolic.svg new file mode 100644 index 0000000..0f09b04 --- /dev/null +++ b/res/icons/starred-symbolic.svg @@ -0,0 +1,10 @@ + + + + diff --git a/res/icons/view-calendar.svg b/res/icons/view-calendar.svg new file mode 100644 index 0000000..4b14bc7 --- /dev/null +++ b/res/icons/view-calendar.svg @@ -0,0 +1,14 @@ + + + + + + diff --git a/res/icons/view-media-album-cover.svg b/res/icons/view-media-album-cover.svg new file mode 100644 index 0000000..932cf18 --- /dev/null +++ b/res/icons/view-media-album-cover.svg @@ -0,0 +1,14 @@ + + + + + + diff --git a/res/icons/view-media-artist.svg b/res/icons/view-media-artist.svg new file mode 100644 index 0000000..688167a --- /dev/null +++ b/res/icons/view-media-artist.svg @@ -0,0 +1,14 @@ + + + + + + diff --git a/res/icons/view-media-lyrics.svg b/res/icons/view-media-lyrics.svg new file mode 100644 index 0000000..5387284 --- /dev/null +++ b/res/icons/view-media-lyrics.svg @@ -0,0 +1,17 @@ + + + + + + diff --git a/res/icons/view-media-playlist.svg b/res/icons/view-media-playlist.svg new file mode 100644 index 0000000..07333a8 --- /dev/null +++ b/res/icons/view-media-playlist.svg @@ -0,0 +1,14 @@ + + + + + + diff --git a/res/icons/view-media-track.svg b/res/icons/view-media-track.svg new file mode 100644 index 0000000..e6188be --- /dev/null +++ b/res/icons/view-media-track.svg @@ -0,0 +1,14 @@ + + + + + + diff --git a/res/icons/view-refresh.svg b/res/icons/view-refresh.svg new file mode 100644 index 0000000..3b2e9d0 --- /dev/null +++ b/res/icons/view-refresh.svg @@ -0,0 +1,8 @@ + + + + + + diff --git a/res/icons/view-sort-ascending.svg b/res/icons/view-sort-ascending.svg new file mode 100644 index 0000000..a3b4c59 --- /dev/null +++ b/res/icons/view-sort-ascending.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/res/icons/view-statistics.svg b/res/icons/view-statistics.svg new file mode 100644 index 0000000..baac58a --- /dev/null +++ b/res/icons/view-statistics.svg @@ -0,0 +1,14 @@ + + + + + + diff --git a/res/icons/visibility.svg b/res/icons/visibility.svg new file mode 100644 index 0000000..798f11d --- /dev/null +++ b/res/icons/visibility.svg @@ -0,0 +1,14 @@ + + + + + + diff --git a/res/icons/window-close.svg b/res/icons/window-close.svg new file mode 100644 index 0000000..74e5950 --- /dev/null +++ b/res/icons/window-close.svg @@ -0,0 +1,10 @@ + + + + diff --git a/res/icons/window-maximize.svg b/res/icons/window-maximize.svg new file mode 100644 index 0000000..32d5dfc --- /dev/null +++ b/res/icons/window-maximize.svg @@ -0,0 +1,10 @@ + + + + diff --git a/res/icons/window-minimize.svg b/res/icons/window-minimize.svg new file mode 100644 index 0000000..eedfbbb --- /dev/null +++ b/res/icons/window-minimize.svg @@ -0,0 +1,14 @@ + + + + + + diff --git a/res/icons/window-restore.svg b/res/icons/window-restore.svg new file mode 100644 index 0000000..3321fc8 --- /dev/null +++ b/res/icons/window-restore.svg @@ -0,0 +1,10 @@ + + + + diff --git a/res/icons/window.svg b/res/icons/window.svg new file mode 100644 index 0000000..4402468 --- /dev/null +++ b/res/icons/window.svg @@ -0,0 +1,14 @@ + + + + + + diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b461835..dc87068 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -6,6 +6,9 @@ target_sources(qobuz-qt PRIVATE mainwindow.hpp mainwindow.cpp + # Queue (header-only) + playqueue.hpp + # Backend (Qt wrapper around Rust FFI) backend/qobuzbackend.hpp backend/qobuzbackend.cpp @@ -15,6 +18,10 @@ target_sources(qobuz-qt PRIVATE view/maintoolbar.cpp view/maincontent.hpp view/maincontent.cpp + view/context/view.hpp + view/context/view.cpp + view/queuepanel.hpp + view/queuepanel.cpp view/sidepanel/view.hpp view/sidepanel/view.cpp diff --git a/src/list/tracks.cpp b/src/list/tracks.cpp index 8aad661..2525a1e 100644 --- a/src/list/tracks.cpp +++ b/src/list/tracks.cpp @@ -3,15 +3,14 @@ #include #include #include -#include -#include namespace List { -Tracks::Tracks(QobuzBackend *backend, QWidget *parent) +Tracks::Tracks(QobuzBackend *backend, PlayQueue *queue, QWidget *parent) : QTreeView(parent) , m_backend(backend) + , m_queue(queue) { m_model = new TrackListModel(this); setModel(m_model); @@ -22,54 +21,74 @@ Tracks::Tracks(QobuzBackend *backend, QWidget *parent) setSelectionBehavior(QAbstractItemView::SelectRows); setSortingEnabled(true); setContextMenuPolicy(Qt::CustomContextMenu); + sortByColumn(TrackListModel::ColNumber, Qt::AscendingOrder); header()->setStretchLastSection(false); - header()->setSectionResizeMode(TrackListModel::ColTitle, QHeaderView::Stretch); - header()->setSectionResizeMode(TrackListModel::ColArtist, QHeaderView::Stretch); - header()->setSectionResizeMode(TrackListModel::ColAlbum, QHeaderView::Stretch); + header()->setSectionResizeMode(TrackListModel::ColTitle, QHeaderView::Stretch); + header()->setSectionResizeMode(TrackListModel::ColArtist, QHeaderView::Stretch); + header()->setSectionResizeMode(TrackListModel::ColAlbum, QHeaderView::Stretch); header()->setSectionResizeMode(TrackListModel::ColNumber, QHeaderView::ResizeToContents); header()->setSectionResizeMode(TrackListModel::ColDuration, QHeaderView::ResizeToContents); - connect(this, &QTreeView::doubleClicked, this, &Tracks::onDoubleClicked); - connect(this, &QTreeView::customContextMenuRequested, this, &Tracks::onContextMenu); + connect(this, &QTreeView::doubleClicked, + this, &Tracks::onDoubleClicked); + connect(this, &QTreeView::customContextMenuRequested, + this, &Tracks::onContextMenu); + + // Re-sync queue order whenever the model is re-sorted (user clicked header + // or setTracks re-applied an existing sort). + connect(m_model, &TrackListModel::sortApplied, + this, &Tracks::syncQueueToModel); } void Tracks::loadTracks(const QJsonArray &tracks) { - m_model->setTracks(tracks); + m_model->setTracks(tracks, false, /*useSequential=*/true); + m_queue->setContext(tracks, 0); + syncQueueToModel(); } void Tracks::loadAlbum(const QJsonObject &album) { - const QJsonObject tracksWrapper = album["tracks"].toObject(); - const QJsonArray items = tracksWrapper["items"].toArray(); - m_model->setTracks(items); + const QJsonArray items = album["tracks"].toObject()["items"].toArray(); + m_model->setTracks(items); // album: use track_number + m_queue->setContext(items, 0); + syncQueueToModel(); } void Tracks::loadPlaylist(const QJsonObject &playlist) { - const QJsonObject tracksWrapper = playlist["tracks"].toObject(); - const QJsonArray items = tracksWrapper["items"].toArray(); - m_model->setTracks(items); + const QJsonArray items = playlist["tracks"].toObject()["items"].toArray(); + m_model->setTracks(items, /*usePosition=*/true); + m_queue->setContext(items, 0); + syncQueueToModel(); } void Tracks::loadSearchTracks(const QJsonArray &tracks) { - m_model->setTracks(tracks); + m_model->setTracks(tracks, false, /*useSequential=*/true); + m_queue->setContext(tracks, 0); + syncQueueToModel(); } -void Tracks::setCurrentTrackId(qint64 id) +void Tracks::setPlayingTrackId(qint64 id) { - m_currentTrackId = id; - // Trigger a repaint for the now-playing indicator - viewport()->update(); + m_playingId = id; + m_model->setPlayingId(id); +} + +void Tracks::syncQueueToModel() +{ + m_queue->reorderContext(m_model->currentTracksJson(), m_playingId); } void Tracks::onDoubleClicked(const QModelIndex &index) { - const qint64 trackId = m_model->data(index, TrackListModel::TrackIdRole).toLongLong(); - if (trackId > 0) - emit playTrackRequested(trackId); + const qint64 id = m_model->data(index, TrackListModel::TrackIdRole).toLongLong(); + if (id > 0) { + m_queue->setCurrentById(id); + emit playTrackRequested(id); + } } void Tracks::onContextMenu(const QPoint &pos) @@ -77,33 +96,55 @@ void Tracks::onContextMenu(const QPoint &pos) const QModelIndex index = indexAt(pos); if (!index.isValid()) return; - const qint64 trackId = m_model->data(index, TrackListModel::TrackIdRole).toLongLong(); + const qint64 id = m_model->data(index, TrackListModel::TrackIdRole).toLongLong(); const QJsonObject trackJson = m_model->data(index, TrackListModel::TrackJsonRole).toJsonObject(); QMenu menu(this); - QAction *playNow = menu.addAction(tr("Play now")); + auto *playNow = menu.addAction(QIcon(":/res/icons/media-playback-start.svg"), tr("Play now")); + auto *playNext = menu.addAction(QIcon(":/res/icons/media-skip-forward.svg"), tr("Play next")); + auto *addQueue = menu.addAction(QIcon(":/res/icons/media-playlist-append.svg"), tr("Add to queue")); menu.addSeparator(); - QAction *addFav = menu.addAction(tr("Add to favorites")); - QAction *remFav = menu.addAction(tr("Remove from favorites")); + auto *addFav = menu.addAction(QIcon(":/res/icons/starred-symbolic.svg"), tr("Add to favorites")); + auto *remFav = menu.addAction(QIcon(":/res/icons/non-starred-symbolic.svg"), tr("Remove from favorites")); - connect(playNow, &QAction::triggered, this, [this, trackId] { - emit playTrackRequested(trackId); + connect(playNow, &QAction::triggered, this, [this, id] { + m_queue->setCurrentById(id); + emit playTrackRequested(id); }); - connect(addFav, &QAction::triggered, this, [this, trackId] { - m_backend->addFavTrack(trackId); + connect(playNext, &QAction::triggered, this, [this, trackJson] { + m_queue->playNext(trackJson); }); - connect(remFav, &QAction::triggered, this, [this, trackId] { - m_backend->removeFavTrack(trackId); + connect(addQueue, &QAction::triggered, this, [this, trackJson] { + m_queue->addToQueue(trackJson); + }); + connect(addFav, &QAction::triggered, this, [this, id] { + m_backend->addFavTrack(id); + }); + connect(remFav, &QAction::triggered, this, [this, id] { + m_backend->removeFavTrack(id); }); - // Open artist page - const QJsonObject performer = trackJson["performer"].toObject(); - const qint64 artistId = static_cast(performer["id"].toDouble()); - if (artistId > 0) { + // Open album + const QString albumId = m_model->trackAt(index.row()).albumId; + if (!albumId.isEmpty()) { menu.addSeparator(); - QAction *openArtist = menu.addAction( - tr("Open artist: %1").arg(performer["name"].toString())); + auto *openAlbum = menu.addAction( + QIcon(":/res/icons/view-media-album-cover.svg"), + tr("Open album: %1").arg(m_model->trackAt(index.row()).album)); + connect(openAlbum, &QAction::triggered, this, [this, albumId] { + m_backend->getAlbum(albumId); + }); + } + + // Open artist + const qint64 artistId = static_cast( + trackJson["performer"].toObject()["id"].toDouble()); + if (artistId > 0) { + const QString artistName = trackJson["performer"].toObject()["name"].toString(); + auto *openArtist = menu.addAction( + QIcon(":/res/icons/view-media-artist.svg"), + tr("Open artist: %1").arg(artistName)); connect(openArtist, &QAction::triggered, this, [this, artistId] { m_backend->getArtist(artistId); }); diff --git a/src/list/tracks.hpp b/src/list/tracks.hpp index cb1354f..05cc774 100644 --- a/src/list/tracks.hpp +++ b/src/list/tracks.hpp @@ -2,6 +2,7 @@ #include "../model/tracklistmodel.hpp" #include "../backend/qobuzbackend.hpp" +#include "../playqueue.hpp" #include #include @@ -9,32 +10,32 @@ namespace List { - /// Track list view — mirrors the spotify-qt List::Tracks widget. - /// Displays a flat list of tracks for a playlist, album, search result, etc. class Tracks : public QTreeView { Q_OBJECT public: - explicit Tracks(QobuzBackend *backend, QWidget *parent = nullptr); + explicit Tracks(QobuzBackend *backend, PlayQueue *queue, QWidget *parent = nullptr); void loadTracks(const QJsonArray &tracks); void loadAlbum(const QJsonObject &album); void loadPlaylist(const QJsonObject &playlist); void loadSearchTracks(const QJsonArray &tracks); - void setCurrentTrackId(qint64 id); + /// Called when the backend fires EV_TRACK_CHANGED so the playing row is highlighted. + void setPlayingTrackId(qint64 id); signals: void playTrackRequested(qint64 trackId); private: - TrackListModel *m_model = nullptr; - QobuzBackend *m_backend = nullptr; - qint64 m_currentTrackId = 0; + TrackListModel *m_model = nullptr; + QobuzBackend *m_backend = nullptr; + PlayQueue *m_queue = nullptr; + qint64 m_playingId = 0; void onDoubleClicked(const QModelIndex &index); void onContextMenu(const QPoint &pos); - void resizeColumnsToContent(); + void syncQueueToModel(); }; } diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index da70d07..6d8c9dc 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1,8 +1,8 @@ #include "mainwindow.hpp" - #include "dialog/login.hpp" #include "dialog/settings.hpp" #include "util/settings.hpp" +#include "util/icon.hpp" #include #include @@ -23,12 +23,15 @@ MainWindow::MainWindow(QobuzBackend *backend, QWidget *parent) setMinimumSize(800, 500); resize(defaultSize()); + // ---- Queue (owned here, shared with toolbar and track list) ---- + m_queue = new PlayQueue(this); + // ---- Toolbar ---- - m_toolBar = new MainToolBar(m_backend, this); + m_toolBar = new MainToolBar(m_backend, m_queue, this); addToolBar(Qt::TopToolBarArea, m_toolBar); // ---- Central content ---- - m_content = new MainContent(m_backend, this); + m_content = new MainContent(m_backend, m_queue, this); setCentralWidget(m_content); // ---- Library dock (left) ---- @@ -40,39 +43,46 @@ MainWindow::MainWindow(QobuzBackend *backend, QWidget *parent) m_libraryDock->setMinimumWidth(200); addDockWidget(Qt::LeftDockWidgetArea, m_libraryDock); + // ---- Now-playing context dock (left, below library) ---- + m_contextView = new Context::View(m_backend, this); + addDockWidget(Qt::LeftDockWidgetArea, m_contextView); + + // ---- Queue panel (right) ---- + m_queuePanel = new QueuePanel(m_queue, this); + m_queuePanel->hide(); + addDockWidget(Qt::RightDockWidgetArea, m_queuePanel); + // ---- Search side panel (right) ---- m_sidePanel = new SidePanel::View(m_backend, this); m_sidePanel->hide(); addDockWidget(Qt::RightDockWidgetArea, m_sidePanel); - // ---- Menu bar ---- setupMenuBar(); - - // ---- Status bar ---- statusBar()->showMessage(tr("Ready")); - // ---- Wire signals ---- - connect(m_backend, &QobuzBackend::loginSuccess, this, &MainWindow::onLoginSuccess); - connect(m_backend, &QobuzBackend::loginError, this, &MainWindow::onLoginError); - connect(m_backend, &QobuzBackend::favTracksLoaded, this, &MainWindow::onFavTracksLoaded); - connect(m_backend, &QobuzBackend::favAlbumsLoaded, this, &MainWindow::onFavAlbumsLoaded); - connect(m_backend, &QobuzBackend::albumLoaded, this, &MainWindow::onAlbumLoaded); - connect(m_backend, &QobuzBackend::artistLoaded, this, &MainWindow::onArtistLoaded); - connect(m_backend, &QobuzBackend::playlistLoaded, this, &MainWindow::onPlaylistLoaded); + // ---- Backend signals ---- + connect(m_backend, &QobuzBackend::loginSuccess, this, &MainWindow::onLoginSuccess); + connect(m_backend, &QobuzBackend::loginError, this, &MainWindow::onLoginError); + connect(m_backend, &QobuzBackend::favTracksLoaded, this, &MainWindow::onFavTracksLoaded); + connect(m_backend, &QobuzBackend::favAlbumsLoaded, this, &MainWindow::onFavAlbumsLoaded); + connect(m_backend, &QobuzBackend::albumLoaded, this, &MainWindow::onAlbumLoaded); + connect(m_backend, &QobuzBackend::artistLoaded, this, &MainWindow::onArtistLoaded); + connect(m_backend, &QobuzBackend::playlistLoaded, this, &MainWindow::onPlaylistLoaded); + connect(m_backend, &QobuzBackend::trackChanged, this, &MainWindow::onTrackChanged); connect(m_backend, &QobuzBackend::error, this, [this](const QString &msg) { - statusBar()->showMessage(tr("Error: %1").arg(msg), 5000); + statusBar()->showMessage(tr("Error: %1").arg(msg), 6000); }); - // Library → backend - connect(m_library, &List::Library::favTracksRequested, m_backend, [this] { + // ---- Library → backend ---- + connect(m_library, &List::Library::favTracksRequested, this, [this] { m_backend->getFavTracks(); statusBar()->showMessage(tr("Loading favorite tracks…")); }); - connect(m_library, &List::Library::favAlbumsRequested, m_backend, [this] { + connect(m_library, &List::Library::favAlbumsRequested, this, [this] { m_backend->getFavAlbums(); statusBar()->showMessage(tr("Loading favorite albums…")); }); - connect(m_library, &List::Library::favArtistsRequested, m_backend, [this] { + connect(m_library, &List::Library::favArtistsRequested, this, [this] { m_backend->getFavArtists(); statusBar()->showMessage(tr("Loading favorite artists…")); }); @@ -82,11 +92,11 @@ MainWindow::MainWindow(QobuzBackend *backend, QWidget *parent) statusBar()->showMessage(tr("Loading playlist: %1…").arg(name)); }); - // Track list → playback + // ---- Track list → playback ---- connect(m_content->tracksList(), &List::Tracks::playTrackRequested, this, &MainWindow::onPlayTrackRequested); - // Search panel → backend + // ---- Search panel ---- connect(m_sidePanel, &SidePanel::View::albumSelected, this, &MainWindow::onSearchAlbumSelected); connect(m_sidePanel, &SidePanel::View::artistSelected, @@ -94,32 +104,40 @@ MainWindow::MainWindow(QobuzBackend *backend, QWidget *parent) connect(m_sidePanel, &SidePanel::View::trackPlayRequested, this, &MainWindow::onPlayTrackRequested); - // Toolbar search toggle → side panel visibility + // ---- Toolbar toggles ---- connect(m_toolBar, &MainToolBar::searchToggled, this, &MainWindow::onSearchToggled); + connect(m_toolBar, &MainToolBar::queueToggled, + this, [this](bool v) { m_queuePanel->setVisible(v); }); - // Restore or prompt login tryRestoreSession(); } void MainWindow::setupMenuBar() { auto *fileMenu = menuBar()->addMenu(tr("&File")); - fileMenu->addAction(tr("&Sign in…"), this, &MainWindow::showLoginDialog); + fileMenu->addAction(Icon::get("im-user-away"), tr("&Sign in…"), + this, &MainWindow::showLoginDialog); fileMenu->addSeparator(); - fileMenu->addAction(tr("&Settings…"), this, &MainWindow::showSettingsDialog); + fileMenu->addAction(Icon::settings(), tr("&Settings…"), + this, &MainWindow::showSettingsDialog); fileMenu->addSeparator(); - fileMenu->addAction(tr("&Quit"), qApp, &QApplication::quit, QKeySequence::Quit); + auto *quitAction = fileMenu->addAction(Icon::get("application-exit"), tr("&Quit"), + qApp, &QApplication::quit); + quitAction->setShortcut(QKeySequence::Quit); auto *viewMenu = menuBar()->addMenu(tr("&View")); viewMenu->addAction(m_libraryDock->toggleViewAction()); + viewMenu->addAction(m_contextView->toggleViewAction()); + viewMenu->addAction(m_queuePanel->toggleViewAction()); viewMenu->addAction(m_sidePanel->toggleViewAction()); auto *helpMenu = menuBar()->addMenu(tr("&Help")); - helpMenu->addAction(tr("&About"), this, [this] { + helpMenu->addAction(Icon::get("help-about"), tr("&About"), this, [this] { QMessageBox::about(this, tr("About Qobuz"), tr("

qobuz-qt

" "

A lightweight Qt client for the Qobuz streaming service.

" - "

Audio decoding powered by Symphonia (Rust).

")); + "

Audio engine: Symphonia (Rust) via CPAL/ALSA.
" + "Icons: spotify-qt (dark variant).

")); }); } @@ -133,7 +151,6 @@ void MainWindow::tryRestoreSession() statusBar()->showMessage(tr("Signed in as %1").arg( name.isEmpty() ? AppSettings::instance().userEmail() : name)); } else { - // No saved session — prompt login after a short delay so the window is visible first QTimer::singleShot(200, this, &MainWindow::showLoginDialog); } } @@ -145,16 +162,11 @@ void MainWindow::showLoginDialog() auto *dlg = new LoginDialog(this); dlg->setAttribute(Qt::WA_DeleteOnClose); - // Pre-fill if remembered - if (AppSettings::instance().rememberLogin()) - dlg->findChild(); // just show with empty fields - connect(dlg, &LoginDialog::loginRequested, this, [this, dlg](const QString &email, const QString &password) { dlg->setBusy(true); m_backend->login(email, password); }); - connect(m_backend, &QobuzBackend::loginSuccess, dlg, [dlg](const QString &, const QJsonObject &) { dlg->accept(); }); @@ -178,10 +190,8 @@ void MainWindow::onLoginSuccess(const QString &token, const QJsonObject &user) const QString email = user["email"].toString(); AppSettings::instance().setDisplayName(displayName); AppSettings::instance().setUserEmail(email); - statusBar()->showMessage(tr("Signed in as %1").arg( displayName.isEmpty() ? email : displayName)); - m_library->refresh(); } @@ -190,47 +200,59 @@ void MainWindow::onLoginError(const QString &error) statusBar()->showMessage(tr("Login failed: %1").arg(error), 6000); } +void MainWindow::onTrackChanged(const QJsonObject &track) +{ + // Update playing row highlight in the track list + const qint64 id = static_cast(track["id"].toDouble()); + m_content->tracksList()->setPlayingTrackId(id); + + // Update status bar with track name + const QString title = track["title"].toString(); + const QString artist = track["performer"].toObject()["name"].toString().isEmpty() + ? track["album"].toObject()["artist"].toObject()["name"].toString() + : track["performer"].toObject()["name"].toString(); + statusBar()->showMessage( + artist.isEmpty() ? title : QStringLiteral("▶ %1 — %2").arg(artist, title)); +} + void MainWindow::onFavTracksLoaded(const QJsonObject &result) { m_content->showFavTracks(result); - statusBar()->showMessage(tr("Favorite tracks loaded."), 3000); + statusBar()->showMessage( + tr("%1 favorite tracks").arg(result["total"].toInt()), 4000); } void MainWindow::onFavAlbumsLoaded(const QJsonObject &result) { - // Show albums as a track list (each album as a row) - // For now just show the raw tracks from each album - // A proper album grid view would go here in a future iteration - const QJsonArray albums = result["items"].toArray(); - statusBar()->showMessage(tr("%1 favorite albums").arg(albums.size()), 3000); - // TODO: show album grid + const int total = result["total"].toInt(); + statusBar()->showMessage(tr("%1 favorite albums").arg(total), 4000); + // TODO: album grid view } void MainWindow::onAlbumLoaded(const QJsonObject &album) { m_content->showAlbum(album); - const QString title = album["title"].toString(); - statusBar()->showMessage(tr("Album: %1").arg(title), 3000); + statusBar()->showMessage( + tr("Album: %1").arg(album["title"].toString()), 4000); } void MainWindow::onArtistLoaded(const QJsonObject &artist) { - // TODO: show artist view with top tracks + discography - statusBar()->showMessage(tr("Artist: %1").arg(artist["name"].toString()), 3000); + statusBar()->showMessage( + tr("Artist: %1").arg(artist["name"].toString()), 4000); + // TODO: artist view } void MainWindow::onPlaylistLoaded(const QJsonObject &playlist) { m_content->showPlaylist(playlist); - const QString name = playlist["name"].toString(); - statusBar()->showMessage(tr("Playlist: %1").arg(name), 3000); + statusBar()->showMessage( + tr("Playlist: %1").arg(playlist["name"].toString()), 4000); } void MainWindow::onPlayTrackRequested(qint64 trackId) { - const int format = AppSettings::instance().preferredFormat(); - m_backend->playTrack(trackId, format); - statusBar()->showMessage(tr("Loading track…")); + m_backend->playTrack(trackId, AppSettings::instance().preferredFormat()); } void MainWindow::onSearchAlbumSelected(const QString &albumId) diff --git a/src/mainwindow.hpp b/src/mainwindow.hpp index 0e90c87..583deda 100644 --- a/src/mainwindow.hpp +++ b/src/mainwindow.hpp @@ -1,8 +1,11 @@ #pragma once #include "backend/qobuzbackend.hpp" +#include "playqueue.hpp" #include "view/maintoolbar.hpp" #include "view/maincontent.hpp" +#include "view/context/view.hpp" +#include "view/queuepanel.hpp" #include "view/sidepanel/view.hpp" #include "list/library.hpp" @@ -16,7 +19,6 @@ class MainWindow : public QMainWindow public: explicit MainWindow(QobuzBackend *backend, QWidget *parent = nullptr); - static QSize defaultSize() { return {1100, 700}; } private slots: @@ -29,23 +31,25 @@ private slots: void onArtistLoaded(const QJsonObject &artist); void onPlaylistLoaded(const QJsonObject &playlist); + void onTrackChanged(const QJsonObject &track); void onPlayTrackRequested(qint64 trackId); void onSearchAlbumSelected(const QString &albumId); void onSearchArtistSelected(qint64 artistId); - void onSearchToggled(bool visible); void showLoginDialog(); void showSettingsDialog(); private: - QobuzBackend *m_backend = nullptr; - MainToolBar *m_toolBar = nullptr; - MainContent *m_content = nullptr; - List::Library *m_library = nullptr; - SidePanel::View *m_sidePanel = nullptr; - - QDockWidget *m_libraryDock = nullptr; + QobuzBackend *m_backend = nullptr; + PlayQueue *m_queue = nullptr; + MainToolBar *m_toolBar = nullptr; + MainContent *m_content = nullptr; + List::Library *m_library = nullptr; + Context::View *m_contextView = nullptr; + QueuePanel *m_queuePanel = nullptr; + SidePanel::View *m_sidePanel = nullptr; + QDockWidget *m_libraryDock = nullptr; void setupMenuBar(); void tryRestoreSession(); diff --git a/src/model/tracklistmodel.cpp b/src/model/tracklistmodel.cpp index 7076a24..078c987 100644 --- a/src/model/tracklistmodel.cpp +++ b/src/model/tracklistmodel.cpp @@ -2,45 +2,63 @@ #include #include +#include +#include TrackListModel::TrackListModel(QObject *parent) : QAbstractTableModel(parent) {} -void TrackListModel::setTracks(const QJsonArray &tracks) +void TrackListModel::setTracks(const QJsonArray &tracks, + bool usePosition, + bool useSequential) { beginResetModel(); m_tracks.clear(); m_tracks.reserve(tracks.size()); + int seq = 1; for (const QJsonValue &v : tracks) { const QJsonObject t = v.toObject(); TrackItem item; item.id = static_cast(t["id"].toDouble()); - item.number = t["track_number"].toInt(); item.title = t["title"].toString(); item.duration = static_cast(t["duration"].toDouble()); item.hiRes = t["hires_streamable"].toBool(); - item.streamable = t["streamable"].toBool(); + item.streamable = t["streamable"].toBool(true); item.raw = t; - // Performer / artist - const QJsonObject performer = t["performer"].toObject(); - item.artist = performer["name"].toString(); - if (item.artist.isEmpty()) { - const QJsonObject album = t["album"].toObject(); - const QJsonObject artist = album["artist"].toObject(); - item.artist = artist["name"].toString(); + if (useSequential) { + item.number = seq++; + } else if (usePosition) { + const int pos = t["position"].toInt(); + item.number = pos > 0 ? pos : seq; + ++seq; + } else { + item.number = t["track_number"].toInt(); } - // Album + const QJsonObject performer = t["performer"].toObject(); + item.artist = performer["name"].toString(); + if (item.artist.isEmpty()) + item.artist = t["album"].toObject()["artist"].toObject()["name"].toString(); + const QJsonObject album = t["album"].toObject(); - item.album = album["title"].toString(); + item.album = album["title"].toString(); item.albumId = album["id"].toString(); m_tracks.append(item); } + + // Re-apply sort silently inside the reset (no layout signals needed here) + if (m_sortColumn >= 0) + sortData(m_sortColumn, m_sortOrder); + endResetModel(); + + // Tell external listeners the sorted order is ready (e.g. PlayQueue sync) + if (m_sortColumn >= 0) + emit sortApplied(); } void TrackListModel::clear() @@ -50,16 +68,22 @@ void TrackListModel::clear() endResetModel(); } +void TrackListModel::setPlayingId(qint64 id) +{ + m_playingId = id; + if (!m_tracks.isEmpty()) + emit dataChanged(index(0, 0), index(rowCount() - 1, columnCount() - 1), + {Qt::FontRole, Qt::DecorationRole}); +} + int TrackListModel::rowCount(const QModelIndex &parent) const { - if (parent.isValid()) return 0; - return m_tracks.size(); + return parent.isValid() ? 0 : m_tracks.size(); } int TrackListModel::columnCount(const QModelIndex &parent) const { - if (parent.isValid()) return 0; - return ColCount; + return parent.isValid() ? 0 : ColCount; } QVariant TrackListModel::data(const QModelIndex &index, int role) const @@ -68,6 +92,7 @@ QVariant TrackListModel::data(const QModelIndex &index, int role) const return {}; const TrackItem &t = m_tracks.at(index.row()); + const bool isPlaying = (t.id == m_playingId && m_playingId != 0); if (role == Qt::DisplayRole) { switch (index.column()) { @@ -79,8 +104,19 @@ QVariant TrackListModel::data(const QModelIndex &index, int role) const } } - if (role == Qt::ForegroundRole && !t.streamable) { - return QColor(Qt::gray); + if (role == Qt::FontRole && isPlaying) { + QFont f; + f.setBold(true); + return f; + } + + if (role == Qt::ForegroundRole) { + if (!t.streamable) return QColor(Qt::gray); + if (isPlaying) return QColor(0x1d, 0xb9, 0x54); // Qobuz green + } + + if (role == Qt::DecorationRole && index.column() == ColNumber && isPlaying) { + return QIcon(QStringLiteral(":/res/icons/media-track-show-active.svg")); } if (role == TrackIdRole) return t.id; @@ -92,19 +128,56 @@ QVariant TrackListModel::data(const QModelIndex &index, int role) const QVariant TrackListModel::headerData(int section, Qt::Orientation orientation, int role) const { - if (orientation != Qt::Horizontal || role != Qt::DisplayRole) - return {}; + if (orientation != Qt::Horizontal) return {}; - switch (section) { - case ColNumber: return tr("#"); - case ColTitle: return tr("Title"); - case ColArtist: return tr("Artist"); - case ColAlbum: return tr("Album"); - case ColDuration: return tr("Duration"); + if (role == Qt::DisplayRole) { + switch (section) { + case ColNumber: return tr("#"); + case ColTitle: return tr("Title"); + case ColArtist: return tr("Artist"); + case ColAlbum: return tr("Album"); + case ColDuration: return tr("Duration"); + } } + + if (role == Qt::DecorationRole && section == m_sortColumn) { + return QIcon(QStringLiteral(":/res/icons/view-sort-ascending.svg")); + } + return {}; } +void TrackListModel::sortData(int column, Qt::SortOrder order) +{ + auto cmp = [&](const TrackItem &a, const TrackItem &b) -> bool { + bool less = false; + switch (column) { + case ColNumber: less = a.number < b.number; break; + case ColTitle: less = a.title < b.title; break; + case ColArtist: less = a.artist < b.artist; break; + case ColAlbum: less = a.album < b.album; break; + case ColDuration: less = a.duration < b.duration; break; + default: less = false; + } + return order == Qt::AscendingOrder ? less : !less; + }; + std::stable_sort(m_tracks.begin(), m_tracks.end(), cmp); +} + +void TrackListModel::sort(int column, Qt::SortOrder order) +{ + m_sortColumn = column; + m_sortOrder = order; + + if (m_tracks.isEmpty()) return; + + emit layoutAboutToBeChanged(); + sortData(column, order); + emit layoutChanged(); + + emit sortApplied(); +} + QString TrackListModel::formatDuration(qint64 secs) { const int m = static_cast(secs / 60); diff --git a/src/model/tracklistmodel.hpp b/src/model/tracklistmodel.hpp index ba3cf44..72f428c 100644 --- a/src/model/tracklistmodel.hpp +++ b/src/model/tracklistmodel.hpp @@ -4,8 +4,8 @@ #include #include #include +#include -/// Flat data stored for each row in the track list. struct TrackItem { qint64 id = 0; int number = 0; @@ -16,7 +16,7 @@ struct TrackItem { qint64 duration = 0; // seconds bool hiRes = false; bool streamable = false; - QJsonObject raw; // full JSON for context menus / playback + QJsonObject raw; }; class TrackListModel : public QAbstractTableModel @@ -41,17 +41,45 @@ public: explicit TrackListModel(QObject *parent = nullptr); - void setTracks(const QJsonArray &tracks); + // usePosition: use tracks[i]["position"] for the # column (playlists) + // useSequential: use 1..n sequential numbering (favourites) + void setTracks(const QJsonArray &tracks, + bool usePosition = false, + bool useSequential = false); void clear(); + void setPlayingId(qint64 id); + qint64 playingId() const { return m_playingId; } const TrackItem &trackAt(int row) const { return m_tracks.at(row); } + + // Returns the current (possibly sorted) raw JSON objects in display order. + QJsonArray currentTracksJson() const + { + QJsonArray out; + for (const auto &t : m_tracks) + out.append(t.raw); + return out; + } + int rowCount(const QModelIndex &parent = {}) const override; int columnCount(const QModelIndex &parent = {}) const override; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; + void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override; static QString formatDuration(qint64 secs); +signals: + // Emitted after a sort is applied (including the initial sort after setTracks). + // Lets external observers (e.g. PlayQueue) re-sync their order. + void sortApplied(); + private: QVector m_tracks; + qint64 m_playingId = 0; + int m_sortColumn = -1; + Qt::SortOrder m_sortOrder = Qt::AscendingOrder; + + // Sort m_tracks in-place without emitting any signals. + void sortData(int column, Qt::SortOrder order); }; diff --git a/src/playqueue.hpp b/src/playqueue.hpp new file mode 100644 index 0000000..8727778 --- /dev/null +++ b/src/playqueue.hpp @@ -0,0 +1,225 @@ +#pragma once + +#include +#include +#include +#include +#include +#include + +/// Local playback queue. Holds the ordered list of tracks for the current +/// context (album / playlist / search result / favourites) plus a separate +/// "play-next" prepend queue that mirrors the spotify-qt pattern. +class PlayQueue : public QObject +{ + Q_OBJECT + +public: + explicit PlayQueue(QObject *parent = nullptr) : QObject(parent) {} + + // ---- Loading a new context ---- + + /// Replace the queue with all tracks from an album/playlist JSON context. + /// @param startIndex Index of the track to start playing (-1 = first). + void setContext(const QJsonArray &tracks, int startIndex = 0) + { + m_queue.clear(); + m_playNext.clear(); + for (const auto &v : tracks) + m_queue.append(v.toObject()); + if (m_shuffle) { + shuffleQueue(startIndex); + // shuffleQueue moves the start track to index 0 and sets m_index = 0 + } else { + m_index = qBound(0, startIndex, m_queue.size() - 1); + } + emit queueChanged(); + } + + // ---- Re-order after a sort (keeps m_playNext, updates m_index) ---- + + void reorderContext(const QJsonArray &tracks, qint64 currentId) + { + m_queue.clear(); + for (const auto &v : tracks) + m_queue.append(v.toObject()); + + m_index = 0; + for (int i = 0; i < m_queue.size(); ++i) { + if (static_cast(m_queue[i]["id"].toDouble()) == currentId) { + m_index = i; + break; + } + } + emit queueChanged(); + } + + // ---- Clear / remove upcoming ---- + + /// Remove all "up next" entries (playNext + remaining main queue after current). + void clearUpcoming() + { + m_playNext.clear(); + if (m_index < m_queue.size()) + m_queue.resize(m_index + 1); // keep up to and including current + emit queueChanged(); + } + + /// Remove one upcoming track by its index in upcomingTracks(). + void removeUpcoming(int upcomingIndex) + { + if (upcomingIndex < m_playNext.size()) { + m_playNext.removeAt(upcomingIndex); + } else { + const int queueIdx = m_index + 1 + (upcomingIndex - m_playNext.size()); + if (queueIdx < m_queue.size()) + m_queue.removeAt(queueIdx); + } + emit queueChanged(); + } + + // ---- Shuffle ---- + + bool shuffleEnabled() const { return m_shuffle; } + + void setShuffle(bool enabled) + { + if (m_shuffle == enabled) return; + m_shuffle = enabled; + if (enabled && !m_queue.isEmpty()) + shuffleQueue(m_index); + emit queueChanged(); + } + + // ---- Play-next prepend queue (like "Add to queue" ---- + + void addToQueue(const QJsonObject &track) + { + m_playNext.append(track); + emit queueChanged(); + } + + void playNext(const QJsonObject &track) + { + m_playNext.prepend(track); + emit queueChanged(); + } + + // ---- Navigation ---- + + bool hasCurrent() const + { + return (!m_playNext.isEmpty()) || (!m_queue.isEmpty()); + } + + QJsonObject current() const + { + if (!m_playNext.isEmpty()) return m_playNext.first(); + if (m_index < m_queue.size()) return m_queue.at(m_index); + return {}; + } + + qint64 currentId() const + { + return static_cast(current()["id"].toDouble()); + } + + /// Advance and return the new current track. Returns {} at end of queue. + QJsonObject advance() + { + if (!m_playNext.isEmpty()) { + m_playNext.removeFirst(); + } else { + ++m_index; + } + emit queueChanged(); + return current(); + } + + /// Step backwards in the main queue (play-next is not affected). + QJsonObject stepBack() + { + if (m_index > 0) --m_index; + emit queueChanged(); + return current(); + } + + bool canGoNext() const + { + return !m_playNext.isEmpty() || (m_index + 1 < m_queue.size()); + } + + bool canGoPrev() const { return m_index > 0; } + + // ---- Index lookup ---- + + /// Set the current position by track id (after user double-clicks a row). + void setCurrentById(qint64 id) + { + m_playNext.clear(); + for (int i = 0; i < m_queue.size(); ++i) { + if (static_cast(m_queue[i]["id"].toDouble()) == id) { + m_index = i; + emit queueChanged(); + return; + } + } + } + + // ---- Accessors for queue panel ---- + + QVector upcomingTracks(int maxCount = 200) const + { + QVector result; + result.append(m_playNext); + for (int i = m_index + 1; i < m_queue.size() && result.size() < maxCount; ++i) + result.append(m_queue.at(i)); + return result; + } + + int playNextCount() const { return m_playNext.size(); } + int totalSize() const { return m_playNext.size() + m_queue.size(); } + int currentIndex() const { return m_index; } + + /// Move an upcoming item (by its index in upcomingTracks()) to the front of playNext. + void moveUpcomingToTop(int upcomingIndex) + { + if (upcomingIndex < 0) return; + QJsonObject track; + if (upcomingIndex < m_playNext.size()) { + if (upcomingIndex == 0) return; // already at top + track = m_playNext.takeAt(upcomingIndex); + } else { + const int queueIdx = m_index + 1 + (upcomingIndex - m_playNext.size()); + if (queueIdx >= m_queue.size()) return; + track = m_queue.takeAt(queueIdx); + } + m_playNext.prepend(track); + emit queueChanged(); + } + +signals: + void queueChanged(); + +private: + QVector m_queue; // main context (album / playlist) + QVector m_playNext; // prepended "play next" tracks + int m_index = 0; + bool m_shuffle = false; + + void shuffleQueue(int keepAtFront) + { + if (m_queue.isEmpty()) return; + // Keep the current track at index 0 of the remaining queue + if (keepAtFront >= 0 && keepAtFront < m_queue.size()) { + QJsonObject current = m_queue.takeAt(keepAtFront); + std::mt19937 rng(std::random_device{}()); + std::shuffle(m_queue.begin(), m_queue.end(), rng); + m_queue.prepend(current); + } else { + std::mt19937 rng(std::random_device{}()); + std::shuffle(m_queue.begin(), m_queue.end(), rng); + } + m_index = 0; + } +}; diff --git a/src/util/icon.hpp b/src/util/icon.hpp index 38ff42c..04b4b81 100644 --- a/src/util/icon.hpp +++ b/src/util/icon.hpp @@ -1,32 +1,46 @@ #pragma once +#include #include #include namespace Icon { + /// Load an icon by name. Checks the embedded :/res/icons/ first, then + /// falls back to the system theme. The dark SVGs from spotify-qt are + /// bundled so this always succeeds for known names. inline QIcon get(const QString &name) { - // Try theme icon first, fall back to resource - if (QIcon::hasThemeIcon(name)) - return QIcon::fromTheme(name); - return QIcon(QStringLiteral(":/icons/%1.svg").arg(name)); + const QString path = QStringLiteral(":/res/icons/%1.svg").arg(name); + if (QFile::exists(path)) + return QIcon(path); + return QIcon::fromTheme(name); } - // Convenient aliases for common icons used throughout the app + // Playback inline QIcon play() { return get("media-playback-start"); } inline QIcon pause() { return get("media-playback-pause"); } - inline QIcon stop() { return get("media-playback-stop"); } inline QIcon next() { return get("media-skip-forward"); } inline QIcon previous() { return get("media-skip-backward"); } inline QIcon shuffle() { return get("media-playlist-shuffle"); } inline QIcon repeat() { return get("media-playlist-repeat"); } + + // Volume inline QIcon volumeHigh() { return get("audio-volume-high"); } inline QIcon volumeMid() { return get("audio-volume-medium"); } - inline QIcon volumeMute() { return get("audio-volume-muted"); } + inline QIcon volumeLow() { return get("audio-volume-low"); } + inline QIcon volumeMute() { return get("audio-volume-low"); } + + // UI inline QIcon search() { return get("edit-find"); } - inline QIcon heart() { return get("emblem-favorite"); } - inline QIcon album() { return get("media-optical"); } - inline QIcon artist() { return get("system-users"); } - inline QIcon playlist() { return get("view-list-symbolic"); } + inline QIcon heart() { return get("starred-symbolic"); } + inline QIcon heartOff() { return get("non-starred-symbolic"); } + inline QIcon album() { return get("view-media-album-cover"); } + inline QIcon artist() { return get("view-media-artist"); } + inline QIcon playlist() { return get("view-media-playlist"); } + inline QIcon track() { return get("view-media-track"); } + inline QIcon queue() { return get("media-playlist-append"); } + inline QIcon refresh() { return get("view-refresh"); } + inline QIcon settings() { return get("configure"); } + inline QIcon sortAsc() { return get("view-sort-ascending"); } } diff --git a/src/view/context/view.cpp b/src/view/context/view.cpp new file mode 100644 index 0000000..09204e9 --- /dev/null +++ b/src/view/context/view.cpp @@ -0,0 +1,88 @@ +#include "view.hpp" + +#include +#include +#include + +namespace Context +{ + +static constexpr int ArtSize = 96; + +View::View(QobuzBackend *backend, QWidget *parent) + : QDockWidget(tr("Now Playing"), parent) + , m_backend(backend) +{ + setObjectName(QStringLiteral("contextDock")); + setFeatures(QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetClosable); + + m_nam = new QNetworkAccessManager(this); + connect(m_nam, &QNetworkAccessManager::finished, this, &View::onArtReady); + + auto *container = new QWidget(this); + auto *layout = new QVBoxLayout(container); + layout->setContentsMargins(8, 8, 8, 8); + layout->setSpacing(6); + + m_albumArt = new QLabel(container); + m_albumArt->setFixedSize(ArtSize, ArtSize); + m_albumArt->setScaledContents(true); + m_albumArt->setAlignment(Qt::AlignCenter); + m_albumArt->setStyleSheet(QStringLiteral( + "background: #1a1a1a; border-radius: 4px;")); + layout->addWidget(m_albumArt, 0, Qt::AlignCenter); + + m_title = new QLabel(tr("Not playing"), container); + m_title->setAlignment(Qt::AlignCenter); + m_title->setWordWrap(true); + QFont titleFont = m_title->font(); + titleFont.setPointSizeF(titleFont.pointSizeF() * 1.05); + titleFont.setBold(true); + m_title->setFont(titleFont); + layout->addWidget(m_title); + + m_artist = new QLabel(QString(), container); + m_artist->setAlignment(Qt::AlignCenter); + m_artist->setWordWrap(true); + layout->addWidget(m_artist); + + layout->addStretch(); + setWidget(container); + setMinimumWidth(160); + + connect(m_backend, &QobuzBackend::trackChanged, this, &View::onTrackChanged); +} + +void View::onTrackChanged(const QJsonObject &track) +{ + const QString title = track["title"].toString(); + const QString artist = track["performer"].toObject()["name"].toString().isEmpty() + ? track["album"].toObject()["artist"].toObject()["name"].toString() + : track["performer"].toObject()["name"].toString(); + + m_title->setText(title.isEmpty() ? tr("Not playing") : title); + m_artist->setText(artist); + + // Prefer "large" image, fall back to "small" + const QJsonObject img = track["album"].toObject()["image"].toObject(); + QString artUrl = img["large"].toString(); + if (artUrl.isEmpty()) + artUrl = img["small"].toString(); + + if (!artUrl.isEmpty() && artUrl != m_currentArtUrl) { + m_currentArtUrl = artUrl; + m_nam->get(QNetworkRequest(QUrl(artUrl))); + } +} + +void View::onArtReady(QNetworkReply *reply) +{ + reply->deleteLater(); + if (reply->error() != QNetworkReply::NoError) + return; + QPixmap pix; + if (pix.loadFromData(reply->readAll())) + m_albumArt->setPixmap(pix); +} + +} // namespace Context diff --git a/src/view/context/view.hpp b/src/view/context/view.hpp new file mode 100644 index 0000000..3ae00ba --- /dev/null +++ b/src/view/context/view.hpp @@ -0,0 +1,32 @@ +#pragma once + +#include "../../backend/qobuzbackend.hpp" + +#include +#include +#include +#include +#include + +namespace Context +{ + class View : public QDockWidget + { + Q_OBJECT + + public: + explicit View(QobuzBackend *backend, QWidget *parent = nullptr); + + private slots: + void onTrackChanged(const QJsonObject &track); + void onArtReady(QNetworkReply *reply); + + private: + QobuzBackend *m_backend = nullptr; + QLabel *m_albumArt = nullptr; + QLabel *m_title = nullptr; + QLabel *m_artist = nullptr; + QNetworkAccessManager *m_nam = nullptr; + QString m_currentArtUrl; + }; +} // namespace Context diff --git a/src/view/maincontent.cpp b/src/view/maincontent.cpp index 4b6ae88..7c6a54b 100644 --- a/src/view/maincontent.cpp +++ b/src/view/maincontent.cpp @@ -1,9 +1,8 @@ #include "maincontent.hpp" #include -#include -MainContent::MainContent(QobuzBackend *backend, QWidget *parent) +MainContent::MainContent(QobuzBackend *backend, PlayQueue *queue, QWidget *parent) : QWidget(parent) , m_backend(backend) { @@ -15,22 +14,20 @@ MainContent::MainContent(QobuzBackend *backend, QWidget *parent) m_welcome = new QLabel( tr("

Welcome to Qobuz

" - "

Select something from the library on the left to get started.

"), + "

Select something from the library on the left to get started,
" + "or use the search panel (🔍) to find music.

"), this); m_welcome->setAlignment(Qt::AlignCenter); - m_tracks = new List::Tracks(m_backend, this); + m_tracks = new List::Tracks(m_backend, queue, this); - m_stack->addWidget(m_welcome); // index 0 - m_stack->addWidget(m_tracks); // index 1 + m_stack->addWidget(m_welcome); // 0 + m_stack->addWidget(m_tracks); // 1 m_stack->setCurrentIndex(0); } -void MainContent::showWelcome() -{ - m_stack->setCurrentIndex(0); -} +void MainContent::showWelcome() { m_stack->setCurrentIndex(0); } void MainContent::showAlbum(const QJsonObject &album) { @@ -46,8 +43,7 @@ void MainContent::showPlaylist(const QJsonObject &playlist) void MainContent::showFavTracks(const QJsonObject &result) { - const QJsonArray items = result["items"].toArray(); - m_tracks->loadTracks(items); + m_tracks->loadTracks(result["items"].toArray()); m_stack->setCurrentIndex(1); } diff --git a/src/view/maincontent.hpp b/src/view/maincontent.hpp index d16044d..fc9490b 100644 --- a/src/view/maincontent.hpp +++ b/src/view/maincontent.hpp @@ -2,21 +2,20 @@ #include "../list/tracks.hpp" #include "../backend/qobuzbackend.hpp" +#include "../playqueue.hpp" #include #include #include -#include #include +#include -/// Central content widget — mirrors MainContent from spotify-qt. -/// Displays either a track list, an album cover + tracks, or a search result. class MainContent : public QWidget { Q_OBJECT public: - explicit MainContent(QobuzBackend *backend, QWidget *parent = nullptr); + explicit MainContent(QobuzBackend *backend, PlayQueue *queue, QWidget *parent = nullptr); List::Tracks *tracksList() const { return m_tracks; } @@ -27,8 +26,8 @@ public: void showSearchTracks(const QJsonArray &tracks); private: - QobuzBackend *m_backend = nullptr; - QStackedWidget *m_stack = nullptr; - QLabel *m_welcome = nullptr; - List::Tracks *m_tracks = nullptr; + QobuzBackend *m_backend = nullptr; + QStackedWidget *m_stack = nullptr; + QLabel *m_welcome = nullptr; + List::Tracks *m_tracks = nullptr; }; diff --git a/src/view/maintoolbar.cpp b/src/view/maintoolbar.cpp index bef877b..6a7c30b 100644 --- a/src/view/maintoolbar.cpp +++ b/src/view/maintoolbar.cpp @@ -4,56 +4,69 @@ #include #include +#include -MainToolBar::MainToolBar(QobuzBackend *backend, QWidget *parent) +MainToolBar::MainToolBar(QobuzBackend *backend, PlayQueue *queue, QWidget *parent) : QToolBar(parent) , m_backend(backend) + , m_queue(queue) { setMovable(false); setFloatable(false); setContextMenuPolicy(Qt::PreventContextMenu); + setIconSize(QSize(22, 22)); - // Previous + m_nam = new QNetworkAccessManager(this); + connect(m_nam, &QNetworkAccessManager::finished, this, &MainToolBar::onAlbumArtReady); + + // --- Album art thumbnail --- + m_artLabel = new QLabel(this); + m_artLabel->setFixedSize(36, 36); + m_artLabel->setScaledContents(true); + m_artLabel->setStyleSheet("border: 1px solid #444; background: #1a1a1a;"); + m_artLabel->setPixmap(QIcon(":/res/icons/view-media-album-cover.svg") + .pixmap(32, 32)); + addWidget(m_artLabel); + addSeparator(); + + // --- Playback controls --- m_previous = addAction(Icon::previous(), tr("Previous")); connect(m_previous, &QAction::triggered, this, &MainToolBar::onPrevious); - // Play/Pause m_playPause = addAction(Icon::play(), tr("Play")); - m_playPause->setCheckable(false); - connect(m_playPause, &QAction::triggered, this, [this](bool) { onPlayPause(false); }); + connect(m_playPause, &QAction::triggered, this, &MainToolBar::onPlayPause); - // Next m_next = addAction(Icon::next(), tr("Next")); connect(m_next, &QAction::triggered, this, &MainToolBar::onNext); addSeparator(); - // Track label + // --- Track info label --- m_trackLabel = new QLabel(tr("Not playing"), this); - m_trackLabel->setMinimumWidth(200); - m_trackLabel->setMaximumWidth(320); + m_trackLabel->setMinimumWidth(180); + m_trackLabel->setMaximumWidth(340); + m_trackLabel->setAlignment(Qt::AlignVCenter | Qt::AlignLeft); addWidget(m_trackLabel); addSeparator(); - // Progress slider + // --- Progress slider --- m_progress = new ClickableSlider(Qt::Horizontal, this); m_progress->setRange(0, 1000); m_progress->setValue(0); - m_progress->setMinimumWidth(180); - m_progress->setMaximumWidth(400); + m_progress->setMinimumWidth(160); + m_progress->setMaximumWidth(380); addWidget(m_progress); connect(m_progress, &QSlider::sliderPressed, this, [this] { m_seeking = true; }); connect(m_progress, &QSlider::sliderReleased, this, &MainToolBar::onProgressReleased); - // Time label m_timeLabel = new QLabel("0:00 / 0:00", this); addWidget(m_timeLabel); addSeparator(); - // Volume button + // --- Volume --- m_volume = new VolumeButton(this); m_volume->setValue(AppSettings::instance().volume()); addWidget(m_volume); @@ -61,18 +74,36 @@ MainToolBar::MainToolBar(QobuzBackend *backend, QWidget *parent) addSeparator(); - // Search toggle + // --- Shuffle --- + m_shuffle = addAction(Icon::get(QStringLiteral("media-playlist-shuffle")), tr("Shuffle")); + m_shuffle->setCheckable(true); + connect(m_shuffle, &QAction::toggled, this, &MainToolBar::onShuffleToggled); + + addSeparator(); + + // --- Queue toggle --- + m_queueBtn = addAction(Icon::queue(), tr("Queue")); + m_queueBtn->setCheckable(true); + connect(m_queueBtn, &QAction::toggled, this, &MainToolBar::queueToggled); + + // --- Search toggle --- m_search = addAction(Icon::search(), tr("Search")); m_search->setCheckable(true); connect(m_search, &QAction::toggled, this, &MainToolBar::searchToggled); - // Connect to backend signals - connect(m_backend, &QobuzBackend::stateChanged, this, &MainToolBar::onBackendStateChanged); - connect(m_backend, &QobuzBackend::trackChanged, this, &MainToolBar::onTrackChanged); + // --- Backend signals --- + connect(m_backend, &QobuzBackend::stateChanged, this, &MainToolBar::onBackendStateChanged); + connect(m_backend, &QobuzBackend::trackChanged, this, &MainToolBar::onTrackChanged); connect(m_backend, &QobuzBackend::positionChanged, this, &MainToolBar::onPositionChanged); - connect(m_backend, &QobuzBackend::trackFinished, this, &MainToolBar::onTrackFinished); + connect(m_backend, &QobuzBackend::trackFinished, this, &MainToolBar::onTrackFinished); + + // --- Queue signals --- + connect(m_queue, &PlayQueue::queueChanged, this, &MainToolBar::onQueueChanged); + onQueueChanged(); // initialise button states } +// ---- public ---- + void MainToolBar::setPlaying(bool playing) { m_playing = playing; @@ -82,9 +113,10 @@ void MainToolBar::setPlaying(bool playing) void MainToolBar::setCurrentTrack(const QJsonObject &track) { - const QString title = track["title"].toString(); - const QJsonObject performer = track["performer"].toObject(); - const QString artist = performer["name"].toString(); + const QString title = track["title"].toString(); + const QString artist = track["performer"].toObject()["name"].toString().isEmpty() + ? track["album"].toObject()["artist"].toObject()["name"].toString() + : track["performer"].toObject()["name"].toString(); if (title.isEmpty()) { m_trackLabel->setText(tr("Not playing")); @@ -93,55 +125,58 @@ void MainToolBar::setCurrentTrack(const QJsonObject &track) } else { m_trackLabel->setText(QStringLiteral("%1 — %2").arg(artist, title)); } + + // Album art + const QString artUrl = track["album"].toObject()["image"].toObject()["small"].toString(); + if (!artUrl.isEmpty() && artUrl != m_currentArtUrl) { + m_currentArtUrl = artUrl; + fetchAlbumArt(artUrl); + } } void MainToolBar::updateProgress(quint64 position, quint64 duration) { if (m_seeking) return; - const int sliderPos = duration > 0 - ? static_cast(position * 1000 / duration) - : 0; + ? static_cast(position * 1000 / duration) : 0; m_progress->blockSignals(true); m_progress->setValue(sliderPos); m_progress->blockSignals(false); - - const QString pos = TrackListModel::formatDuration(static_cast(position)); - const QString dur = TrackListModel::formatDuration(static_cast(duration)); - m_timeLabel->setText(QStringLiteral("%1 / %2").arg(pos, dur)); + m_timeLabel->setText( + QStringLiteral("%1 / %2") + .arg(TrackListModel::formatDuration(static_cast(position)), + TrackListModel::formatDuration(static_cast(duration)))); } -void MainToolBar::setVolume(int volume) -{ - m_volume->setValue(volume); -} +// ---- private slots ---- -// --- private slots --- - -void MainToolBar::onPlayPause(bool) +void MainToolBar::onPlayPause() { - if (m_playing) { - m_backend->pause(); - } else { - m_backend->resume(); - } + if (m_playing) m_backend->pause(); + else m_backend->resume(); } void MainToolBar::onPrevious() { - // TODO: wire up to a queue / playlist + if (!m_queue->canGoPrev()) return; + const QJsonObject track = m_queue->stepBack(); + const qint64 id = static_cast(track["id"].toDouble()); + if (id > 0) + m_backend->playTrack(id, AppSettings::instance().preferredFormat()); } void MainToolBar::onNext() { - // TODO: wire up to a queue / playlist + if (!m_queue->canGoNext()) return; + const QJsonObject track = m_queue->advance(); + const qint64 id = static_cast(track["id"].toDouble()); + if (id > 0) + m_backend->playTrack(id, AppSettings::instance().preferredFormat()); } void MainToolBar::onProgressReleased() { m_seeking = false; - // Seek is not yet implemented in the Rust player, but we can at least - // update the displayed position optimistically. } void MainToolBar::onVolumeChanged(int volume) @@ -167,7 +202,37 @@ void MainToolBar::onPositionChanged(quint64 position, quint64 duration) void MainToolBar::onTrackFinished() { - setPlaying(false); - m_progress->setValue(0); - m_timeLabel->setText("0:00 / 0:00"); + // Auto-advance queue + if (m_queue->canGoNext()) { + onNext(); + } else { + setPlaying(false); + m_progress->setValue(0); + m_timeLabel->setText("0:00 / 0:00"); + } +} + +void MainToolBar::onQueueChanged() +{ + m_previous->setEnabled(m_queue->canGoPrev()); + m_next->setEnabled(m_queue->canGoNext()); +} + +void MainToolBar::onShuffleToggled(bool checked) +{ + m_queue->setShuffle(checked); +} + +void MainToolBar::fetchAlbumArt(const QString &url) +{ + m_nam->get(QNetworkRequest(QUrl(url))); +} + +void MainToolBar::onAlbumArtReady(QNetworkReply *reply) +{ + reply->deleteLater(); + if (reply->error() != QNetworkReply::NoError) return; + QPixmap pix; + if (pix.loadFromData(reply->readAll())) + m_artLabel->setPixmap(pix); } diff --git a/src/view/maintoolbar.hpp b/src/view/maintoolbar.hpp index e038bf1..29efae6 100644 --- a/src/view/maintoolbar.hpp +++ b/src/view/maintoolbar.hpp @@ -1,6 +1,7 @@ #pragma once #include "../backend/qobuzbackend.hpp" +#include "../playqueue.hpp" #include "../widget/volumebutton.hpp" #include "../widget/clickableslider.hpp" #include "../util/icon.hpp" @@ -9,26 +10,27 @@ #include #include #include +#include +#include #include -/// Main playback toolbar — mirrors MainToolBar from spotify-qt. class MainToolBar : public QToolBar { Q_OBJECT public: - explicit MainToolBar(QobuzBackend *backend, QWidget *parent = nullptr); + explicit MainToolBar(QobuzBackend *backend, PlayQueue *queue, QWidget *parent = nullptr); void setPlaying(bool playing); void setCurrentTrack(const QJsonObject &track); void updateProgress(quint64 position, quint64 duration); - void setVolume(int volume); signals: void searchToggled(bool visible); + void queueToggled(bool visible); private slots: - void onPlayPause(bool checked); + void onPlayPause(); void onPrevious(); void onNext(); void onProgressReleased(); @@ -38,26 +40,31 @@ private slots: void onTrackChanged(const QJsonObject &track); void onPositionChanged(quint64 position, quint64 duration); void onTrackFinished(); + void onQueueChanged(); + void onShuffleToggled(bool checked); + + void fetchAlbumArt(const QString &url); + void onAlbumArtReady(QNetworkReply *reply); private: QobuzBackend *m_backend = nullptr; + PlayQueue *m_queue = nullptr; + + QLabel *m_artLabel = nullptr; + QLabel *m_trackLabel = nullptr; + ClickableSlider *m_progress = nullptr; + QLabel *m_timeLabel = nullptr; + VolumeButton *m_volume = nullptr; QAction *m_previous = nullptr; QAction *m_playPause = nullptr; QAction *m_next = nullptr; + QAction *m_shuffle = nullptr; + QAction *m_queueBtn = nullptr; QAction *m_search = nullptr; - ClickableSlider *m_progress = nullptr; - QLabel *m_timeLabel = nullptr; - QLabel *m_trackLabel = nullptr; - VolumeButton *m_volume = nullptr; - - bool m_playing = false; - bool m_seeking = false; - - // Playback queue (track IDs) for next/prev - QVector m_queue; - int m_queueIdx = -1; - - void addSpacerWidget(); + QNetworkAccessManager *m_nam = nullptr; + QString m_currentArtUrl; + bool m_playing = false; + bool m_seeking = false; }; diff --git a/src/view/queuepanel.cpp b/src/view/queuepanel.cpp new file mode 100644 index 0000000..5a4ccfd --- /dev/null +++ b/src/view/queuepanel.cpp @@ -0,0 +1,111 @@ +#include "queuepanel.hpp" + +#include +#include +#include +#include + +static constexpr int UpcomingIndexRole = Qt::UserRole + 1; +static constexpr int IsPlayNextRole = Qt::UserRole + 2; + +QueuePanel::QueuePanel(PlayQueue *queue, QWidget *parent) + : QDockWidget(tr("Queue"), parent) + , m_queue(queue) +{ + setObjectName(QStringLiteral("queuePanel")); + setFeatures(QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetClosable); + + auto *container = new QWidget(this); + auto *layout = new QVBoxLayout(container); + layout->setContentsMargins(4, 4, 4, 4); + layout->setSpacing(4); + + // Header row: count label + Clear button + auto *headerRow = new QHBoxLayout; + m_countLabel = new QLabel(tr("Up next: 0 tracks"), container); + m_clearBtn = new QPushButton(tr("Clear"), container); + m_clearBtn->setMaximumWidth(64); + headerRow->addWidget(m_countLabel, 1); + headerRow->addWidget(m_clearBtn); + layout->addLayout(headerRow); + + m_list = new QListWidget(container); + m_list->setAlternatingRowColors(true); + m_list->setContextMenuPolicy(Qt::CustomContextMenu); + layout->addWidget(m_list, 1); + + setWidget(container); + setMinimumWidth(200); + + connect(m_queue, &PlayQueue::queueChanged, this, &QueuePanel::refresh); + connect(m_clearBtn, &QPushButton::clicked, this, [this] { + m_queue->clearUpcoming(); + }); + connect(m_list, &QListWidget::itemDoubleClicked, + this, &QueuePanel::onItemDoubleClicked); + connect(m_list, &QListWidget::customContextMenuRequested, + this, &QueuePanel::onContextMenu); + + refresh(); +} + +void QueuePanel::refresh() +{ + m_list->clear(); + + const QVector upcoming = m_queue->upcomingTracks(); + const int playNextCount = m_queue->playNextCount(); + + m_countLabel->setText(tr("Up next: %1 track(s)").arg(upcoming.size())); + m_clearBtn->setEnabled(!upcoming.isEmpty()); + + for (int i = 0; i < upcoming.size(); ++i) { + const QJsonObject &t = upcoming.at(i); + const QString title = t["title"].toString(); + const QString artist = t["performer"].toObject()["name"].toString().isEmpty() + ? t["album"].toObject()["artist"].toObject()["name"].toString() + : t["performer"].toObject()["name"].toString(); + + const QString text = artist.isEmpty() + ? title + : QStringLiteral("%1 — %2").arg(artist, title); + + auto *item = new QListWidgetItem(text, m_list); + item->setData(UpcomingIndexRole, i); + item->setData(IsPlayNextRole, i < playNextCount); + + // "Play Next" tracks shown slightly differently + if (i < playNextCount) { + QFont f = item->font(); + f.setItalic(true); + item->setFont(f); + } + } +} + +void QueuePanel::onItemDoubleClicked(QListWidgetItem *item) +{ + // Double-clicking an upcoming item is not needed for now (could skip to it later) + Q_UNUSED(item) +} + +void QueuePanel::onContextMenu(const QPoint &pos) +{ + auto *item = m_list->itemAt(pos); + if (!item) return; + + const int idx = item->data(UpcomingIndexRole).toInt(); + + QMenu menu(this); + auto *removeAct = menu.addAction(tr("Remove from queue")); + auto *toTopAct = menu.addAction(tr("Move to top (play next)")); + + connect(removeAct, &QAction::triggered, this, [this, idx] { + m_queue->removeUpcoming(idx); + }); + connect(toTopAct, &QAction::triggered, this, [this, idx] { + m_queue->moveUpcomingToTop(idx); + }); + + menu.exec(m_list->viewport()->mapToGlobal(pos)); +} diff --git a/src/view/queuepanel.hpp b/src/view/queuepanel.hpp new file mode 100644 index 0000000..1ab0864 --- /dev/null +++ b/src/view/queuepanel.hpp @@ -0,0 +1,27 @@ +#pragma once + +#include "../playqueue.hpp" + +#include +#include +#include +#include + +class QueuePanel : public QDockWidget +{ + Q_OBJECT + +public: + explicit QueuePanel(PlayQueue *queue, QWidget *parent = nullptr); + +private slots: + void refresh(); + void onItemDoubleClicked(QListWidgetItem *item); + void onContextMenu(const QPoint &pos); + +private: + PlayQueue *m_queue = nullptr; + QLabel *m_countLabel = nullptr; + QListWidget *m_list = nullptr; + QPushButton *m_clearBtn = nullptr; +};