From c3f22f1d108f12d45b4513b0b1417f4c27290de0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20M=C3=A9ndez?= Date: Sun, 7 Jul 2024 21:19:36 -0600 Subject: [PATCH] WIP --- .gitignore | 5 + CMakeLists.txt | 213 ++++++++++++++++++++--- CMakeLists.txt.user | 416 -------------------------------------------- README.md | 2 +- debian/control | 4 +- debian/rules | 14 +- 6 files changed, 201 insertions(+), 453 deletions(-) delete mode 100644 CMakeLists.txt.user diff --git a/.gitignore b/.gitignore index 4fa9cbf..4e8648e 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,9 @@ __pycache__/ pip-log.txt pip-delete-this-directory.txt +# Build artifacts +CMakeFiles +build +CMakeLists.txt.user + diff --git a/CMakeLists.txt b/CMakeLists.txt index 7071717..2ddfc72 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,45 +1,204 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: BSD-3-Clause - cmake_minimum_required(VERSION 3.16) -project(player LANGUAGES CXX) +project(player VERSION 1.0 LANGUAGES C CXX) -set(CMAKE_AUTOMOC ON) +set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOUIC ON) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/build) -if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") -endif() - -set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/multimedia/player") +find_package(QT NAMES Qt5 Qt6 REQUIRED COMPONENTS Core) +find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Concurrent DBus Gui Multimedia MultimediaWidgets Network Widgets) -find_package(Qt6 REQUIRED COMPONENTS MultimediaWidgets Network) +qt_standard_project_setup() -qt_add_executable(player +qt_add_executable(player WIN32 MACOSX_BUNDLE + audiosource.cpp audiosource.h + audiosourcebluetooth.cpp audiosourcebluetooth.h + audiosourcecd.cpp audiosourcecd.h + audiosourcecoordinator.cpp audiosourcecoordinator.h + audiosourcefile.cpp audiosourcefile.h + audiosourcewspectrumcapture.cpp audiosourcewspectrumcapture.h + controlbuttonswidget.cpp controlbuttonswidget.h controlbuttonswidget.ui + desktopbasewindow.cpp desktopbasewindow.h desktopbasewindow.ui + desktopplayerwindow.cpp desktopplayerwindow.h desktopplayerwindow.ui + embeddedbasewindow.cpp embeddedbasewindow.h embeddedbasewindow.ui + fft.cpp fft.h + filebrowsericonprovider.cpp filebrowsericonprovider.h main.cpp - player.cpp player.h - playercontrols.cpp playercontrols.h + mainmenuview.cpp mainmenuview.h mainmenuview.ui + mainwindow.cpp mainwindow.h + mediaplayer.cpp mediaplayer.h + playerview.cpp playerview.h playerview.ui playlistmodel.cpp playlistmodel.h - videowidget.cpp videowidget.h - qmediaplaylist.cpp qmediaplaylist.h - qmediaplaylist_p.cpp qmediaplaylist_p.h + playlistview.cpp playlistview.h playlistview.ui + qmediaplaylist.cpp qmediaplaylist.h qmediaplaylist_p.cpp qmediaplaylist_p.h qplaylistfileparser.cpp qplaylistfileparser.h - mainwindow.h mainwindow.cpp mainwindow.ui - uiassets.qrc + scale.cpp scale.h + scrolltext.cpp scrolltext.h + spectrumwidget.cpp spectrumwidget.h + systemaudiocontrol.cpp systemaudiocontrol.h + titlebar.cpp titlebar.h titlebar.ui + util.cpp util.h ) - -set_target_properties(player PROPERTIES - WIN32_EXECUTABLE TRUE - MACOSX_BUNDLE TRUE +target_include_directories(player PRIVATE + /usr/include/pipewire-0.3 + /usr/include/python3.11 + /usr/include/spa-0.2 ) -target_link_libraries(player PUBLIC +target_link_libraries(player PRIVATE + # Remove: L/usr/lib/python3.11/config-3.11-x86_64-linux-gnu/ + Qt::Concurrent + Qt::Core + Qt::DBus + Qt::Gui + Qt::Multimedia Qt::MultimediaWidgets Qt::Network + Qt::Widgets + asound + pipewire-0.3 + pulse + pulse-simple + python3.11 + tag +) + + +# Resources: +set(uiassets_resource_files + "assets/LED_LCD_123.ttf" + "assets/Minecraft.ttf" + "assets/Winamp.ttf" + "assets/background.png" + "assets/balanceHandle.png" + "assets/balanceHandle_p.png" + "assets/bignumbers.ttf" + "assets/eq_off.png" + "assets/eq_off_p.png" + "assets/eq_on.png" + "assets/eq_on_p.png" + "assets/fb_folderIcon.png" + "assets/fb_folderIcon_selected.png" + "assets/fb_musicIcon.png" + "assets/fb_musicIcon_selected.png" + "assets/filesIcon.png" + "assets/logoButton.png" + "assets/next.png" + "assets/next_p.png" + "assets/open.png" + "assets/open_p.png" + "assets/pause.png" + "assets/pause_p.png" + "assets/pl_add.png" + "assets/pl_addIcon.png" + "assets/pl_add_p.png" + "assets/pl_close.png" + "assets/pl_close_p.png" + "assets/pl_homeIcon.png" + "assets/pl_off.png" + "assets/pl_off_p.png" + "assets/pl_on.png" + "assets/pl_on_p.png" + "assets/pl_playerIcon.png" + "assets/pl_upIcon.png" + "assets/play.png" + "assets/play_p.png" + "assets/playlistsIcon.png" + "assets/posHandle.png" + "assets/posHandle_p.png" + "assets/prev.png" + "assets/prev_p.png" + "assets/repeat_off.png" + "assets/repeat_off_p.png" + "assets/repeat_on.png" + "assets/repeat_on_p.png" + "assets/scroll_handle.png" + "assets/scroll_handle_p.png" + "assets/shuffle_off.png" + "assets/shuffle_off_p.png" + "assets/shuffle_on.png" + "assets/shuffle_on_p.png" + "assets/spotifyIcon.png" + "assets/status_paused.png" + "assets/status_playing.png" + "assets/status_stopped.png" + "assets/stop.png" + "assets/stop_p.png" + "assets/visualizationBackground.png" + "assets/volumeHandle.png" + "assets/volumeHandle_p.png" + "assets/windowClose.png" + "assets/windowMaximize.png" + "assets/windowMinimize.png" + "styles/controlbuttonswidget.repeatButton.1x.qss" + "styles/controlbuttonswidget.repeatButton.2x.qss" + "styles/controlbuttonswidget.repeatButton.3x.qss" + "styles/controlbuttonswidget.repeatButton.4x.qss" + "styles/controlbuttonswidget.shuffleButton.1x.qss" + "styles/controlbuttonswidget.shuffleButton.2x.qss" + "styles/controlbuttonswidget.shuffleButton.3x.qss" + "styles/controlbuttonswidget.shuffleButton.4x.qss" + "styles/desktopbasewindow.1x.qss" + "styles/desktopbasewindow.2x.qss" + "styles/desktopbasewindow.3x.qss" + "styles/desktopbasewindow.4x.qss" + "styles/playerview.balanceSlider.1x.qss" + "styles/playerview.balanceSlider.2x.qss" + "styles/playerview.balanceSlider.3x.qss" + "styles/playerview.balanceSlider.4x.qss" + "styles/playerview.codecDetailsContainer.1x.qss" + "styles/playerview.codecDetailsContainer.2x.qss" + "styles/playerview.codecDetailsContainer.3x.qss" + "styles/playerview.codecDetailsContainer.4x.qss" + "styles/playerview.eqButton.1x.qss" + "styles/playerview.eqButton.2x.qss" + "styles/playerview.eqButton.3x.qss" + "styles/playerview.eqButton.4x.qss" + "styles/playerview.kbpsFrame.1x.qss" + "styles/playerview.kbpsFrame.2x.qss" + "styles/playerview.kbpsFrame.3x.qss" + "styles/playerview.kbpsFrame.4x.qss" + "styles/playerview.khzFrame.1x.qss" + "styles/playerview.khzFrame.2x.qss" + "styles/playerview.khzFrame.3x.qss" + "styles/playerview.khzFrame.4x.qss" + "styles/playerview.playlistButton.1x.qss" + "styles/playerview.playlistButton.2x.qss" + "styles/playerview.playlistButton.3x.qss" + "styles/playerview.playlistButton.4x.qss" + "styles/playerview.posBar.1x.qss" + "styles/playerview.posBar.2x.qss" + "styles/playerview.posBar.3x.qss" + "styles/playerview.posBar.4x.qss" + "styles/playerview.songInfoContainer.1x.qss" + "styles/playerview.songInfoContainer.2x.qss" + "styles/playerview.songInfoContainer.3x.qss" + "styles/playerview.songInfoContainer.4x.qss" + "styles/playerview.visualizationFrame.1x.qss" + "styles/playerview.visualizationFrame.2x.qss" + "styles/playerview.visualizationFrame.3x.qss" + "styles/playerview.visualizationFrame.4x.qss" + "styles/playerview.volumeSlider.1x.qss" + "styles/playerview.volumeSlider.2x.qss" + "styles/playerview.volumeSlider.3x.qss" + "styles/playerview.volumeSlider.4x.qss" +) + +qt_add_resources(player "uiassets" + PREFIX + "/" + FILES + ${uiassets_resource_files} ) install(TARGETS player - RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" - BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" - LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION . + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) + +qt_generate_deploy_app_script( + TARGET player + FILENAME_VARIABLE deploy_script + NO_UNSUPPORTED_PLATFORM_ERROR ) +install(SCRIPT ${deploy_script}) diff --git a/CMakeLists.txt.user b/CMakeLists.txt.user deleted file mode 100644 index 3c7c899..0000000 --- a/CMakeLists.txt.user +++ /dev/null @@ -1,416 +0,0 @@ - - - - - - EnvironmentId - {6717548f-11a6-43a5-b836-faca492f22a8} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - false - true - false - 0 - true - true - 0 - 8 - true - false - 1 - true - true - true - *.md, *.MD, Makefile - false - true - true - - - - ProjectExplorer.Project.PluginSettings - - - true - false - true - true - true - true - - - 0 - true - - true - true - Builtin.DefaultTidyAndClazy - 2 - true - - - - true - - - - - ProjectExplorer.Project.Target.0 - - Desktop - Desktop Qt 6.5.2 GCC 64bit - Desktop Qt 6.5.2 GCC 64bit - qt.qt6.652.gcc_64_kit - 0 - 0 - 0 - - Debug - 2 - false - - -DCMAKE_GENERATOR:STRING=Ninja --DCMAKE_BUILD_TYPE:STRING=Debug --DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake --DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable} --DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX} --DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C} --DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx} --DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG} - 0 - /home/rod/Qt/Examples/Qt-6.5.2/multimedia/build-player-Desktop_Qt_6_5_2_GCC_64bit-Debug - - - - - all - - false - - true - Build - CMakeProjectManager.MakeStep - - 1 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - - - clean - - false - - true - Build - CMakeProjectManager.MakeStep - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - false - - Debug - CMakeProjectManager.CMakeBuildConfiguration - - - Release - 2 - false - - -DCMAKE_GENERATOR:STRING=Ninja --DCMAKE_BUILD_TYPE:STRING=Release --DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake --DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable} --DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX} --DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C} --DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx} --DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG} - /home/rod/Qt/Examples/Qt-6.5.2/multimedia/build-player-Desktop_Qt_6_5_2_GCC_64bit-Release - - - - - all - - false - - true - CMakeProjectManager.MakeStep - - 1 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - - - clean - - false - - true - CMakeProjectManager.MakeStep - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - false - - Release - CMakeProjectManager.CMakeBuildConfiguration - - - RelWithDebInfo - 2 - false - - -DCMAKE_GENERATOR:STRING=Ninja --DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo --DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake --DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable} --DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX} --DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C} --DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx} --DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG} - /home/rod/Qt/Examples/Qt-6.5.2/multimedia/build-player-Desktop_Qt_6_5_2_GCC_64bit-RelWithDebInfo - - - - - all - - false - - true - CMakeProjectManager.MakeStep - - 1 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - - - clean - - false - - true - CMakeProjectManager.MakeStep - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - false - - Release with Debug Information - CMakeProjectManager.CMakeBuildConfiguration - - - RelWithDebInfo - 2 - false - - -DCMAKE_GENERATOR:STRING=Ninja --DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo --DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake --DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable} --DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX} --DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C} --DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx} --DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG} - 0 - /home/rod/Qt/Examples/Qt-6.5.2/multimedia/build-player-Desktop_Qt_6_5_2_GCC_64bit-Profile - - - - - all - - false - - true - CMakeProjectManager.MakeStep - - 1 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - - - clean - - false - - true - CMakeProjectManager.MakeStep - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - false - - Profile - CMakeProjectManager.CMakeBuildConfiguration - - - MinSizeRel - 2 - false - - -DCMAKE_GENERATOR:STRING=Ninja --DCMAKE_BUILD_TYPE:STRING=MinSizeRel --DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake --DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable} --DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX} --DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C} --DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx} --DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG} - /home/rod/Qt/Examples/Qt-6.5.2/multimedia/build-player-Desktop_Qt_6_5_2_GCC_64bit-MinSizeRel - - - - - all - - false - - true - CMakeProjectManager.MakeStep - - 1 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - - - clean - - false - - true - CMakeProjectManager.MakeStep - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - false - - Minimum Size Release - CMakeProjectManager.CMakeBuildConfiguration - - 5 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - - false - ProjectExplorer.DefaultDeployConfiguration - - 1 - - true - true - true - - 2 - - false - player - CMakeProjectManager.CMakeRunConfiguration.player - player - true - true - true - /home/rod/Qt/Examples/Qt-6.5.2/multimedia/build-player-Desktop_Qt_6_5_2_GCC_64bit-Debug - - 1 - - - - ProjectExplorer.Project.TargetCount - 1 - - - ProjectExplorer.Project.Updater.FileVersion - 22 - - - Version - 22 - - diff --git a/README.md b/README.md index cf8b32c..7844a4b 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ pip install -r python/requirements.txt Install and setup [sbuild](https://wiki.debian.org/sbuild) running the following commands: ```bash -sudo apt-get install sbuild schroot debootstrap apt-cacher-ng devscripts piuparts dh-python +sudo apt-get install sbuild schroot debootstrap apt-cacher-ng devscripts piuparts dh-python dh-cmake sudo tee ~/.sbuildrc << "EOF" ############################################################################## # PACKAGE BUILD RELATED (additionally produce _source.changes) diff --git a/debian/control b/debian/control index dcf866e..12059fe 100644 --- a/debian/control +++ b/debian/control @@ -22,9 +22,9 @@ Build-Depends: python3-dev, dh-python Standards-Version: 4.6.2 -Homepage: https://github.com/Rodmg/linamp +Homepage: https://github.com/Rodmg/linamp Vcs-Browser: https://github.com/Rodmg/linamp -Vcs-Git: https://github.com/Rodmg/linamp.git +Vcs-Git: https://github.com/Rodmg/linamp.git Package: linamp Architecture: any diff --git a/debian/rules b/debian/rules index 322edd4..54f9412 100755 --- a/debian/rules +++ b/debian/rules @@ -1,18 +1,18 @@ #!/usr/bin/make -f %: - dh $@ --with python3 + dh $@ --with python3 --buildsystem=cmake -override_dh_auto_build: - qmake6 -makefile - make +# override_dh_auto_build: +# qmake6 -makefile +# make -override_dh_auto_configure: - echo "Skipped" +# override_dh_auto_configure: +# echo "Skipped" override_dh_auto_install: mkdir -p debian/linamp/usr/bin - cp player debian/linamp/usr/bin/linamp-player + cp build/player debian/linamp/usr/bin/linamp-player mkdir -p debian/linamp/usr/lib/python3/dist-packages/linamp cp python/linamp/__init__.py debian/linamp/usr/lib/python3/dist-packages/linamp/__init__.py