mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-08 21:00:05 +02:00
579 lines
20 KiB
Plaintext
579 lines
20 KiB
Plaintext
From b80c628154fceb107144763435de5bc20e9d9dff Mon Sep 17 00:00:00 2001
|
|
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
|
Date: Sat, 8 Mar 2025 23:09:49 +1000
|
|
Subject: Fix for Haiku
|
|
|
|
|
|
diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt
|
|
index 30255e3..9a9fa96 100644
|
|
--- a/src/app/CMakeLists.txt
|
|
+++ b/src/app/CMakeLists.txt
|
|
@@ -18,6 +18,9 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
add_executable(qmmp ${app_SRCS})
|
|
target_link_libraries(qmmp PRIVATE Qt6::Widgets Qt6::Network libqmmp libqmmpui)
|
|
+if (HAIKU)
|
|
+ target_link_libraries(qmmp PRIVATE network)
|
|
+endif()
|
|
set_target_properties(qmmp PROPERTIES OUTPUT_NAME qmmp${APP_NAME_SUFFIX})
|
|
|
|
install(TARGETS qmmp DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
diff --git a/src/plugins/Input/gme/CMakeLists.txt b/src/plugins/Input/gme/CMakeLists.txt
|
|
index 0fe4df1..af3fb93 100644
|
|
--- a/src/plugins/Input/gme/CMakeLists.txt
|
|
+++ b/src/plugins/Input/gme/CMakeLists.txt
|
|
@@ -3,15 +3,10 @@ project(libgme)
|
|
include(CheckIncludeFileCXX)
|
|
|
|
# libgme
|
|
-check_include_file_cxx(gme/gme.h GME_HEADER_FOUND)
|
|
-find_library(GME_LIB NAME gme PATHS /usr/lib /usr/lib32 /usr/local/lib /usr/local/lib32)
|
|
-
|
|
-if(GME_HEADER_FOUND AND (NOT GME_LIB MATCHES "^.*-NOTFOUND"))
|
|
- set(GME_FOUND TRUE CACHE INTERNAL "GME")
|
|
- message(STATUS "Found Game Music Emu: ${GME_LIB}")
|
|
-else(GME_HEADER_FOUND AND (NOT GME_LIB MATCHES "^.*-NOTFOUND"))
|
|
- message(STATUS "Could not find Game Music Emu library")
|
|
-endif(GME_HEADER_FOUND AND (NOT GME_LIB MATCHES "^.*-NOTFOUND"))
|
|
+pkg_search_module(GME libgme)
|
|
+include_directories(${GME_INCLUDE_DIRS})
|
|
+link_directories(${GME_LIBRARY_DIRS})
|
|
+ADD_DEFINITIONS(${GME_CFLAGS})
|
|
|
|
|
|
SET(libgme_SRCS
|
|
@@ -29,6 +24,6 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
if(GME_FOUND)
|
|
add_library(gme MODULE ${libgme_SRCS} ${libgme_RCC_SRCS})
|
|
- target_link_libraries(gme PRIVATE Qt6::Widgets libqmmp ${GME_LIB})
|
|
+ target_link_libraries(gme PRIVATE Qt6::Widgets libqmmp ${GME_LDFLAGS})
|
|
install(TARGETS gme DESTINATION ${PLUGIN_DIR}/Input)
|
|
endif(GME_FOUND)
|
|
diff --git a/src/plugins/Output/CMakeLists.txt b/src/plugins/Output/CMakeLists.txt
|
|
index f8929d2..b20bf44 100644
|
|
--- a/src/plugins/Output/CMakeLists.txt
|
|
+++ b/src/plugins/Output/CMakeLists.txt
|
|
@@ -10,6 +10,7 @@ set(USE_DSOUND TRUE CACHE BOOL "enable/disable DirectSound plugin")
|
|
set(USE_QTMULTIMEDIA TRUE CACHE BOOL "enable/disable Qt Multimedia output plugin")
|
|
set(USE_WASAPI TRUE CACHE BOOL "enable/disable WASAPI plugin")
|
|
set(USE_SHOUT TRUE CACHE BOOL "enable/disable Icecast plugin")
|
|
+SET(USE_MEDIAKIT TRUE CACHE BOOL "enable/disable MediaKit plugin")
|
|
|
|
if(USE_ALSA)
|
|
add_subdirectory(alsa)
|
|
@@ -58,3 +59,7 @@ endif(USE_WASAPI)
|
|
if(USE_SHOUT)
|
|
add_subdirectory(shout)
|
|
endif(USE_SHOUT)
|
|
+
|
|
+IF(USE_MEDIAKIT)
|
|
+add_subdirectory(mediakit)
|
|
+ENDIF(USE_MEDIAKIT)
|
|
diff --git a/src/plugins/Output/mediakit/CMakeLists.txt b/src/plugins/Output/mediakit/CMakeLists.txt
|
|
new file mode 100644
|
|
index 0000000..73edac6
|
|
--- /dev/null
|
|
+++ b/src/plugins/Output/mediakit/CMakeLists.txt
|
|
@@ -0,0 +1,31 @@
|
|
+project(libmediakit)
|
|
+
|
|
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
|
+
|
|
+# libqmmp
|
|
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../)
|
|
+link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp)
|
|
+
|
|
+SET(libmediakit_SRCS
|
|
+ outputmediakit.cpp
|
|
+ outputmediakitfactory.cpp
|
|
+)
|
|
+
|
|
+SET(libmediakit_HDRS
|
|
+ outputmediakit.h
|
|
+ outputmediakitfactory.h
|
|
+)
|
|
+
|
|
+SET(libmediakit_RCCS translations/translations.qrc)
|
|
+
|
|
+QT6_ADD_RESOURCES(libmediakit_RCC_SRCS ${libmediakit_RCCS})
|
|
+
|
|
+# Don't forget to include output directory, otherwise
|
|
+# the UI file won't be wrapped!
|
|
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
|
+
|
|
+
|
|
+ADD_LIBRARY(mediakit MODULE ${libmediakit_SRCS} ${libmediakit_UIS_H} ${libmediakit_RCC_SRCS} ${libmediakit_HDRS})
|
|
+add_dependencies(mediakit libqmmp)
|
|
+target_link_libraries(mediakit Qt6::Widgets libqmmp media)
|
|
+install(TARGETS mediakit DESTINATION ${PLUGIN_DIR}/Output)
|
|
diff --git a/src/plugins/Output/mediakit/mediakit.pro b/src/plugins/Output/mediakit/mediakit.pro
|
|
new file mode 100644
|
|
index 0000000..86849a8
|
|
--- /dev/null
|
|
+++ b/src/plugins/Output/mediakit/mediakit.pro
|
|
@@ -0,0 +1,22 @@
|
|
+include(../../plugins.pri)
|
|
+
|
|
+HEADERS += outputmediakitfactory.h \
|
|
+ outputmediakit.h
|
|
+
|
|
+SOURCES += outputmediakitfactory.cpp \
|
|
+ outputmediakit.cpp
|
|
+
|
|
+
|
|
+TARGET=$$PLUGINS_PREFIX/Output/mediakit
|
|
+
|
|
+CONFIG += warn_on \
|
|
+thread \
|
|
+plugin \
|
|
+link_pkgconfig
|
|
+
|
|
+LIBS += -lqmmp -lbe -lmedia
|
|
+
|
|
+RESOURCES = translations/translations.qrc
|
|
+
|
|
+target.path = $$PLUGIN_DIR/Output
|
|
+INSTALLS += target
|
|
diff --git a/src/plugins/Output/mediakit/outputmediakit.cpp b/src/plugins/Output/mediakit/outputmediakit.cpp
|
|
new file mode 100644
|
|
index 0000000..b5108a7
|
|
--- /dev/null
|
|
+++ b/src/plugins/Output/mediakit/outputmediakit.cpp
|
|
@@ -0,0 +1,137 @@
|
|
+/***************************************************************************
|
|
+ * Copyright (C) 2013-2019 by Gerasim Troeglazov *
|
|
+ * 3dEyes@gmail.com *
|
|
+ * *
|
|
+ * This program is free software; you can redistribute it and/or modify *
|
|
+ * it under the terms of the GNU General Public License as published by *
|
|
+ * the Free Software Foundation; either version 2 of the License, or *
|
|
+ * (at your option) any later version. *
|
|
+ * *
|
|
+ * This program is distributed in the hope that it will be useful, *
|
|
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
+ * GNU General Public License for more details. *
|
|
+ * *
|
|
+ * You should have received a copy of the GNU General Public License *
|
|
+ * along with this program; if not, write to the *
|
|
+ * Free Software Foundation, Inc., *
|
|
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
|
+ ***************************************************************************/
|
|
+
|
|
+#include "outputmediakit.h"
|
|
+
|
|
+#include <SoundPlayer.h>
|
|
+#include <GameKit.h>
|
|
+#include <SupportKit.h>
|
|
+#include <game/GameSoundDefs.h>
|
|
+#include <game/PushGameSound.h>
|
|
+#include <game/StreamingGameSound.h>
|
|
+#include <media/MediaDefs.h>
|
|
+
|
|
+static void playerProc(void *cookie, void *buffer, size_t len, const media_raw_audio_format &format)
|
|
+{
|
|
+ OutputMediaKit *obj = (OutputMediaKit*)cookie;
|
|
+
|
|
+ acquire_sem(obj->block_sem);
|
|
+ memcpy(buffer, obj->outbuf, len);
|
|
+ release_sem(obj->unblock_sem);
|
|
+}
|
|
+
|
|
+OutputMediaKit::OutputMediaKit(): Output()
|
|
+{
|
|
+ m_player = NULL;
|
|
+}
|
|
+
|
|
+OutputMediaKit::~OutputMediaKit()
|
|
+{
|
|
+ uninitialize();
|
|
+}
|
|
+
|
|
+bool OutputMediaKit::initialize(quint32 freq, ChannelMap map, Qmmp::AudioFormat format)
|
|
+{
|
|
+ int buf_len = 2048 * map.count();
|
|
+
|
|
+ media_raw_audio_format mediaKitFormat = {
|
|
+ (float)freq,
|
|
+ (uint32)map.count(),
|
|
+ media_raw_audio_format::B_AUDIO_SHORT,
|
|
+ B_MEDIA_LITTLE_ENDIAN,
|
|
+ (uint32)buf_len / 2
|
|
+ };
|
|
+
|
|
+ switch (format) {
|
|
+ case Qmmp::PCM_S8:
|
|
+ mediaKitFormat.format = media_raw_audio_format::B_AUDIO_CHAR;
|
|
+ break;
|
|
+ case Qmmp::PCM_S16LE:
|
|
+ mediaKitFormat.format = media_raw_audio_format::B_AUDIO_SHORT;
|
|
+ break;
|
|
+ case Qmmp::PCM_S32LE:
|
|
+ mediaKitFormat.format = media_raw_audio_format::B_AUDIO_INT;
|
|
+ break;
|
|
+ default:
|
|
+ qWarning("Haiku MediaKit: unsupported format detected");
|
|
+ return false;
|
|
+ }
|
|
+
|
|
+ block_sem = create_sem(0, "blocker");
|
|
+ unblock_sem = create_sem(1, "unblocker");
|
|
+
|
|
+ outbuf = (char *)malloc(buf_len);
|
|
+ m_player = new BSoundPlayer(&mediaKitFormat, "Qmmp", playerProc, NULL, (void*)this);
|
|
+
|
|
+ if(m_player->InitCheck() != B_OK) {
|
|
+ delete m_player;
|
|
+ return false;
|
|
+ }
|
|
+
|
|
+ m_player->Start();
|
|
+ m_player->SetHasData(true);
|
|
+
|
|
+ Output::configure(freq, map, format);
|
|
+
|
|
+ return true;
|
|
+}
|
|
+
|
|
+qint64 OutputMediaKit::latency()
|
|
+{
|
|
+ return 0;
|
|
+}
|
|
+
|
|
+qint64 OutputMediaKit::writeAudio(unsigned char *data, qint64 maxSize)
|
|
+{
|
|
+ acquire_sem(unblock_sem);
|
|
+ memcpy(outbuf, data, maxSize);
|
|
+ release_sem(block_sem);
|
|
+ return maxSize;
|
|
+}
|
|
+
|
|
+void OutputMediaKit::drain()
|
|
+{
|
|
+}
|
|
+
|
|
+void OutputMediaKit::reset()
|
|
+{
|
|
+}
|
|
+
|
|
+void OutputMediaKit::suspend()
|
|
+{
|
|
+ m_player->Stop();
|
|
+}
|
|
+
|
|
+void OutputMediaKit::resume()
|
|
+{
|
|
+ m_player->Start();
|
|
+}
|
|
+
|
|
+
|
|
+void OutputMediaKit::uninitialize()
|
|
+{
|
|
+ if(m_player) {
|
|
+ m_player->Stop();
|
|
+ delete m_player;
|
|
+ }
|
|
+ delete_sem(block_sem);
|
|
+ delete_sem(unblock_sem);
|
|
+ free(outbuf);
|
|
+}
|
|
diff --git a/src/plugins/Output/mediakit/outputmediakit.h b/src/plugins/Output/mediakit/outputmediakit.h
|
|
new file mode 100644
|
|
index 0000000..cc1af5b
|
|
--- /dev/null
|
|
+++ b/src/plugins/Output/mediakit/outputmediakit.h
|
|
@@ -0,0 +1,56 @@
|
|
+/***************************************************************************
|
|
+ * Copyright (C) 2013-2019 by Gerasim Troeglazov *
|
|
+ * 3dEyes@gmail.com *
|
|
+ * *
|
|
+ * This program is free software; you can redistribute it and/or modify *
|
|
+ * it under the terms of the GNU General Public License as published by *
|
|
+ * the Free Software Foundation; either version 2 of the License, or *
|
|
+ * (at your option) any later version. *
|
|
+ * *
|
|
+ * This program is distributed in the hope that it will be useful, *
|
|
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
+ * GNU General Public License for more details. *
|
|
+ * *
|
|
+ * You should have received a copy of the GNU General Public License *
|
|
+ * along with this program; if not, write to the *
|
|
+ * Free Software Foundation, Inc., *
|
|
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
|
+ ***************************************************************************/
|
|
+
|
|
+#ifndef OUTPUTMEDIAKIT_H
|
|
+#define OUTPUTMEDIAKIT_H
|
|
+
|
|
+#include <QObject>
|
|
+#include <QHash>
|
|
+#include <qmmp/output.h>
|
|
+
|
|
+#include <MediaKit.h>
|
|
+#include <SupportKit.h>
|
|
+#include <game/GameSoundDefs.h>
|
|
+#include <game/PushGameSound.h>
|
|
+
|
|
+class OutputMediaKit : public Output
|
|
+{
|
|
+public:
|
|
+ OutputMediaKit();
|
|
+ ~OutputMediaKit();
|
|
+
|
|
+ bool initialize(quint32, ChannelMap map, Qmmp::AudioFormat format);
|
|
+
|
|
+ qint64 latency();
|
|
+ qint64 writeAudio(unsigned char *data, qint64 maxSize);
|
|
+ void drain();
|
|
+ void suspend();
|
|
+ void resume();
|
|
+ void reset();
|
|
+
|
|
+ char *outbuf;
|
|
+ sem_id block_sem;
|
|
+ sem_id unblock_sem;
|
|
+private:
|
|
+ void uninitialize();
|
|
+ BSoundPlayer *m_player;
|
|
+};
|
|
+
|
|
+#endif // OUTPUTMEDIAKIT_H
|
|
diff --git a/src/plugins/Output/mediakit/outputmediakitfactory.cpp b/src/plugins/Output/mediakit/outputmediakitfactory.cpp
|
|
new file mode 100644
|
|
index 0000000..3303b23
|
|
--- /dev/null
|
|
+++ b/src/plugins/Output/mediakit/outputmediakitfactory.cpp
|
|
@@ -0,0 +1,66 @@
|
|
+/***************************************************************************
|
|
+ * Copyright (C) 2013-2019 by Gerasim Troeglazov *
|
|
+ * 3dEyes@gmail.com *
|
|
+ * *
|
|
+ * This program is free software; you can redistribute it and/or modify *
|
|
+ * it under the terms of the GNU General Public License as published by *
|
|
+ * the Free Software Foundation; either version 2 of the License, or *
|
|
+ * (at your option) any later version. *
|
|
+ * *
|
|
+ * This program is distributed in the hope that it will be useful, *
|
|
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
+ * GNU General Public License for more details. *
|
|
+ * *
|
|
+ * You should have received a copy of the GNU General Public License *
|
|
+ * along with this program; if not, write to the *
|
|
+ * Free Software Foundation, Inc., *
|
|
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
|
+ ***************************************************************************/
|
|
+
|
|
+#include <QTranslator>
|
|
+#include <QMessageBox>
|
|
+
|
|
+#include <qmmp/qmmp.h>
|
|
+#include "outputmediakit.h"
|
|
+#include "outputmediakitfactory.h"
|
|
+
|
|
+
|
|
+OutputProperties OutputMediaKitFactory::properties() const
|
|
+{
|
|
+ OutputProperties properties;
|
|
+ properties.name = "MediaKit Plugin";
|
|
+ properties.hasAbout = true;
|
|
+ properties.hasSettings = false;
|
|
+ properties.shortName = "mediakit";
|
|
+ return properties;
|
|
+}
|
|
+
|
|
+Output* OutputMediaKitFactory::create()
|
|
+{
|
|
+ return new OutputMediaKit();
|
|
+}
|
|
+
|
|
+Volume *OutputMediaKitFactory::createVolume()
|
|
+{
|
|
+ return 0;
|
|
+}
|
|
+
|
|
+QDialog *OutputMediaKitFactory::createSettings(QWidget *parent)
|
|
+{
|
|
+ Q_UNUSED(parent);
|
|
+ return nullptr;
|
|
+}
|
|
+
|
|
+void OutputMediaKitFactory::showAbout(QWidget *parent)
|
|
+{
|
|
+ QMessageBox::about (parent, "About MediaKit Output Plugin",
|
|
+ "Qmmp MediaKit Output Plugin\n(C) 2013-2019 3dEyes**");
|
|
+}
|
|
+
|
|
+QString OutputMediaKitFactory::translation() const
|
|
+{
|
|
+ return QLatin1String(":/mediakit_plugin_");
|
|
+}
|
|
+
|
|
+//Q_EXPORT_PLUGIN2(mediakit, OutputMediaKitFactory)
|
|
diff --git a/src/plugins/Output/mediakit/outputmediakitfactory.h b/src/plugins/Output/mediakit/outputmediakitfactory.h
|
|
new file mode 100644
|
|
index 0000000..ec26dc7
|
|
--- /dev/null
|
|
+++ b/src/plugins/Output/mediakit/outputmediakitfactory.h
|
|
@@ -0,0 +1,50 @@
|
|
+/***************************************************************************
|
|
+ * Copyright (C) 2013-2019 by Gerasim Troeglazov *
|
|
+ * 3dEyes@gmail.com *
|
|
+ * *
|
|
+ * This program is free software; you can redistribute it and/or modify *
|
|
+ * it under the terms of the GNU General Public License as published by *
|
|
+ * the Free Software Foundation; either version 2 of the License, or *
|
|
+ * (at your option) any later version. *
|
|
+ * *
|
|
+ * This program is distributed in the hope that it will be useful, *
|
|
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
+ * GNU General Public License for more details. *
|
|
+ * *
|
|
+ * You should have received a copy of the GNU General Public License *
|
|
+ * along with this program; if not, write to the *
|
|
+ * Free Software Foundation, Inc., *
|
|
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
|
+ ***************************************************************************/
|
|
+
|
|
+#ifndef OUTPUTMEDIAKITFACTORY_H
|
|
+#define OUTPUTMEDIAKITFACTORY_H
|
|
+
|
|
+
|
|
+#include <QObject>
|
|
+#include <QString>
|
|
+#include <QIODevice>
|
|
+#include <QWidget>
|
|
+
|
|
+#include <qmmp/output.h>
|
|
+#include <qmmp/outputfactory.h>
|
|
+
|
|
+
|
|
+class OutputMediaKitFactory : public QObject,
|
|
+ OutputFactory
|
|
+{
|
|
+Q_OBJECT
|
|
+Q_PLUGIN_METADATA(IID "org.qmmp.qmmp.OutputFactoryInterface.1.0")
|
|
+Q_INTERFACES(OutputFactory)
|
|
+
|
|
+public:
|
|
+ OutputProperties properties() const override;
|
|
+ Output* create() override;
|
|
+ Volume *createVolume() override;
|
|
+ QDialog *createSettings(QWidget *parent) override;
|
|
+ void showAbout(QWidget *parent) override;
|
|
+ QString translation() const override;
|
|
+};
|
|
+
|
|
+#endif
|
|
diff --git a/src/plugins/Output/mediakit/translations/mediakit_plugin_en.ts b/src/plugins/Output/mediakit/translations/mediakit_plugin_en.ts
|
|
new file mode 100644
|
|
index 0000000..48f6632
|
|
--- /dev/null
|
|
+++ b/src/plugins/Output/mediakit/translations/mediakit_plugin_en.ts
|
|
@@ -0,0 +1,7 @@
|
|
+<?xml version="1.0" encoding="utf-8"?>
|
|
+<!DOCTYPE TS>
|
|
+<TS version="2.0" language="en_US">
|
|
+<context>
|
|
+ <name>OutputMediaKitFactory</name>
|
|
+</context>
|
|
+</TS>
|
|
diff --git a/src/plugins/Output/mediakit/translations/translations.qrc b/src/plugins/Output/mediakit/translations/translations.qrc
|
|
new file mode 100644
|
|
index 0000000..f678c61
|
|
--- /dev/null
|
|
+++ b/src/plugins/Output/mediakit/translations/translations.qrc
|
|
@@ -0,0 +1,5 @@
|
|
+<!DOCTYPE RCC>
|
|
+<RCC version="1.0">
|
|
+ <qresource>
|
|
+ </qresource>
|
|
+</RCC>
|
|
diff --git a/src/plugins/Ui/qsui/qsuimainwindow.cpp b/src/plugins/Ui/qsui/qsuimainwindow.cpp
|
|
index ff96583..99209a5 100644
|
|
--- a/src/plugins/Ui/qsui/qsuimainwindow.cpp
|
|
+++ b/src/plugins/Ui/qsui/qsuimainwindow.cpp
|
|
@@ -334,6 +334,7 @@ void QSUiMainWindow::showSettings()
|
|
QSUiSettings *simpleSettings = new QSUiSettings(this);
|
|
confDialog->addPage(tr("Appearance"), simpleSettings, QIcon(u":/qsui/qsui_settings.png"_s));
|
|
confDialog->addPage(tr("Shortcuts"), new QSUiHotkeyEditor(this), QIcon(u":/qsui/qsui_shortcuts.png"_s));
|
|
+ confDialog->setModal(false);
|
|
confDialog->exec();
|
|
simpleSettings->writeSettings();
|
|
confDialog->deleteLater();
|
|
diff --git a/src/plugins/Ui/skinned/skinnedmainwindow.cpp b/src/plugins/Ui/skinned/skinnedmainwindow.cpp
|
|
index 4cfa8df..76000fc 100644
|
|
--- a/src/plugins/Ui/skinned/skinnedmainwindow.cpp
|
|
+++ b/src/plugins/Ui/skinned/skinnedmainwindow.cpp
|
|
@@ -357,6 +357,7 @@ void SkinnedMainWindow::showSettings()
|
|
SkinnedSettings *skinnedSettings = new SkinnedSettings(this);
|
|
confDialog->addPage(tr("Appearance"), skinnedSettings, QIcon(u":/skinned/interface.png"_s));
|
|
confDialog->addPage(tr("Shortcuts"), new SkinnedHotkeyEditor(this), QIcon(u":/skinned/shortcuts.png"_s));
|
|
+ confDialog->setModal(false);
|
|
confDialog->exec();
|
|
skinnedSettings->writeSettings();
|
|
confDialog->deleteLater();
|
|
diff --git a/src/qmmp/qmmp.cpp b/src/qmmp/qmmp.cpp
|
|
index 90c85bb..ce45d7f 100644
|
|
--- a/src/qmmp/qmmp.cpp
|
|
+++ b/src/qmmp/qmmp.cpp
|
|
@@ -57,6 +57,8 @@ QString Qmmp::configDir()
|
|
|
|
return QDir::homePath() + u"/.qmmp"_s;
|
|
}
|
|
+#elif defined(Q_OS_HAIKU)
|
|
+ return m_configDir.isEmpty() ? QDir::homePath() +"/config/settings/Qmmp/" : m_configDir;
|
|
#else
|
|
if(m_configDir.isEmpty())
|
|
return QStringLiteral("%1/%2").arg(QStandardPaths::writableLocation(QStandardPaths::ConfigLocation),
|
|
@@ -105,9 +107,9 @@ QString Qmmp::pluginPath()
|
|
if(!path.isEmpty())
|
|
return QString::fromLocal8Bit(path);
|
|
QString fallbackPath = QStringLiteral("%1/../lib/qmmp-" STR(QMMP_VERSION_MAJOR) "." STR(QMMP_VERSION_MINOR)).arg(qApp->applicationDirPath());
|
|
-#ifdef QMMP_PLUGIN_DIR
|
|
+#if defined(QMMP_PLUGIN_DIR) && !defined(Q_OS_HAIKU)
|
|
QDir dir(QStringLiteral(QMMP_PLUGIN_DIR));
|
|
-#elif defined(Q_OS_WIN) && !defined(Q_OS_CYGWIN)
|
|
+#elif defined(Q_OS_WIN) && !defined(Q_OS_CYGWIN) || defined(Q_OS_HAIKU)
|
|
QDir dir(qApp->applicationDirPath() + u"/plugins"_s);
|
|
#else
|
|
QDir dir(fallbackPath);
|
|
--
|
|
2.48.1
|
|
|
|
|
|
From 0527f86da147afee25664d528e72a8eb3fd545f7 Mon Sep 17 00:00:00 2001
|
|
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
|
Date: Sun, 9 Mar 2025 19:02:39 +1000
|
|
Subject: Fix skins paths
|
|
|
|
|
|
diff --git a/src/qmmp/qmmp.cpp b/src/qmmp/qmmp.cpp
|
|
index ce45d7f..251310b 100644
|
|
--- a/src/qmmp/qmmp.cpp
|
|
+++ b/src/qmmp/qmmp.cpp
|
|
@@ -167,7 +167,7 @@ void Qmmp::setUiLanguageID(const QString &code)
|
|
|
|
QString Qmmp::dataPath()
|
|
{
|
|
-#if defined(Q_OS_WIN) && !defined(Q_OS_CYGWIN)
|
|
+#if (defined(Q_OS_WIN) && !defined(Q_OS_CYGWIN)) || defined(__HAIKU__)
|
|
return qApp->applicationDirPath();
|
|
#else
|
|
return QDir(QStringLiteral("%1/../share/qmmp" APP_NAME_SUFFIX).arg(qApp->applicationDirPath())).absolutePath();
|
|
@@ -176,7 +176,7 @@ QString Qmmp::dataPath()
|
|
|
|
QString Qmmp::userDataPath()
|
|
{
|
|
-#if defined(Q_OS_WIN) && !defined(Q_OS_CYGWIN)
|
|
+#if (defined(Q_OS_WIN) && !defined(Q_OS_CYGWIN)) || defined(__HAIKU__)
|
|
return configDir();
|
|
#else
|
|
if(m_configDir.isEmpty())
|
|
--
|
|
2.48.1
|
|
|