Initial implementation of qobuz-qt

- Rust backend (qobuz-backend static lib): Qobuz API client (reqwest/tokio),
  Symphonia audio decoder, CPAL audio output, extern "C" FFI bridge
- Qt 6 frontend mirroring spotify-qt layout: toolbar with playback controls,
  left library dock, central track list, right search panel
- Auth: email/password login with MD5-signed requests; session token persisted
  via QSettings
- Playback: double-click a track → Rust fetches stream URL → Symphonia decodes
  → CPAL outputs to default audio device
- Dark Fusion palette matching spotify-qt feel

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
joren
2026-03-23 23:34:23 +01:00
commit 9402dca7ed
40 changed files with 3963 additions and 0 deletions

95
CMakeLists.txt Normal file
View File

@@ -0,0 +1,95 @@
cmake_minimum_required(VERSION 3.21)
project(qobuz-qt LANGUAGES CXX VERSION 0.1.0)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Optional D-Bus support
option(USE_DBUS "Use D-Bus integration" ON)
# LTO support
option(USE_LTO "Use link time optimization" OFF)
if (POLICY CMP0072)
cmake_policy(SET CMP0072 NEW)
endif ()
# Find Qt 6
find_package(Qt6 COMPONENTS Core Widgets Network Gui Svg REQUIRED)
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)
corrosion_import_crate(MANIFEST_PATH rust/Cargo.toml CRATES qobuz-backend)
# Create main executable
add_executable(qobuz-qt res.qrc)
# Source files
add_subdirectory(src)
# Include paths
target_include_directories(qobuz-qt PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/src"
"${CMAKE_CURRENT_SOURCE_DIR}/rust/include"
)
# Version / app definitions
target_compile_definitions(qobuz-qt PRIVATE APP_VERSION="v${PROJECT_VERSION}")
target_compile_definitions(qobuz-qt PRIVATE APP_NAME="${PROJECT_NAME}")
# Link Qt + Rust backend
target_link_libraries(qobuz-qt PRIVATE
Qt6::Core
Qt6::Widgets
Qt6::Network
Qt6::Gui
Qt6::Svg
qobuz-backend
)
# Platform-specific system libs needed by the Rust audio stack (cpal/ALSA)
if (UNIX AND NOT APPLE)
target_link_libraries(qobuz-qt PRIVATE asound)
endif ()
# Compiler warnings
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_compile_options(qobuz-qt PRIVATE -Wall -Wextra -Wno-unused-parameter)
endif ()
# D-Bus
if (Qt6DBus_FOUND)
target_compile_definitions(qobuz-qt PRIVATE USE_DBUS)
target_link_libraries(qobuz-qt PRIVATE Qt6::DBus)
endif ()
# LTO
if (USE_LTO)
include(CheckIPOSupported)
check_ipo_supported(RESULT ipo_supported OUTPUT ipo_error)
if (ipo_supported AND CMAKE_BUILD_TYPE STREQUAL "Release")
set_property(TARGET qobuz-qt PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
endif ()
endif ()
# Install
if (UNIX)
install(FILES res/logo/qobuz-qt.svg DESTINATION share/icons/hicolor/scalable/apps)
install(FILES res/app/qobuz-qt.desktop DESTINATION share/applications)
install(TARGETS qobuz-qt RUNTIME DESTINATION bin)
endif ()