### Unity Discord RPC Setup Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/3rdparty/discord-rpc/README.md Guide for integrating the Discord Rich Presence SDK into a Unity project. This involves copying DLLs and a C# script for different platforms. ```csharp Create a Plugins folder inside your Assets folder if you don't already have one Copy the file DiscordRpc.cs from here (https://github.com/discordapp/discord-rpc/blob/master/examples/button-clicker/Assets/DiscordRpc.cs) into your Assets folder. #### Windows 4. Create x86 and x86_64 folders inside Assets/Plugins/ 5. Copy discord-rpc-win/win64-dynamic/bin/discord-rpc.dll to Assets/Plugins/x86_64/ 6. Copy discord-rpc-win/win32-dynamic/bin/discord-rpc.dll to Assets/Plugins/x86/ #### MacOS 4. Copy discord-rpc-osx/osx-dynamic/lib/libdiscord-rpc.dylib to Assets/Plugins/ 5. Rename libdiscord-rpc.dylib to discord-rpc.bundle #### Linux 4. Copy discord-rpc-linux/linux-dynamic-lib/libdiscord-rpc.so to Assets/Plugins/ ``` -------------------------------- ### Build and Install Strawberry with CMake Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/README.md These commands outline the process of building and installing Strawberry from source using CMake. It involves configuring the build, compiling the project in parallel, and then installing the built application. ```shell cd strawberry cmake -S . -B build cmake --build build --parallel $(nproc) sudo cmake --install build ``` -------------------------------- ### Unreal Engine 4 Discord RPC Setup Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/3rdparty/discord-rpc/README.md Instructions for setting up the Discord RPC plugin within an Unreal Engine 4 project. This includes copying library files and header files for Windows, macOS, and Linux. ```cpp At [YOUR_UE_PROJECT]/Plugins/discordrpc/source/ThirdParty/DiscordRpcLibrary/, create an Include folder and copy discord_rpc.h and discord_register.h to it from the zip #### Windows - At [YOUR_UE_PROJECT]/Plugins/discordrpc/source/ThirdParty/DiscordRpcLibrary/, create a Win64 folder - Copy lib/discord-rpc.lib and bin/discord-rpc.dll from [RELEASE_ZIP]/win64-dynamic to the Win64 folder #### Mac - At [YOUR_UE_PROJECT]/Plugins/discordrpc/source/ThirdParty/DiscordRpcLibrary/, create a Mac folder - Copy libdiscord-rpc.dylib from [RELEASE_ZIP]/osx-dynamic/lib to the Mac folder #### Linux - At [YOUR_UE_PROJECT]/Plugins/discordrpc/source/ThirdParty/DiscordRpcLibrary/, create a Linux folder - Inside, create another folder x86_64-unknown-linux-gnu - Copy libdiscord-rpc.so from [RELEASE_ZIP]/linux-dynamic/lib to Linux/x86_64-unknown-linux-gnu ``` -------------------------------- ### CMake: Test Utilities Library Setup Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/tests/CMakeLists.txt Configures the 'test_utils' static library, including source files, mock headers, and linking against Google Test, Google Mock, and Qt modules. ```cmake enable_testing() add_custom_target(strawberry_tests echo "Running Strawberry tests" WORKING_DIRECTORY ${CURRENT_BINARY_DIR}) add_custom_target(build_tests WORKING_DIRECTORY ${CURRENT_BINARY_DIR}) add_dependencies(strawberry_tests build_tests) add_definitions(-DGTEST_USE_OWN_TR1_TUPLE=1) set(TESTUTILS-SOURCES src/mock_networkaccessmanager.cpp src/mock_playlistitem.cpp src/test_utils.cpp ) set(TESTUTILS-MOC-HEADERS src/mock_networkaccessmanager.h src/test_utils.h) qt_wrap_cpp(TESTUTILS-SOURCES-MOC ${TESTUTILS-MOC-HEADERS}) add_library(test_utils STATIC EXCLUDE_FROM_ALL ${TESTUTILS-SOURCES} ${TESTUTILS-SOURCES-MOC}) target_include_directories(test_utils PRIVATE ${CMAKE_BINARY_DIR}/src ${CMAKE_SOURCE_DIR}/src ) target_link_libraries(test_utils PRIVATE GTest::gtest GTest::gmock Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Network Qt${QT_VERSION_MAJOR}::Sql Qt${QT_VERSION_MAJOR}::Test ) ``` -------------------------------- ### Installation of Executable Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/CMakeLists.txt Installs the Strawberry executable to the 'bin' directory on non-macOS platforms. ```cmake if(NOT APPLE) install(TARGETS strawberry RUNTIME DESTINATION bin) endif() ``` -------------------------------- ### CMake Project Setup and Policy Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/CMakeLists.txt Initializes the CMake project, sets the minimum version, and configures project policies for compatibility and modern CMake practices. ```cmake cmake_minimum_required(VERSION 3.13) project(strawberry C CXX) if(APPLE) enable_language(OBJC OBJCXX) endif() if(POLICY CMP0054) cmake_policy(SET CMP0054 NEW) endif() if(POLICY CMP0074) cmake_policy(SET CMP0074 NEW) endif() ``` -------------------------------- ### Setup Upstream Remote Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/CONTRIBUTING.md Adds the official Strawberry repository as a remote named 'upstream' for fetching updates. ```git git remote add upstream git@github.com:strawberrymusicplayer/strawberry.git ``` -------------------------------- ### Building Discord RPC with CMake Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/3rdparty/discord-rpc/README.md This snippet demonstrates the standard CMake process for building the Discord RPC library. It involves navigating to the source directory, creating a build directory, configuring the build with CMake specifying an installation prefix, and then building the project in release mode. ```sh cd mkdir build cd build cmake .. -DCMAKE_INSTALL_PREFIX= cmake --build . --config Release --target install ``` -------------------------------- ### Installation of Translations Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/CMakeLists.txt Installs translation files to the 'share/strawberry/translations' directory if translations are enabled and configured for installation. ```cmake if(HAVE_TRANSLATIONS AND INSTALL_TRANSLATIONS AND INSTALL_TRANSLATIONS_FILES) install(FILES ${INSTALL_TRANSLATIONS_FILES} DESTINATION share/strawberry/translations) endif() ``` -------------------------------- ### Example Git Commit Message Format Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/CONTRIBUTING.md Demonstrates the recommended format for commit messages, including a subject line and an optional body. ```git StretchHeaderView: Set default section size As of Qt 6.6.1, style changes are resetting the column sizes. To prevent this, we set a default section size. Fixes #1328 ``` -------------------------------- ### CMake Project Options Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/CMakeLists.txt Defines user-configurable options for the build, such as enabling warnings as errors, using RPATH, installing translations, controlling debug output, and bundling dependencies. ```cmake option(BUILD_WERROR "Build with -Werror" OFF) option(USE_RPATH "Use RPATH" APPLE) option(USE_INSTALL_PREFIX "Look for data in CMAKE_INSTALL_PREFIX" ON) option(INSTALL_TRANSLATIONS "Install translations" OFF) option(ENABLE_DEBUG_OUTPUT "Enable debug output" ${ENABLE_DEBUG_OUTPUT_DEFAULT}) option(USE_BUNDLE "Bundle dependencies" ${USE_BUNDLE_DEFAULT}) if(WIN32) option(ENABLE_WIN32_CONSOLE "Show the windows console even outside Debug mode" ${ENABLE_WIN32_CONSOLE_DEFAULT}) endif() ``` -------------------------------- ### CMake Build Configuration for Strawberry Music Player Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/dist/CMakeLists.txt This snippet details the CMake build process for Strawberry Music Player. It configures scripts and files based on the operating system (Linux, macOS, Windows) and handles installation of application resources, desktop entries, man pages, and icons. ```cmake configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/maketarball.sh.in ${CMAKE_CURRENT_SOURCE_DIR}/scripts/maketarball.sh @ONLY) if(RPM_DISTRO AND RPM_DATE) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/unix/strawberry.spec.in ${CMAKE_BINARY_DIR}/strawberry.spec @ONLY) endif() if(APPLE) if(DEFINED ENV{MACOSX_DEPLOYMENT_TARGET}) set(LSMinimumSystemVersion $ENV{MACOSX_DEPLOYMENT_TARGET}) else() set(LSMinimumSystemVersion 12.0) endif() configure_file(${CMAKE_CURRENT_SOURCE_DIR}/macos/Info.plist.in ${CMAKE_CURRENT_BINARY_DIR}/macos/Info.plist) endif() if(WIN32) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/windows/windres.rc.in ${CMAKE_BINARY_DIR}/windres.rc) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/windows/strawberry.nsi.in ${CMAKE_BINARY_DIR}/strawberry.nsi @ONLY) endif() if(UNIX AND NOT APPLE) install(FILES ../data/icons/48x48/strawberry.png DESTINATION share/icons/hicolor/48x48/apps/) install(FILES ../data/icons/64x64/strawberry.png DESTINATION share/icons/hicolor/64x64/apps/) install(FILES ../data/icons/128x128/strawberry.png DESTINATION share/icons/hicolor/128x128/apps/) install(FILES unix/org.strawberrymusicplayer.strawberry.desktop DESTINATION share/applications) install(FILES unix/org.strawberrymusicplayer.strawberry.appdata.xml DESTINATION share/metainfo) install(FILES unix/strawberry.1 DESTINATION share/man/man1) endif() if(APPLE) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/macos/Info.plist" DESTINATION "${CMAKE_BINARY_DIR}/strawberry.app/Contents") install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/macos/strawberry.icns" DESTINATION "${CMAKE_BINARY_DIR}/strawberry.app/Contents/Resources") endif() ``` -------------------------------- ### CMake: Test Resource and Main Libraries Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/tests/CMakeLists.txt Sets up resource files for tests and creates 'test_main' and 'test_gui_main' static libraries, linking them with necessary dependencies like GLib, GStreamer, and Qt modules. ```cmake qt_add_resources(TEST-RESOURCE-SOURCES data/testdata.qrc ${CMAKE_SOURCE_DIR}/data/data.qrc ${CMAKE_SOURCE_DIR}/data/icons.qrc) add_library(test_main STATIC EXCLUDE_FROM_ALL ${TEST-RESOURCE-SOURCES} src/main.cpp) target_include_directories(test_main PRIVATE ${CMAKE_BINARY_DIR}/src ${CMAKE_SOURCE_DIR}/src ) target_link_libraries(test_main PRIVATE ${CMAKE_THREAD_LIBS_INIT} PkgConfig::GLIB PkgConfig::GOBJECT PkgConfig::GSTREAMER_BASE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Widgets strawberry_lib ) add_library(test_gui_main STATIC EXCLUDE_FROM_ALL ${TEST-RESOURCE-SOURCES} src/main.cpp) target_include_directories(test_gui_main PRIVATE ${CMAKE_BINARY_DIR}/src ${CMAKE_SOURCE_DIR}/src ) target_link_libraries(test_gui_main PRIVATE ${CMAKE_THREAD_LIBS_INIT} PkgConfig::GLIB PkgConfig::GOBJECT PkgConfig::GSTREAMER_BASE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Widgets strawberry_lib ) set_target_properties(test_gui_main PROPERTIES COMPILE_DEFINITIONS GUI) ``` -------------------------------- ### Python Build Script for Discord RPC Samples Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/3rdparty/discord-rpc/README.md This describes the usage of a Python wrapper script (`build.py`) for automating the CMake build process for Discord RPC and its sample projects. The script depends on the 'click' library and can be used to build specific platform targets like Unity or Unreal. ```python # Ensure click is installed: pip install click # To build for Unity: # python build.py unity # To build for Unreal: # python build.py unreal ``` -------------------------------- ### Global Shortcuts Backend Configuration Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/CMakeLists.txt Configures the build for global shortcuts, supporting different backends like KGlobalAccel (via D-Bus), X11, macOS, and Windows. It includes specific source and header files for each platform. ```cmake if(HAVE_KGLOBALACCEL_GLOBALSHORTCUTS) optional_source(HAVE_KGLOBALACCEL_GLOBALSHORTCUTS SOURCES src/globalshortcuts/globalshortcutsbackend-kglobalaccel.cpp HEADERS src/globalshortcuts/globalshortcutsbackend-kglobalaccel.h ) qt_add_dbus_interface(SOURCES src/globalshortcuts/org.kde.KGlobalAccel.xml kglobalaccel) qt_add_dbus_interface(SOURCES src/globalshortcuts/org.kde.KGlobalAccel.Component.xml kglobalaccelcomponent) endif() optional_source(HAVE_X11_GLOBALSHORTCUTS SOURCES src/globalshortcuts/globalshortcutsbackend-x11.cpp src/globalshortcuts/globalshortcut.cpp src/globalshortcuts/globalshortcut-x11.cpp HEADERS src/globalshortcuts/globalshortcutsbackend-x11.h src/globalshortcuts/globalshortcut.h ) optional_source(APPLE SOURCES src/globalshortcuts/globalshortcutsbackend-macos.mm src/globalshortcuts/globalshortcutgrabber.mm HEADERS src/globalshortcuts/globalshortcutsbackend-macos.h src/globalshortcuts/globalshortcutgrabber.h ) optional_source(WIN32 SOURCES src/globalshortcuts/globalshortcutsbackend-win.cpp src/globalshortcuts/globalshortcut.cpp src/globalshortcuts/globalshortcut-win.cpp HEADERS src/globalshortcuts/globalshortcutsbackend-win.h src/globalshortcuts/globalshortcut.h ) ``` -------------------------------- ### CMake: Individual Test File Integration Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/tests/CMakeLists.txt Demonstrates the usage of the 'add_test_file' macro to integrate various test files into the build, specifying whether they require GUI components. ```cmake add_test_file(src/utilities_test.cpp false) add_test_file(src/concurrentrun_test.cpp false) add_test_file(src/mutex_protected_test.cpp false) add_test_file(src/mergedproxymodel_test.cpp false) add_test_file(src/sqlite_test.cpp false) add_test_file(src/tagreader_test.cpp false) add_test_file(src/collectionbackend_test.cpp false) add_test_file(src/collectionmodel_test.cpp true) add_test_file(src/songplaylistitem_test.cpp false) add_test_file(src/organizeformat_test.cpp false) add_test_file(src/playlist_test.cpp true) ``` -------------------------------- ### Strawberry Music Player Context Headers Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/CMakeLists.txt Lists header files related to context management, including context views and album context. ```cpp #include "src/context/contextview.h" #include "src/context/contextalbum.h" ``` -------------------------------- ### Clone Strawberry Repository Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/CONTRIBUTING.md Clones the Strawberry project repository from GitHub to your local machine. ```git git clone git@github.com:username/strawberry.git cd strawberry ``` -------------------------------- ### Project-Wide Definitions Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/CMakeLists.txt Adds preprocessor definitions that are applied globally to the project, including Boost placeholders, Qt-specific settings for iterators, casting, string building, and keywords. ```cmake add_definitions( -DBOOST_BIND_NO_PLACEHOLDERS -DQT_STRICT_ITERATORS -DQT_NO_CAST_FROM_BYTEARRAY -DQT_USE_QSTRINGBUILDER -DQT_NO_URL_CAST_FROM_STRING -DQT_NO_CAST_TO_ASCII -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_FOREACH -DQT_ASCII_CAST_WARNINGS -DQT_NO_CAST_FROM_ASCII -DQT_NO_KEYWORDS -DQT_NO_SIGNALS_SLOTS_KEYWORDS ) if(WIN32) add_definitions( -DUNICODE -DNOMINMAX ) endif() if(BUILD_WERROR) set(CMAKE_COMPILE_WARNING_AS_ERROR ON) endif() if(NOT ENABLE_DEBUG_OUTPUT) add_definitions(-DQT_NO_DEBUG_OUTPUT) endif() if(USE_RPATH) set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) endif() ``` -------------------------------- ### Dependency Discovery using PkgConfig and find_package Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/CMakeLists.txt Finds and configures essential libraries required by Strawberry, including PkgConfig, Threads, Backtrace, Boost, ICU, ALSA, X11, GLib, GStreamer (various modules), libcdio, SQLite, libpulse, Chromaprint, and FFTW3. ```cmake find_package(PkgConfig REQUIRED) find_package(Threads REQUIRED) find_package(Backtrace) if(Backtrace_FOUND) set(HAVE_BACKTRACE ON) endif() find_package(Boost CONFIG) if(NOT Boost_FOUND) find_package(Boost REQUIRED) endif() find_package(ICU COMPONENTS uc i18n REQUIRED) if(UNIX AND NOT APPLE) if(LINUX) find_package(ALSA REQUIRED) else() find_package(ALSA) endif() find_package(X11 COMPONENTS X11_xcb) endif() pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) pkg_check_modules(GOBJECT REQUIRED IMPORTED_TARGET gobject-2.0) if(NOT APPLE) pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) if(GIO_FOUND AND UNIX) pkg_check_modules(GIO_UNIX IMPORTED_TARGET gio-unix-2.0) endif() endif() pkg_check_modules(LIBCDIO IMPORTED_TARGET libcdio) pkg_check_modules(GSTREAMER REQUIRED IMPORTED_TARGET gstreamer-1.0) pkg_check_modules(GSTREAMER_BASE REQUIRED IMPORTED_TARGET gstreamer-base-1.0) pkg_check_modules(GSTREAMER_AUDIO REQUIRED IMPORTED_TARGET gstreamer-audio-1.0) pkg_check_modules(GSTREAMER_APP REQUIRED IMPORTED_TARGET gstreamer-app-1.0) pkg_check_modules(GSTREAMER_TAG REQUIRED IMPORTED_TARGET gstreamer-tag-1.0) pkg_check_modules(GSTREAMER_PBUTILS REQUIRED IMPORTED_TARGET gstreamer-pbutils-1.0) pkg_check_modules(SQLITE REQUIRED IMPORTED_TARGET sqlite3>=3.9) if(UNIX AND NOT APPLE) pkg_check_modules(LIBPULSE IMPORTED_TARGET libpulse) endif() pkg_check_modules(CHROMAPRINT IMPORTED_TARGET libchromaprint>=1.4) pkg_check_modules(FFTW3 IMPORTED_TARGET fftw3) ``` -------------------------------- ### Strawberry Music Player Core Headers Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/CMakeLists.txt Lists the header files for core functionalities including logging, application management, player interfaces, database operations, network access, settings, threading, and utility functions. ```cpp #include "src/core/logging.h" #include "src/core/mainwindow.h" #include "src/core/application.h" #include "src/core/player.h" #include "src/core/playerinterface.h" #include "src/core/database.h" #include "src/core/memorydatabase.h" #include "src/core/deletefiles.h" #include "src/core/filesystemwatcherinterface.h" #include "src/core/mergedproxymodel.h" #include "src/core/multisortfilterproxy.h" #include "src/core/networkaccessmanager.h" #include "src/core/threadsafenetworkdiskcache.h" #include "src/core/networktimeouts.h" #include "src/core/qtfslistener.h" #include "src/core/settings.h" #include "src/core/songloader.h" #include "src/core/taskmanager.h" #include "src/core/thread.h" #include "src/core/urlhandlers.h" #include "src/core/urlhandler.h" #include "src/core/standarditemiconloader.h" #include "src/core/mimedata.h" #include "src/core/stylesheetloader.h" #include "src/core/localredirectserver.h" #include "src/core/songmimedata.h" #include "src/core/httpbaserequest.h" #include "src/core/jsonbaserequest.h" #include "src/core/oauthenticator.h" ``` -------------------------------- ### CMake: Macro for Adding Test Executables Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/tests/CMakeLists.txt Defines a macro 'add_test_file' to create test executables, link them with test utilities and main/GUI libraries, and register them with CTest. ```cmake macro(add_test_file test_source gui_required) get_filename_component(TEST_NAME ${test_source} NAME_WE) add_executable(${TEST_NAME} EXCLUDE_FROM_ALL ${test_source}) target_include_directories(${TEST_NAME} PRIVATE ${CMAKE_BINARY_DIR}/src ${CMAKE_SOURCE_DIR}/src ) target_link_libraries(${TEST_NAME} PRIVATE ${CMAKE_THREAD_LIBS_INIT} PkgConfig::GLIB PkgConfig::GOBJECT PkgConfig::GSTREAMER_BASE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Concurrent Qt${QT_VERSION_MAJOR}::Network Qt${QT_VERSION_MAJOR}::Sql Qt${QT_VERSION_MAJOR}::Test Qt${QT_VERSION_MAJOR}::Widgets ) target_link_libraries(${TEST_NAME} PRIVATE test_utils) set(GUI_REQUIRED ${gui_required}) if(GUI_REQUIRED) target_link_libraries(${TEST_NAME} PRIVATE test_gui_main) else() target_link_libraries(${TEST_NAME} PRIVATE test_main) endif() add_test(NAME ${TEST_NAME} COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME}${CMAKE_EXECUTABLE_SUFFIX}) add_custom_command(TARGET strawberry_tests POST_BUILD COMMAND ./${TEST_NAME}${CMAKE_EXECUTABLE_SUFFIX}) add_dependencies(build_tests ${TEST_NAME}) endmacro(add_test_file) ``` -------------------------------- ### Audio Backend Configuration Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/CMakeLists.txt Configures the build for different audio backends, including ALSA, PulseAudio, and Windows-specific audio (UWP, ASIO). ```cmake optional_source(HAVE_ALSA SOURCES src/engine/alsadevicefinder.cpp src/engine/alsapcmdevicefinder.cpp) optional_source(HAVE_PULSE SOURCES src/engine/pulsedevicefinder.cpp) optional_source(MSVC SOURCES src/engine/uwpdevicefinder.cpp src/engine/asiodevicefinder.cpp) ``` -------------------------------- ### Smart Playlist Components Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/CMakeLists.txt Provides functionality for creating and managing smart playlists within the Strawberry Music Player. This includes playlist generation, query wizards, search capabilities, and model/view components for smart playlists. ```cpp src/smartPlaylists/playlistgenerator.cpp src/smartPlaylists/playlistgeneratorinserter.cpp src/smartPlaylists/playlistgeneratormimedata.cpp src/smartPlaylists/playlistquerygenerator.cpp src/smartPlaylists/smartplaylistquerywizardplugin.cpp src/smartPlaylists/smartplaylistquerywizardpluginsortpage.cpp src/smartPlaylists/smartplaylistquerywizardpluginsearchpage.cpp src/smartPlaylists/smartplaylistsearch.cpp src/smartPlaylists/smartplaylistsearchpreview.cpp src/smartPlaylists/smartplaylistsearchterm.cpp src/smartPlaylists/smartplaylistsearchtermwidget.cpp src/smartPlaylists/smartplaylistsearchtermwidgetoverlay.cpp src/smartPlaylists/smartplaylistsmodel.cpp src/smartPlaylists/smartplaylistsviewcontainer.cpp src/smartPlaylists/smartplaylistsview.cpp src/smartPlaylists/smartplaylistwizard.cpp src/smartPlaylists/smartplaylistwizardplugin.cpp src/smartPlaylists/smartplaylistwizardtypepage.cpp src/smartPlaylists/smartplaylistwizardfinishpage.cpp ``` -------------------------------- ### Strawberry Music Player Smart Playlist Headers Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/CMakeLists.txt Contains header files for smart playlist generation and management, including generators, queries, wizards, models, and views. ```cpp #include "src/smartplaylists/playlistgenerator.h" #include "src/smartplaylists/playlistgeneratorinserter.h" #include "src/smartplaylists/playlistquerygenerator.h" #include "src/smartplaylists/playlistgeneratormimedata.h" #include "src/smartplaylists/smartplaylistquerywizardplugin.h" #include "src/smartplaylists/smartplaylistquerywizardpluginsortpage.h" #include "src/smartplaylists/smartplaylistquerywizardpluginsearchpage.h" #include "src/smartplaylists/smartplaylistsearchpreview.h" #include "src/smartplaylists/smartplaylistsearchtermwidget.h" #include "src/smartplaylists/smartplaylistsearchtermwidgetoverlay.h" #include "src/smartplaylists/smartplaylistsmodel.h" #include "src/smartplaylists/smartplaylistsviewcontainer.h" #include "src/smartplaylists/smartplaylistsview.h" #include "src/smartplaylists/smartplaylistwizard.h" #include "src/smartplaylists/smartplaylistwizardplugin.h" #include "src/smartplaylists/smartplaylistwizardtypepage.h" #include "src/smartplaylists/smartplaylistwizardfinishpage.h" ``` -------------------------------- ### Strawberry Music Player Engine Headers Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/CMakeLists.txt Includes header files for the audio engine, covering base engine functionality, device finders, and GStreamer engine implementations. ```cpp #include "src/engine/enginebase.h" #include "src/engine/devicefinders.h" #include "src/engine/gstengine.h" #include "src/engine/gstenginepipeline.h" ``` -------------------------------- ### Qt Framework Configuration Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/CMakeLists.txt Configures the Qt framework, specifying the major version, minimum required version, and essential components like Core, Concurrent, Gui, Widgets, Network, and Sql. It also includes optional components and platform-specific configurations. ```cmake set(QT_VERSION_MAJOR 6) set(QT_MIN_VERSION 6.4.0) set(QT_DEFAULT_MAJOR_VERSION ${QT_VERSION_MAJOR}) set(QT_COMPONENTS Core Concurrent Gui Widgets Network Sql) set(QT_OPTIONAL_COMPONENTS GuiPrivate LinguistTools Test) if(UNIX AND NOT APPLE) list(APPEND QT_OPTIONAL_COMPONENTS DBus) endif() set(QT_NO_PRIVATE_MODULE_WARNING ON) find_package(Qt${QT_VERSION_MAJOR} ${QT_MIN_VERSION} COMPONENTS ${QT_COMPONENTS} REQUIRED OPTIONAL_COMPONENTS ${QT_OPTIONAL_COMPONENTS}) if(TARGET "Qt${QT_VERSION_MAJOR}::GuiPrivate") set(QT_GUI_PRIVATE_FOUND ON) endif() if(Qt${QT_VERSION_MAJOR}DBus_FOUND) set(DBUS_FOUND ON) endif() if(X11_FOUND) # Check for QX11Application (Qt 6 compiled with XCB). set(CMAKE_REQUIRED_FLAGS "-std=c++17") set(CMAKE_REQUIRED_LIBRARIES Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui) check_cxx_source_compiles( "#include \n int main() {\n (void)qApp->nativeInterface();\n return 0;\n }\n " HAVE_QX11APPLICATION ) unset(CMAKE_REQUIRED_FLAGS) unset(CMAKE_REQUIRED_LIBRARIES) endif() find_package(KDSingleApplication-qt${QT_VERSION_MAJOR} 1.1.0 REQUIRED) ``` -------------------------------- ### Platform-Specific Dependencies Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/CMakeLists.txt Handles platform-specific library and package finding, including Sparkle for macOS, getopt-win for Windows, and QtSparkle for macOS and Windows. ```cmake if(APPLE) find_library(SPARKLE Sparkle) #find_package(SPMediaKeyTap REQUIRED) endif() if(WIN32) find_package(getopt-win REQUIRED) endif() if(APPLE OR WIN32) find_package(qtsparkle-qt${QT_VERSION_MAJOR}) if(TARGET "qtsparkle-qt${QT_VERSION_MAJOR}::qtsparkle") set(QTSPARKLE_FOUND ON) endif() endif() ``` -------------------------------- ### Strawberry Music Player Device Management Headers Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/CMakeLists.txt Contains header files for managing devices, including device listing, database backends, device information, properties, filesystem devices, connected devices, state filters, and views. ```cpp #include "src/device/devicemanager.h" #include "src/device/devicelister.h" #include "src/device/devicedatabasebackend.h" #include "src/device/deviceinfo.h" #include "src/device/deviceproperties.h" #include "src/device/filesystemdevice.h" #include "src/device/connecteddevice.h" #include "src/device/devicestatefiltermodel.h" #include "src/device/deviceviewcontainer.h" #include "src/device/deviceview.h" ``` -------------------------------- ### UI Files Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/CMakeLists.txt Lists all the .ui files used for defining the user interface of the Strawberry Music Player application, organized by module. ```cmake set(UI src/core/mainwindow.ui src/collection/groupbydialog.ui src/collection/collectionfilterwidget.ui src/collection/collectionviewcontainer.ui src/collection/savedgroupingmanager.ui src/playlist/playlistcontainer.ui src/playlist/playlistlistcontainer.ui src/playlist/playlistsaveoptionsdialog.ui src/playlist/playlistsequence.ui src/playlist/dynamicplaylistcontrols.ui src/queue/queueview.ui src/smartplaylists/smartplaylistquerysearchpage.ui src/smartplaylists/smartplaylistquerysortpage.ui src/smartplaylists/smartplaylistsearchpreview.ui src/smartplaylists/smartplaylistsearchtermwidget.ui src/smartplaylists/smartplaylistsviewcontainer.ui src/smartplaylists/smartplaylistwizardfinishpage.ui src/covermanager/albumcoverexport.ui src/covermanager/albumcovermanager.ui src/covermanager/albumcoversearcher.ui src/covermanager/coversearchstatisticsdialog.ui src/covermanager/coverfromurldialog.ui src/settings/settingsdialog.ui src/settings/behavioursettingspage.ui src/settings/collectionsettingspage.ui src/settings/backendsettingspage.ui src/settings/contextsettingspage.ui src/settings/playlistsettingspage.ui src/settings/scrobblersettingspage.ui src/settings/coverssettingspage.ui src/settings/lyricssettingspage.ui src/settings/networkproxysettingspage.ui src/settings/appearancesettingspage.ui src/settings/notificationssettingspage.ui src/settings/transcodersettingspage.ui src/equalizer/equalizer.ui src/equalizer/equalizerslider.ui src/dialogs/about.ui src/dialogs/errordialog.ui src/dialogs/console.ui src/dialogs/edittagdialog.ui src/dialogs/trackselectiondialog.ui src/dialogs/addstreamdialog.ui src/dialogs/userpassdialog.ui src/dialogs/lastfmimportdialog.ui src/dialogs/messagedialog.ui src/dialogs/saveplaylistsdialog.ui src/widgets/trackslider.ui src/widgets/loginstatewidget.ui src/osd/osdpretty.ui src/streaming/streamingtabsview.ui src/streaming/streamingcollectionviewcontainer.ui src/streaming/streamingsearchview.ui src/radios/radioviewcontainer.ui src/organize/organizedialog.ui src/organize/organizeerrordialog.ui src/transcoder/transcodedialog.ui src/transcoder/transcodelogdialog.ui src/transcoder/transcoderoptionsaac.ui src/transcoder/transcoderoptionsdialog.ui src/transcoder/transcoderoptionsflac.ui src/transcoder/transcoderoptionswavpack.ui src/transcoder/transcoderoptionsvorbis.ui src/transcoder/transcoderoptionsopus.ui src/transcoder/transcoderoptionsspeex.ui src/transcoder/transcoderoptionsasf.ui src/transcoder/transcoderoptionsmp3.ui src/fileview/fileview.ui src/device/deviceproperties.ui src/device/deviceviewcontainer.ui ) ``` -------------------------------- ### Strawberry Music Player Equalizer Headers Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/CMakeLists.txt Includes header files for the equalizer functionality, covering the main equalizer component and equalizer sliders. ```cpp #include "src/equalizer/equalizer.h" #include "src/equalizer/equalizerslider.h" ``` -------------------------------- ### gPod Device Support Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/CMakeLists.txt Integrates support for gPod devices, providing source and header files for gPod device management and loading. ```cmake optional_source(HAVE_GPOD SOURCES src/device/gpoddevice.cpp src/device/gpodloader.cpp HEADERS src/device/gpoddevice.h src/device/gpodloader.h ) ``` -------------------------------- ### Strawberry Music Player Analyzer Headers Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/CMakeLists.txt Lists header files for various audio analysis components, including base analyzer, containers, and specific analyzers like Block, Boom, Turbine, Sonogram, Waverubber, and Rainbow. ```cpp #include "src/analyzer/analyzerbase.h" #include "src/analyzer/analyzercontainer.h" #include "src/analyzer/blockanalyzer.h" #include "src/analyzer/boomanalyzer.h" #include "src/analyzer/turbineanalyzer.h" #include "src/analyzer/sonogramanalyzer.h" #include "src/analyzer/waverubberanalyzer.h" #include "src/analyzer/rainbowanalyzer.h" ``` -------------------------------- ### Lyrics Fetching Headers Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/CMakeLists.txt Header files for the lyrics fetching module, including various lyric providers and fetcher implementations. ```c++ src/lyrics/lyricsproviders.h src/lyrics/lyricsprovider.h src/lyrics/lyricsfetcher.h src/lyrics/lyricsfetchersearch.h src/lyrics/jsonlyricsprovider.h src/lyrics/htmllyricsprovider.h src/lyrics/ovhlyricsprovider.h src/lyrics/lololyricsprovider.h src/lyrics/geniuslyricsprovider.h src/lyrics/musixmatchlyricsprovider.h src/lyrics/chartlyricsprovider.h src/lyrics/songlyricscomlyricsprovider.h src/lyrics/azlyricscomlyricsprovider.h src/lyrics/elyricsnetlyricsprovider.h src/lyrics/letraslyricsprovider.h src/lyrics/lyricfindlyricsprovider.h ``` -------------------------------- ### Single Application Include Directories Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/CMakeLists.txt Adds include directories for the SingleApplication library if available. ```cmake if(SINGLEAPPLICATION_INCLUDE_DIRS) target_include_directories(strawberry_lib SYSTEM PUBLIC ${SINGLEAPPLICATION_INCLUDE_DIRS}) endif() ``` -------------------------------- ### Strawberry Music Player Tag Reader Headers Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/CMakeLists.txt Lists header files for the tag reader module, handling client connections, replies, file reading, and cover data/image loading. ```cpp #include "src/tagreader/tagreaderclient.h" #include "src/tagreader/tagreaderreply.h" #include "src/tagreader/tagreaderreadfilereply.h" #include "src/tagreader/tagreaderloadcoverdatareply.h" #include "src/tagreader/tagreaderloadcoverimagereply.h" ``` -------------------------------- ### CMake Build Configuration for Discord RPC Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/3rdparty/discord-rpc/CMakeLists.txt Configures the build process for the discord-rpc static library using CMake. It includes platform-specific source files and link libraries for macOS and Windows. ```cmake set(DISCORD_RPC_SOURCES discord_rpc.h discord_register.h discord_rpc.cpp discord_rpc_connection.h discord_rpc_connection.cpp discord_serialization.h discord_serialization.cpp discord_connection.h discord_backoff.h discord_msg_queue.h ) if(UNIX) list(APPEND DISCORD_RPC_SOURCES discord_connection_unix.cpp) if(APPLE) list(APPEND DISCORD_RPC_SOURCES discord_register_osx.m) add_definitions(-DDISCORD_OSX) else() list(APPEND DISCORD_RPC_SOURCES discord_register_linux.cpp) add_definitions(-DDISCORD_LINUX) endif() endif() if(WIN32) list(APPEND DISCORD_RPC_SOURCES discord_connection_win.cpp discord_register_win.cpp) add_definitions(-DDISCORD_WINDOWS) endif() add_library(discord-rpc STATIC ${DISCORD_RPC_SOURCES}) if(APPLE) target_link_libraries(discord-rpc PRIVATE "-framework AppKit") endif() if(WIN32) target_link_libraries(discord-rpc PRIVATE psapi advapi32) endif() target_include_directories(discord-rpc SYSTEM PRIVATE ${RapidJSON_INCLUDE_DIRS}) target_include_directories(discord-rpc PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) ``` -------------------------------- ### Strawberry Music Player Playlist Parser Headers Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/CMakeLists.txt Lists header files for various playlist format parsers, including ASI, ASX, CUE, M3U, PLS, WPL, XML, and XSPF, along with a base parser class. ```cpp #include "src/playlistparsers/asxiniparser.h" #include "src/playlistparsers/asxparser.h" #include "src/playlistparsers/cueparser.h" #include "src/playlistparsers/m3uparser.h" #include "src/playlistparsers/parserbase.h" #include "src/playlistparsers/playlistparser.h" #include "src/playlistparsers/plsparser.h" #include "src/playlistparsers/wplparser.h" #include "src/playlistparsers/xmlparser.h" #include "src/playlistparsers/xspfparser.h" ``` -------------------------------- ### MTP Device Support Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/CMakeLists.txt Includes source and header files for MTP (Media Transfer Protocol) device connection, device management, and loading capabilities. ```cmake src/device/mtpconnection.cpp src/device/mtpdevice.cpp src/device/mtploader.cpp src/device/mtpconnection.h src/device/mtpdevice.h src/device/mtploader.h ``` -------------------------------- ### Library Creation Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/CMakeLists.txt Creates a static library named 'strawberry_lib' from the collected source files. ```cmake add_library(strawberry_lib STATIC ${SOURCES}) ``` -------------------------------- ### Qobuz Service Integration Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/CMakeLists.txt Enables integration with the Qobuz music streaming service, including service implementation, URL handling, request management, settings, and cover art provision. ```cmake optional_source(HAVE_QOBUZ SOURCES src/qobuz/qobuzservice.cpp src/qobuz/qobuzurlhandler.cpp src/qobuz/qobuzbaserequest.cpp src/qobuz/qobuzrequest.cpp src/qobuz/qobuzstreamurlrequest.cpp src/qobuz/qobuzfavoriterequest.cpp src/settings/qobuzsettingspage.cpp src/covermanager/qobuzcoverprovider.cpp HEADERS src/qobuz/qobuzservice.h src/qobuz/qobuzurlhandler.h src/qobuz/qobuzbaserequest.h src/qobuz/qobuzrequest.h src/qobuz/qobuzstreamurlrequest.h src/qobuz/qobuzfavoriterequest.h src/settings/qobuzsettingspage.h src/covermanager/qobuzcoverprovider.h UI src/settings/qobuzsettingspage.ui ) ``` -------------------------------- ### Public Include Directories Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/CMakeLists.txt Configures public include directories for the strawberry_lib, making headers accessible during the build. ```cmake target_include_directories(strawberry_lib PUBLIC ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/src ${CMAKE_BINARY_DIR}/src ) ``` -------------------------------- ### Strawberry Library Dependencies Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/CMakeLists.txt Lists the core libraries and packages required for building the Strawberry Music Player library. This includes GStreamer components, TagLib, Qt modules, ICU, and various optional libraries based on build configurations. ```cmake target_link_libraries(strawberry_lib PUBLIC PkgConfig::GSTREAMER_APP PkgConfig::GSTREAMER_TAG PkgConfig::GSTREAMER_PBUTILS ${TAGLIB_LIBRARIES} Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Concurrent Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Network Qt${QT_VERSION_MAJOR}::Sql $ $ ICU::uc ICU::i18n $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ KDAB::kdsingleapplication $ ) ``` -------------------------------- ### Resource Compilation Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/CMakeLists.txt Compiles Qt resource files for data and icons into the project. ```cmake qt_add_resources(SOURCES data/data.qrc data/icons.qrc) ``` -------------------------------- ### CMake: Test Execution Target Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/tests/CMakeLists.txt Creates a custom target 'run_strawberry_tests' to execute all registered tests using CTest with verbose output. ```cmake add_custom_target(run_strawberry_tests COMMAND ${CMAKE_CTEST_COMMAND} -V DEPENDS strawberry_tests) ``` -------------------------------- ### Push Changes to GitHub Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/CONTRIBUTING.md Pushes the local branch with your changes to your GitHub fork. ```git git push origin your-branch ``` -------------------------------- ### Global Shortcuts Sources and UI Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/CMakeLists.txt Includes C++ source files, headers, and UI files for the Global Shortcuts Manager, used when the HAVE_GLOBALSHORTCUTS flag is enabled. ```c++ optional_source(HAVE_GLOBALSHORTCUTS SOURCES src/globalshortcuts/globalshortcutsmanager.cpp src/globalshortcuts/globalshortcutsbackend.cpp src/globalshortcuts/globalshortcutgrabber.cpp src/settings/globalshortcutssettingspage.cpp HEADERS src/globalshortcuts/globalshortcutsmanager.h src/globalshortcuts/globalshortcutsbackend.h src/globalshortcuts/globalshortcutgrabber.h src/settings/globalshortcutssettingspage.h UI src/globalshortcuts/globalshortcutgrabber.ui src/settings/globalshortcutssettingspage.ui ) ``` -------------------------------- ### Configure Project Files with CMake Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/src/CMakeLists.txt Configures essential project files like config.h and version.h by processing template files. This ensures that build-time configurations and version information are correctly embedded into the project. ```cmake configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h) ``` -------------------------------- ### Music Metadata Fetching Configuration Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/CMakeLists.txt Enables the inclusion of source files for MusicBrainz and AcoustID integration, used for fetching music metadata and acoustic fingerprints. ```cmake optional_source(HAVE_CHROMAPRINT SOURCES src/engine/chromaprinter.cpp) optional_source(HAVE_MUSICBRAINZ SOURCES src/musicbrainz/acoustidclient.cpp src/musicbrainz/musicbrainzclient.cpp src/musicbrainz/tagfetcher.cpp HEADERS src/musicbrainz/acoustidclient.h src/musicbrainz/musicbrainzclient.h src/musicbrainz/tagfetcher.h ) optional_source(HAVE_EBUR128 SOURCES src/engine/ebur128analysis.cpp) ``` -------------------------------- ### Library Linking Source: https://github.com/strawberrymusicplayer/strawberry/blob/master/CMakeLists.txt Links the strawberry_lib with necessary system libraries and dependencies, including threading, backtrace, GLib, GObject, SQLite, and GStreamer components. ```cmake target_link_libraries(strawberry_lib PUBLIC ${CMAKE_THREAD_LIBS_INIT} $:${Backtrace_LIBRARIES} PkgConfig::GLIB PkgConfig::GOBJECT PkgConfig::SQLITE PkgConfig::GSTREAMER PkgConfig::GSTREAMER_BASE PkgConfig::GSTREAMER_AUDIO ) ```