mirror of
https://github.com/yann64/haikuports.git
synced 2026-05-04 22:18:55 +02:00
747 lines
23 KiB
Plaintext
747 lines
23 KiB
Plaintext
From 42b234b71cfc75d88f7954a48dc3cfd1eab021f2 Mon Sep 17 00:00:00 2001
|
|
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
|
Date: Tue, 28 Nov 2017 00:42:45 +1000
|
|
Subject: Fix build for Haiku
|
|
|
|
|
|
diff --git a/qmmp.pri b/qmmp.pri
|
|
index 823eaa9..a8c8f90 100644
|
|
--- a/qmmp.pri
|
|
+++ b/qmmp.pri
|
|
@@ -13,7 +13,9 @@ RCC_DIR=./.build/rcc
|
|
#Defines
|
|
|
|
DEFINES += QT_NO_CAST_FROM_BYTEARRAY QT_STRICT_ITERATORS
|
|
+unix:!haiku {
|
|
DEFINES += QMMP_WS_X11
|
|
+}
|
|
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x050400
|
|
|
|
#Configuration
|
|
diff --git a/src/app/app.pro b/src/app/app.pro
|
|
index 3f7ba55..87e38a9 100644
|
|
--- a/src/app/app.pro
|
|
+++ b/src/app/app.pro
|
|
@@ -4,6 +4,7 @@ TEMPLATE = app
|
|
|
|
unix:TARGET = ../../bin/qmmp
|
|
win32:TARGET = ../../../bin/qmmp
|
|
+haiku:TARGET = ../../Qmmp
|
|
|
|
QT += network
|
|
|
|
diff --git a/src/plugins/Effect/Effect.pro b/src/plugins/Effect/Effect.pro
|
|
index 5a1cc69..800ad00 100644
|
|
--- a/src/plugins/Effect/Effect.pro
|
|
+++ b/src/plugins/Effect/Effect.pro
|
|
@@ -2,11 +2,12 @@ include (../../../qmmp.pri)
|
|
TEMPLATE = subdirs
|
|
|
|
SUBDIRS += crossfade stereo
|
|
-
|
|
+!haiku {
|
|
contains(CONFIG, BS2B_PLUGIN):SUBDIRS += bs2b
|
|
contains(CONFIG, SOXR_PLUGIN):SUBDIRS += soxr
|
|
+}
|
|
contains(CONFIG, FILEWRITER_PLUGIN):SUBDIRS += filewriter
|
|
|
|
-unix {
|
|
+unix:!haiku {
|
|
contains(CONFIG, LADSPA_PLUGIN):SUBDIRS += ladspa
|
|
}
|
|
diff --git a/src/plugins/General/General.pro b/src/plugins/General/General.pro
|
|
index 03727ba..e5a9ecd 100644
|
|
--- a/src/plugins/General/General.pro
|
|
+++ b/src/plugins/General/General.pro
|
|
@@ -1,27 +1,27 @@
|
|
include(../../../qmmp.pri)
|
|
|
|
SUBDIRS += statusicon \
|
|
- notifier \
|
|
lyrics \
|
|
scrobbler \
|
|
fileops \
|
|
covermanager \
|
|
streambrowser \
|
|
trackchange \
|
|
- hotkey \
|
|
copypaste \
|
|
rgscan
|
|
-unix:SUBDIRS += mpris \
|
|
+unix:!haiku:SUBDIRS += mpris \
|
|
+ notifier \
|
|
+ hotkey \
|
|
kdenotify \
|
|
converter \
|
|
gnomehotkey
|
|
|
|
contains(CONFIG, UDISKS2_PLUGIN){
|
|
- unix:SUBDIRS += udisks2
|
|
+ unix:!haiku:SUBDIRS += udisks2
|
|
}
|
|
|
|
contains(CONFIG, HAL_PLUGIN){
|
|
- unix:SUBDIRS += hal
|
|
+ unix:!haiku:SUBDIRS += hal
|
|
}
|
|
|
|
TEMPLATE = subdirs
|
|
diff --git a/src/plugins/Input/Input.pro b/src/plugins/Input/Input.pro
|
|
index eef4806..1262644 100644
|
|
--- a/src/plugins/Input/Input.pro
|
|
+++ b/src/plugins/Input/Input.pro
|
|
@@ -19,6 +19,7 @@ contains(CONFIG, FFMPEG_PLUGIN){
|
|
SUBDIRS += ffmpeg
|
|
}
|
|
|
|
+!haiku {
|
|
contains(CONFIG, GME_PLUGIN){
|
|
SUBDIRS += gme
|
|
}
|
|
@@ -34,6 +35,7 @@ contains(CONFIG, CDAUDIO_PLUGIN){
|
|
contains(CONFIG, SID_PLUGIN){
|
|
SUBDIRS += sid
|
|
}
|
|
+}
|
|
|
|
unix{
|
|
|
|
@@ -42,9 +44,11 @@ contains(CONFIG, AAC_PLUGIN){
|
|
}
|
|
|
|
|
|
+!haiku {
|
|
contains(CONFIG, WILDMIDI_PLUGIN){
|
|
SUBDIRS += wildmidi
|
|
}
|
|
+}
|
|
|
|
contains(CONFIG, ARCHIVE_PLUGIN){
|
|
TAGLIB_VERSION = $$system("pkg-config --modversion taglib")
|
|
diff --git a/src/plugins/Output/Output.pro b/src/plugins/Output/Output.pro
|
|
index 1d745e4..194b25b 100644
|
|
--- a/src/plugins/Output/Output.pro
|
|
+++ b/src/plugins/Output/Output.pro
|
|
@@ -7,7 +7,7 @@ win32:SUBDIRS += wasapi
|
|
|
|
SUBDIRS += null
|
|
|
|
-unix{
|
|
+unix:!haiku{
|
|
|
|
contains(CONFIG, JACK_PLUGIN){
|
|
SUBDIRS += jack
|
|
@@ -34,9 +34,13 @@ contains(CONFIG, SHOUT_PLUGIN){
|
|
}
|
|
}
|
|
|
|
+haiku{
|
|
+ SUBDIRS += mediakit
|
|
+}
|
|
+
|
|
#all platforms
|
|
qtHaveModule(multimedia){
|
|
contains(CONFIG, QTMULTIMEDIA_PLUGIN){
|
|
- SUBDIRS += qtmultimedia
|
|
+ !haiku:SUBDIRS += qtmultimedia
|
|
}
|
|
}
|
|
diff --git a/src/plugins/Ui/skinned/skinned.pro b/src/plugins/Ui/skinned/skinned.pro
|
|
index 9e55ab2..4565cf3 100644
|
|
--- a/src/plugins/Ui/skinned/skinned.pro
|
|
+++ b/src/plugins/Ui/skinned/skinned.pro
|
|
@@ -121,7 +121,7 @@ RESOURCES = resources/resources.qrc \
|
|
|
|
LIBS += $$QMMPUI_LIB
|
|
|
|
-unix {
|
|
+unix:!haiku {
|
|
target.path = $$LIB_DIR/qmmp/Ui
|
|
INSTALLS += target
|
|
PKGCONFIG += x11
|
|
diff --git a/src/plugins/Ui/skinned/symboldisplay.cpp b/src/plugins/Ui/skinned/symboldisplay.cpp
|
|
index 49a6ce3..d5a6e33 100644
|
|
--- a/src/plugins/Ui/skinned/symboldisplay.cpp
|
|
+++ b/src/plugins/Ui/skinned/symboldisplay.cpp
|
|
@@ -32,7 +32,7 @@ SymbolDisplay::SymbolDisplay (QWidget *parent, int digits)
|
|
connect (m_skin, SIGNAL (skinChanged()), this, SLOT (draw()));
|
|
draw();
|
|
for (int i=0; i<m_digits; ++i)
|
|
-#if defined(Q_OS_FREEBSD) || defined(Q_OS_WIN) || defined (Q_OS_MAC)
|
|
+#if defined(Q_OS_FREEBSD) || defined(Q_OS_WIN) || defined (Q_OS_MAC) || defined (Q_OS_HAIKU)
|
|
m_max += 9 * (int) pow(10,i);
|
|
#else
|
|
m_max += 9 * (int) exp10(i);
|
|
diff --git a/src/plugins/Visual/Visual.pro b/src/plugins/Visual/Visual.pro
|
|
index e3f6d5e..1150b9a 100644
|
|
--- a/src/plugins/Visual/Visual.pro
|
|
+++ b/src/plugins/Visual/Visual.pro
|
|
@@ -3,5 +3,5 @@ TEMPLATE = subdirs
|
|
|
|
SUBDIRS += analyzer
|
|
contains(CONFIG, PROJECTM_PLUGIN){
|
|
- SUBDIRS += projectm
|
|
+ !haiku:SUBDIRS += projectm
|
|
}
|
|
diff --git a/src/plugins/plugins.pri b/src/plugins/plugins.pri
|
|
index f56e33e..a9e449c 100644
|
|
--- a/src/plugins/plugins.pri
|
|
+++ b/src/plugins/plugins.pri
|
|
@@ -9,7 +9,7 @@ win32 {
|
|
QMMPUI_LIB = -lqmmpui0
|
|
}
|
|
|
|
-unix {
|
|
+unix:!haiku {
|
|
isEmpty(LIB_DIR){
|
|
LIB_DIR = /lib
|
|
}
|
|
@@ -18,6 +18,14 @@ unix {
|
|
QMMPUI_LIB = -lqmmpui
|
|
}
|
|
|
|
+haiku {
|
|
+ isEmpty(LIB_DIR){
|
|
+ LIB_DIR = /lib
|
|
+ }
|
|
+ PLUGINS_PREFIX=../../../../plugins
|
|
+ LIBS += -lqmmp
|
|
+ QMMPUI_LIB = -lqmmpui
|
|
+}
|
|
|
|
CONFIG += warn_on plugin lib thread link_pkgconfig hide_symbols
|
|
TEMPLATE = lib
|
|
diff --git a/src/qmmp/qmmp.cpp b/src/qmmp/qmmp.cpp
|
|
index 44f404e..9b20982 100644
|
|
--- a/src/qmmp/qmmp.cpp
|
|
+++ b/src/qmmp/qmmp.cpp
|
|
@@ -56,6 +56,8 @@ const QString Qmmp::configDir()
|
|
}
|
|
else
|
|
return m_configDir;
|
|
+#elif defined(Q_OS_HAIKU)
|
|
+ return m_configDir.isEmpty() ? QDir::homePath() +"/config/settings/Qmmp/" : m_configDir;
|
|
#else
|
|
return m_configDir.isEmpty() ? QDir::homePath() +"/.qmmp/" : m_configDir;
|
|
#endif
|
|
@@ -93,7 +95,7 @@ const QString Qmmp::pluginsPath()
|
|
QDir dir(QMMP_INSTALL_PREFIX "/" LIB_DIR "/qmmp");
|
|
//qDebug(QMMP_INSTALL_PREFIX"/"LIB_DIR"/qmmp");
|
|
#else
|
|
-#if defined(Q_OS_WIN) && !defined(Q_OS_CYGWIN)
|
|
+#if defined(Q_OS_WIN) && !defined(Q_OS_CYGWIN) || defined(Q_OS_HAIKU)
|
|
QDir dir(qApp->applicationDirPath() + "/plugins");
|
|
#else
|
|
QDir dir(qApp->applicationDirPath() + "/../" LIB_DIR "/qmmp");
|
|
diff --git a/src/qmmpui/configdialog.cpp b/src/qmmpui/configdialog.cpp
|
|
index de0e271..a8173f8 100644
|
|
--- a/src/qmmpui/configdialog.cpp
|
|
+++ b/src/qmmpui/configdialog.cpp
|
|
@@ -56,6 +56,11 @@ ConfigDialog::ConfigDialog (QWidget *parent) : QDialog (parent)
|
|
m_insert_row = 0;
|
|
setAttribute(Qt::WA_QuitOnClose, false);
|
|
setAttribute(Qt::WA_DeleteOnClose, false);
|
|
+#if defined(Q_OS_HAIKU)
|
|
+ hide();
|
|
+ setWindowModality(Qt::NonModal);
|
|
+ show();
|
|
+#endif
|
|
m_ui->preferencesButton->setEnabled(false);
|
|
m_ui->informationButton->setEnabled(false);
|
|
m_ui->treeWidget->setItemDelegate(new RadioItemDelegate(this));
|
|
--
|
|
2.15.0
|
|
|
|
|
|
From 57dc32beb35771fa790587982bb41d625abff59e Mon Sep 17 00:00:00 2001
|
|
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
|
Date: Tue, 28 Nov 2017 00:46:04 +1000
|
|
Subject: Add mediakit output plugin
|
|
|
|
|
|
diff --git a/src/plugins/Output/mediakit/CMakeLists.txt b/src/plugins/Output/mediakit/CMakeLists.txt
|
|
new file mode 100644
|
|
index 0000000..55c1bdc
|
|
--- /dev/null
|
|
+++ b/src/plugins/Output/mediakit/CMakeLists.txt
|
|
@@ -0,0 +1,58 @@
|
|
+project(libmediakit)
|
|
+
|
|
+cmake_minimum_required(VERSION 2.4.7)
|
|
+
|
|
+if(COMMAND cmake_policy)
|
|
+cmake_policy(SET CMP0003 NEW)
|
|
+endif(COMMAND cmake_policy)
|
|
+
|
|
+# qt plugin
|
|
+ADD_DEFINITIONS( -Wall )
|
|
+ADD_DEFINITIONS(${QT_DEFINITIONS})
|
|
+ADD_DEFINITIONS(-DQT_PLUGIN)
|
|
+ADD_DEFINITIONS(-DQT_NO_DEBUG)
|
|
+ADD_DEFINITIONS(-DQT_SHARED)
|
|
+ADD_DEFINITIONS(-DQT_THREAD)
|
|
+
|
|
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
|
+
|
|
+SET(QT_INCLUDES
|
|
+ ${QT_INCLUDES}
|
|
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../
|
|
+)
|
|
+
|
|
+# libqmmp
|
|
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../)
|
|
+link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp)
|
|
+
|
|
+SET(libmediakit_SRCS
|
|
+ outputmediakit.cpp
|
|
+ outputmediakitfactory.cpp
|
|
+)
|
|
+
|
|
+SET(libmediakit_MOC_HDRS
|
|
+ outputmediakitfactory.h
|
|
+)
|
|
+
|
|
+SET(libmediakit_HDRS
|
|
+ outputmediakit.h
|
|
+)
|
|
+
|
|
+SET(libmediakit_RCCS translations/translations.qrc)
|
|
+
|
|
+QT4_ADD_RESOURCES(libmediakit_RCC_SRCS ${libmediakit_RCCS})
|
|
+
|
|
+QT4_WRAP_CPP(libmediakit_MOC_SRCS ${libmediakit_MOC_HDRS})
|
|
+
|
|
+
|
|
+# 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_MOC_SRCS} ${libmediakit_UIS_H}
|
|
+ ${libmediakit_RCC_SRCS} ${libmediakit_HDRS})
|
|
+add_dependencies(mediakit qmmp)
|
|
+target_link_libraries(mediakit ${QT_LIBRARIES} -lqmmp -lbe -lmedia -lgame)
|
|
+install(TARGETS mediakit DESTINATION ${LIB_DIR}/qmmp/Output)
|
|
+
|
|
+
|
|
diff --git a/src/plugins/Output/mediakit/mediakit.pro b/src/plugins/Output/mediakit/mediakit.pro
|
|
new file mode 100644
|
|
index 0000000..d18625e
|
|
--- /dev/null
|
|
+++ b/src/plugins/Output/mediakit/mediakit.pro
|
|
@@ -0,0 +1,31 @@
|
|
+include(../../plugins.pri)
|
|
+
|
|
+HEADERS += outputmediakitfactory.h \
|
|
+ outputmediakit.h
|
|
+
|
|
+SOURCES += outputmediakitfactory.cpp \
|
|
+ outputmediakit.cpp
|
|
+
|
|
+
|
|
+TARGET=$$PLUGINS_PREFIX/Output/mediakit
|
|
+QMAKE_CLEAN =$$PLUGINS_PREFIX/Output/libmediakit.so
|
|
+
|
|
+INCLUDEPATH += ../../../
|
|
+QMAKE_LIBDIR += ../../../../lib
|
|
+
|
|
+CONFIG += warn_on \
|
|
+thread \
|
|
+plugin \
|
|
+link_pkgconfig
|
|
+
|
|
+TEMPLATE = lib
|
|
+LIBS += -lqmmp -lbe -lmedia
|
|
+
|
|
+RESOURCES = translations/translations.qrc
|
|
+
|
|
+isEmpty (LIB_DIR){
|
|
+LIB_DIR = /lib
|
|
+}
|
|
+
|
|
+target.path = $$LIB_DIR/qmmp/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..b0ea1b6
|
|
--- /dev/null
|
|
+++ b/src/plugins/Output/mediakit/outputmediakit.cpp
|
|
@@ -0,0 +1,137 @@
|
|
+/***************************************************************************
|
|
+ * Copyright (C) 2013-2015 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.count(), 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..0a65f44
|
|
--- /dev/null
|
|
+++ b/src/plugins/Output/mediakit/outputmediakit.h
|
|
@@ -0,0 +1,56 @@
|
|
+/***************************************************************************
|
|
+ * Copyright (C) 2013-2015 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..f54967e
|
|
--- /dev/null
|
|
+++ b/src/plugins/Output/mediakit/outputmediakitfactory.cpp
|
|
@@ -0,0 +1,68 @@
|
|
+/***************************************************************************
|
|
+ * Copyright (C) 2007-2012 by Ilya Kotov *
|
|
+ * forkotov02@hotmail.ru *
|
|
+ * *
|
|
+ * 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"
|
|
+
|
|
+
|
|
+const 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;
|
|
+}
|
|
+
|
|
+void OutputMediaKitFactory::showSettings(QWidget* parent)
|
|
+{
|
|
+ Q_UNUSED(parent);
|
|
+}
|
|
+
|
|
+void OutputMediaKitFactory::showAbout(QWidget *parent)
|
|
+{
|
|
+ QMessageBox::about (parent, "About MediaKit Output Plugin",
|
|
+ "Qmmp MediaKit Output Plugin\n(C) 2013-2015 3dEyes**");
|
|
+}
|
|
+
|
|
+QTranslator *OutputMediaKitFactory::createTranslator(QObject *parent)
|
|
+{
|
|
+ QTranslator *translator = new QTranslator(parent);
|
|
+ QString locale = Qmmp::systemLanguageID();
|
|
+ translator->load(QString(":/mediakit_plugin_") + locale);
|
|
+ return translator;
|
|
+}
|
|
+
|
|
+//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..6f3c721
|
|
--- /dev/null
|
|
+++ b/src/plugins/Output/mediakit/outputmediakitfactory.h
|
|
@@ -0,0 +1,49 @@
|
|
+/***************************************************************************
|
|
+ * Copyright (C) 2007-2012 by Ilya Kotov *
|
|
+ * forkotov02@hotmail.ru *
|
|
+ * *
|
|
+ * 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:
|
|
+ const OutputProperties properties() const;
|
|
+ Output* create();
|
|
+ Volume *createVolume();
|
|
+ void showSettings(QWidget* parent);
|
|
+ void showAbout(QWidget *parent);
|
|
+ QTranslator *createTranslator(QObject *parent);
|
|
+};
|
|
+
|
|
+#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>
|
|
--
|
|
2.15.0
|
|
|
|
|
|
From 50c8b80d4a6f0c7fe59c9c0781c4b6e1407c1efd Mon Sep 17 00:00:00 2001
|
|
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
|
Date: Tue, 28 Nov 2017 17:50:44 +1000
|
|
Subject: Fix skins directory for Haiku
|
|
|
|
|
|
diff --git a/src/plugins/Ui/skinned/skinreader.cpp b/src/plugins/Ui/skinned/skinreader.cpp
|
|
index 160e9b4..6c66770 100644
|
|
--- a/src/plugins/Ui/skinned/skinreader.cpp
|
|
+++ b/src/plugins/Ui/skinned/skinreader.cpp
|
|
@@ -49,7 +49,7 @@ void SkinReader::generateThumbs()
|
|
QDir dir(Qmmp::configDir() + "skins");
|
|
dir.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks);
|
|
QFileInfoList f = dir.entryInfoList();
|
|
-#if defined(Q_OS_WIN) && !defined(Q_OS_CYGWIN)
|
|
+#if (defined(Q_OS_WIN) && !defined(Q_OS_CYGWIN)) || defined(Q_OS_HAIKU)
|
|
dir.setPath(qApp->applicationDirPath()+"/skins");
|
|
#else
|
|
dir.setPath(qApp->applicationDirPath()+"/../share/qmmp/skins");
|
|
--
|
|
2.15.0
|
|
|