diff --git a/.cmake/AddOsSpecificPlugins.cmake b/.cmake/AddOsSpecificPlugins.cmake index ce0eea9bb..34774e677 100644 --- a/.cmake/AddOsSpecificPlugins.cmake +++ b/.cmake/AddOsSpecificPlugins.cmake @@ -4,28 +4,13 @@ if (NOT "${LIBOPENMPT}" STREQUAL "LIBOPENMPT-NOTFOUND") add_plugin("src/plugins/libopenmptdecoder" "openmptdecoder") endif() -# systemd / MPRIS detection -if (NOT ENABLE_MPRIS MATCHES "false") - find_library(LIB_SYSTEMD NAMES systemd) - if (NOT LIB_SYSTEMD MATCHES "LIB_SYSTEMD-NOTFOUND") - message(STATUS "[mpris] systemd found at " ${LIB_SYSTEMD}) - message(STATUS "[mpris] setting ENABLE_MPRIS=true") - set(ENABLE_MPRIS "true") - else() - message(STATUS "[mpris] systemd *not* found. MPRIS plugin not enabled") - set(ENABLE_MPRIS "false") - endif() -endif() - if (CMAKE_SYSTEM_NAME MATCHES "Linux") add_plugin("src/plugins/alsaout" "alsaout") add_plugin("src/plugins/pulseout" "pulseout") + add_plugin("src/plugins/mpris" "mpris") if (${ENABLE_PIPEWIRE} MATCHES "true") add_plugin("src/plugins/pipewireout" "pipewireout") endif() - if (${ENABLE_MPRIS} MATCHES "true") - add_plugin("src/plugins/mpris" "mpris") - endif() if (${ENABLE_SNDIO} MATCHES "true") add_plugin("src/plugins/sndioout" "sndioout") endif() diff --git a/.cmake/AddPlugin.cmake b/.cmake/AddPlugin.cmake index c8394b17f..1222b1147 100644 --- a/.cmake/AddPlugin.cmake +++ b/.cmake/AddPlugin.cmake @@ -1,7 +1,12 @@ macro(add_plugin plugin_dir plugin_name) message(STATUS "[add-plugin] adding '${plugin_name}' at path '${plugin_dir}") add_subdirectory(${plugin_dir}) - add_dependencies(musikcube ${plugin_name}) - add_dependencies(musikcubed ${plugin_name}) - add_dependencies(core_c_demo ${plugin_name}) + get_property(PLUGIN_DISABLED GLOBAL PROPERTY "DISABLE_${plugin_name}") + if (NOT PLUGIN_DISABLED STREQUAL "true") + add_dependencies(musikcube ${plugin_name}) + add_dependencies(musikcubed ${plugin_name}) + add_dependencies(core_c_demo ${plugin_name}) + else() + message(STATUS "[add-plugin] *** WARNING! *** ${plugin_name} not found.") + endif() endmacro(add_plugin) \ No newline at end of file diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 75c69e88c..7e8fa1576 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,11 @@ +0.97.1 + +* added the ability to use `libelogind` or `basu` instead of `libsystemd` for + the `mpris` plugin (@robertgzr) +* some warning cleanups when using wsprintw (@trofi) + +-------------------------------------------------------------------------------- + 0.97.0 * no functional changes to the app @@ -7,10 +15,14 @@ distribution that are more universally compatible across different versions of macOS and Linux distributions. +-------------------------------------------------------------------------------- + 0.96.13 * macOS and Linux only release that fixes standalone binaries. +-------------------------------------------------------------------------------- + 0.96.11 * added support for ffmpeg5 libraries. @@ -23,15 +35,21 @@ * added additional PipeWire output debugging. * rewrote build system and packaging scripts. +-------------------------------------------------------------------------------- + 0.96.10 * fixed `-rpath` for macOS build. * fixed race condition in WasapiOut that caused the app to crash. +-------------------------------------------------------------------------------- + 0.96.9 * fixed `-rpath` to use `$ORIGIN` instead of `./` to appease `Feodra 35`. +-------------------------------------------------------------------------------- + 0.96.8 * updated `FfmpegDecoder` to perform resampling internally when `WasapiOutput` @@ -58,11 +76,15 @@ 0.96.7 +-------------------------------------------------------------------------------- + * re-compile for Windows; Windows Defender was unhappy with the original binaries. 0.96.6 +-------------------------------------------------------------------------------- + * fixed some drawing issues with overlays/dialogs with certain versions of ncurses. * added category-level (e.g. album, artist, etc) durations in browse and diff --git a/CMakeLists.txt b/CMakeLists.txt index fdcf0e11a..f9a47891f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ cmake_minimum_required(VERSION 3.0) project(musikcube) set (musikcube_VERSION_MAJOR 0) set (musikcube_VERSION_MINOR 97) -set (musikcube_VERSION_PATCH 0) +set (musikcube_VERSION_PATCH 1) set (musikcube_VERSION "${musikcube_VERSION_MAJOR}.${musikcube_VERSION_MINOR}.${musikcube_VERSION_PATCH}") set (LIBRARY_OUTPUT_PATH ${musikcube_SOURCE_DIR}/bin/plugins) set (EXECUTABLE_OUTPUT_PATH ${musikcube_SOURCE_DIR}/bin) diff --git a/musikcube.spec b/musikcube.spec index 8bc4ea8ef..e3671fd17 100644 --- a/musikcube.spec +++ b/musikcube.spec @@ -1,6 +1,6 @@ %define name musikcube %define build_timestamp %{lua: print(os.date("%Y%m%d"))} -%define version 0.97.0 +%define version 0.97.1 Name: %{name} Version: %{version} Release: %{dist} diff --git a/src/musikcore/version.h b/src/musikcore/version.h index c97a04eda..2d1b2d106 100644 --- a/src/musikcore/version.h +++ b/src/musikcore/version.h @@ -38,9 +38,9 @@ #define VERSION_MAJOR 0 #define VERSION_MINOR 97 -#define VERSION_PATCH 0 -#define VERSION_COMMIT_HASH "#5496aba9" -#define VERSION "0.97.0" +#define VERSION_PATCH 1 +#define VERSION_COMMIT_HASH "#0199dba0" +#define VERSION "0.97.1" namespace musik { namespace cube { diff --git a/src/musikcube/app/util/WindowUtil.cpp b/src/musikcube/app/util/WindowUtil.cpp index f566bd3aa..20003d34d 100644 --- a/src/musikcube/app/util/WindowUtil.cpp +++ b/src/musikcube/app/util/WindowUtil.cpp @@ -32,8 +32,6 @@ // ////////////////////////////////////////////////////////////////////////////// -#pragma once - #include #include "WindowUtil.h" @@ -52,4 +50,4 @@ namespace musik { namespace cube { namespace windowutil { return false; } -} } } \ No newline at end of file +} } } diff --git a/src/musikcube/app/window/TransportWindow.cpp b/src/musikcube/app/window/TransportWindow.cpp index e97be6d27..3d1a0b1d0 100755 --- a/src/musikcube/app/window/TransportWindow.cpp +++ b/src/musikcube/app/window/TransportWindow.cpp @@ -363,7 +363,7 @@ size_t TransportWindow::WritePlayingFormat(WINDOW *w, size_t width) { metadataFieldToPosition[token->value] = Position(x, y, cols); ON(w, attr); - checked_wprintw(w, value.c_str()); + checked_wprintw(w, "%s", value.c_str()); OFF(w, attr); remaining -= cols; @@ -678,7 +678,7 @@ void TransportWindow::Update(TimeMode timeMode) { if (stopped && !this->buffering) { ON(c, disabled); - checked_wprintw(c, Strings.STOPPED.c_str()); + checked_wprintw(c, "%s", Strings.STOPPED.c_str()); displayCache.Reset(); OFF(c, disabled); } @@ -692,7 +692,7 @@ void TransportWindow::Update(TimeMode timeMode) { wmove(c, 0, shuffleOffset); Color const shuffleAttrs = this->playback.IsShuffled() ? gb : disabled; ON(c, shuffleAttrs); - checked_wprintw(c, shuffleLabel.c_str()); + checked_wprintw(c, "%s", shuffleLabel.c_str()); OFF(c, shuffleAttrs); this->shufflePos.Set(shuffleOffset, narrow_cast(shuffleWidth)); @@ -811,7 +811,7 @@ void TransportWindow::Update(TimeMode timeMode) { wmove(c, 1, 0); /* move cursor to the second line */ ON(c, volumeAttrs); - checked_wprintw(c, volume.c_str()); + checked_wprintw(c, "%s", volume.c_str()); OFF(c, volumeAttrs); if (replayGainEnabled) { @@ -834,7 +834,7 @@ void TransportWindow::Update(TimeMode timeMode) { ON(c, repeatAttrs); this->repeatPos.Set(getcurx(c), narrow_cast(u8cols(repeatModeLabel))); - checked_wprintw(c, repeatModeLabel.c_str()); + checked_wprintw(c, "%s", repeatModeLabel.c_str()); OFF(c, repeatAttrs); this->Invalidate(); diff --git a/src/musikcube/cursespp/DialogOverlay.cpp b/src/musikcube/cursespp/DialogOverlay.cpp index c2df1a899..b753b571c 100644 --- a/src/musikcube/cursespp/DialogOverlay.cpp +++ b/src/musikcube/cursespp/DialogOverlay.cpp @@ -226,7 +226,7 @@ void DialogOverlay::OnRedraw() { if (this->title.size()) { wmove(c, currentY, currentX); wattron(c, A_BOLD); - checked_wprintw(c, text::Ellipsize(this->title, this->width - 4).c_str()); + checked_wprintw(c, "%s", text::Ellipsize(this->title, this->width - 4).c_str()); wattroff(c, A_BOLD); currentY += 2; } @@ -234,7 +234,7 @@ void DialogOverlay::OnRedraw() { if (this->message.size()) { for (size_t i = 0; i < messageLines.size(); i++) { wmove(c, currentY, currentX); - checked_wprintw(c, this->messageLines.at(i).c_str()); + checked_wprintw(c, "%s", this->messageLines.at(i).c_str()); ++currentY; } } diff --git a/src/musikcube/cursespp/InputOverlay.cpp b/src/musikcube/cursespp/InputOverlay.cpp index 9cd6e03e5..ccbcb7a04 100644 --- a/src/musikcube/cursespp/InputOverlay.cpp +++ b/src/musikcube/cursespp/InputOverlay.cpp @@ -203,7 +203,7 @@ void InputOverlay::OnRedraw() { if (this->title.size()) { wmove(c, 0, 1); wattron(c, A_BOLD); - checked_wprintw(c, text::Align(this->title, text::AlignCenter, this->width - 4).c_str()); + checked_wprintw(c, "%s", text::Align(this->title, text::AlignCenter, this->width - 4).c_str()); wattroff(c, A_BOLD); } } diff --git a/src/musikcube/cursespp/ListOverlay.cpp b/src/musikcube/cursespp/ListOverlay.cpp index 82c8e9be8..e2dc3c22e 100644 --- a/src/musikcube/cursespp/ListOverlay.cpp +++ b/src/musikcube/cursespp/ListOverlay.cpp @@ -328,7 +328,7 @@ void ListOverlay::UpdateContents() { if (this->title.size()) { wmove(c, currentY, currentX); wattron(c, A_BOLD); - checked_wprintw(c, text::Align(this->title, text::AlignCenter, this->width - 4).c_str()); + checked_wprintw(c, "%s", text::Align(this->title, text::AlignCenter, this->width - 4).c_str()); wattroff(c, A_BOLD); currentY += 2; } diff --git a/src/musikcube/cursespp/ShortcutsWindow.cpp b/src/musikcube/cursespp/ShortcutsWindow.cpp index de1031dcb..cb2762a3a 100755 --- a/src/musikcube/cursespp/ShortcutsWindow.cpp +++ b/src/musikcube/cursespp/ShortcutsWindow.cpp @@ -236,7 +236,7 @@ void ShortcutsWindow::OnRedraw() { } wattron(c, keyAttrs); - checked_wprintw(c, key.c_str()); + checked_wprintw(c, "%s", key.c_str()); wattroff(c, keyAttrs); remaining -= len; @@ -252,7 +252,7 @@ void ShortcutsWindow::OnRedraw() { len = remaining; } - checked_wprintw(c, value.c_str()); + checked_wprintw(c, "%s", value.c_str()); remaining -= len; } } diff --git a/src/musikcube/cursespp/ToastOverlay.cpp b/src/musikcube/cursespp/ToastOverlay.cpp index 0143f3a78..0bfb1aeab 100644 --- a/src/musikcube/cursespp/ToastOverlay.cpp +++ b/src/musikcube/cursespp/ToastOverlay.cpp @@ -115,6 +115,6 @@ void ToastOverlay::OnRedraw() { for (int i = 0; i < (int) this->titleLines.size(); i++) { wmove(c, i, 1); - checked_wprintw(c, text::Ellipsize(this->titleLines[i], this->width - 4).c_str()); + checked_wprintw(c, "%s", text::Ellipsize(this->titleLines[i], this->width - 4).c_str()); } } diff --git a/src/musikcube/musikcube.rc b/src/musikcube/musikcube.rc index 860008245..0b54b36c4 100644 Binary files a/src/musikcube/musikcube.rc and b/src/musikcube/musikcube.rc differ diff --git a/src/plugins/mpris/CMakeLists.txt b/src/plugins/mpris/CMakeLists.txt index fdee62d2d..8b40511fc 100644 --- a/src/plugins/mpris/CMakeLists.txt +++ b/src/plugins/mpris/CMakeLists.txt @@ -2,8 +2,22 @@ set (mpris_SOURCES mpris.cpp dbus.cpp) -find_package(PkgConfig) -pkg_check_modules (SYSTEMD REQUIRED libsystemd) +if (USE_ELOGIND MATCHES "true") + set(SDBUS "libelogind >= 239.3") +elseif (USE_BASU MATCHES "true") + set(SDBUS "basu") +else() + set(SDBUS "libsystemd") +endif() -add_library(mpris SHARED ${mpris_SOURCES}) -target_link_libraries(mpris systemd) +find_package(PkgConfig) +pkg_check_modules(SDBUS IMPORTED_TARGET ${SDBUS}) + +if (SDBUS_LINK_LIBRARIES STREQUAL "") + message(STATUS "[mpris] plugin enabled. using " ${SDBUS_LINK_LIBRARIES}) + add_library(mpris SHARED ${mpris_SOURCES}) + target_link_libraries(mpris PkgConfig::SDBUS) +else() + set_property(GLOBAL PROPERTY DISABLE_mpris "true") + message(STATUS "[mpris] plugin *not* enabled. setting 'DISABLE_mpris=true'") +endif()