mirror of
https://github.com/yann64/haikuports.git
synced 2026-05-06 06:58:57 +02:00
Qmmp: add recipe for version 1.1.12
This commit is contained in:
717
media-sound/qmmp/patches/qmmp-1.1.12.patchset
Normal file
717
media-sound/qmmp/patches/qmmp-1.1.12.patchset
Normal file
@@ -0,0 +1,717 @@
|
||||
From 62ab55037c834ee901189b87f5d65248f8ae3365 Mon Sep 17 00:00:00 2001
|
||||
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
||||
Date: Wed, 22 Nov 2017 16:41:34 +1000
|
||||
Subject: Fix build for Haiku
|
||||
|
||||
|
||||
diff --git a/qmmp.pri b/qmmp.pri
|
||||
index 1146cad..f46c649 100644
|
||||
--- a/qmmp.pri
|
||||
+++ b/qmmp.pri
|
||||
@@ -7,7 +7,9 @@ OBJECTS_DIR=./.build/obj
|
||||
RCC_DIR=./.build/rcc
|
||||
|
||||
QT += widgets
|
||||
+unix:!haiku {
|
||||
DEFINES += QMMP_WS_X11
|
||||
+}
|
||||
|
||||
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x050400
|
||||
|
||||
diff --git a/src/app/app.pro b/src/app/app.pro
|
||||
index 2598cf8..cb5b47a 100644
|
||||
--- a/src/app/app.pro
|
||||
+++ b/src/app/app.pro
|
||||
@@ -16,6 +16,7 @@ OBJECTS_DIR = ./.build/obj
|
||||
QT += network
|
||||
unix:TARGET = ../../bin/qmmp
|
||||
win32:TARGET = ../../../bin/qmmp
|
||||
+haiku:TARGET = ../../Qmmp
|
||||
CONFIG += thread \
|
||||
warn_on
|
||||
QMAKE_LIBDIR += ../../lib \
|
||||
diff --git a/src/plugins/Effect/Effect.pro b/src/plugins/Effect/Effect.pro
|
||||
index 417c06b..82a0c4f 100644
|
||||
--- a/src/plugins/Effect/Effect.pro
|
||||
+++ b/src/plugins/Effect/Effect.pro
|
||||
@@ -3,9 +3,11 @@ TEMPLATE = subdirs
|
||||
|
||||
SUBDIRS += crossfade stereo
|
||||
|
||||
+!haiku {
|
||||
contains(CONFIG, BS2B_PLUGIN):SUBDIRS += bs2b
|
||||
contains(CONFIG, SOXR_PLUGIN):SUBDIRS += soxr
|
||||
+}
|
||||
|
||||
-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..923aaf1 100644
|
||||
--- a/src/plugins/General/General.pro
|
||||
+++ b/src/plugins/General/General.pro
|
||||
@@ -8,20 +8,20 @@ SUBDIRS += statusicon \
|
||||
covermanager \
|
||||
streambrowser \
|
||||
trackchange \
|
||||
- hotkey \
|
||||
copypaste \
|
||||
rgscan
|
||||
-unix:SUBDIRS += mpris \
|
||||
+unix:!haiku:SUBDIRS += mpris \
|
||||
+ 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 887f126..c771588 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,8 +44,10 @@ contains(CONFIG, AAC_PLUGIN){
|
||||
}
|
||||
|
||||
|
||||
+!haiku {
|
||||
contains(CONFIG, WILDMIDI_PLUGIN){
|
||||
SUBDIRS += wildmidi
|
||||
}
|
||||
+}
|
||||
|
||||
}
|
||||
diff --git a/src/plugins/Output/Output.pro b/src/plugins/Output/Output.pro
|
||||
index c60ea4c..ff8cf91 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
|
||||
@@ -31,9 +31,13 @@ contains(CONFIG, OSS4_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 bdad79b..f2a8843 100644
|
||||
--- a/src/plugins/Ui/skinned/skinned.pro
|
||||
+++ b/src/plugins/Ui/skinned/skinned.pro
|
||||
@@ -128,7 +128,7 @@ win32:LIBS += -lqmmp0 -lqmmpui0
|
||||
|
||||
RESOURCES = resources/resources.qrc glare/glare.qrc
|
||||
|
||||
-unix{
|
||||
+unix:!haiku{
|
||||
isEmpty(LIB_DIR){
|
||||
LIB_DIR = /lib
|
||||
}
|
||||
diff --git a/src/plugins/Ui/skinned/symboldisplay.cpp b/src/plugins/Ui/skinned/symboldisplay.cpp
|
||||
index 2fd5893..ea6f231 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 1805bf5..3eae194 100644
|
||||
--- a/src/plugins/plugins.pri
|
||||
+++ b/src/plugins/plugins.pri
|
||||
@@ -1,5 +1,6 @@
|
||||
include(../../qmmp.pri)
|
||||
unix:PLUGINS_PREFIX=../../../../lib/qmmp
|
||||
win32:PLUGINS_PREFIX=../../../../../bin/plugins
|
||||
+haiku:PLUGINS_PREFIX=../../../../plugins
|
||||
INCLUDEPATH += ../../../qmmp
|
||||
CONFIG += hide_symbols
|
||||
diff --git a/src/qmmp/qmmp.cpp b/src/qmmp/qmmp.cpp
|
||||
index 777a290..92323d0 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 894191e..9aefb3a 100644
|
||||
--- a/src/qmmpui/configdialog.cpp
|
||||
+++ b/src/qmmpui/configdialog.cpp
|
||||
@@ -61,6 +61,9 @@ 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)
|
||||
+ setWindowModality(Qt::NonModal);
|
||||
+#endif
|
||||
m_ui->preferencesButton->setEnabled(false);
|
||||
m_ui->informationButton->setEnabled(false);
|
||||
m_ui->treeWidget->setItemDelegate(new RadioItemDelegate(this));
|
||||
--
|
||||
2.15.0
|
||||
|
||||
|
||||
From 729994441ffae6ed2cd890069c9b658f7d1b77d0 Mon Sep 17 00:00:00 2001
|
||||
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
||||
Date: Wed, 22 Nov 2017 17:12:04 +1000
|
||||
Subject: Add MidiaKit 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 aaa5c57cb74e8a3bb3284d36e8894799eec9002e Mon Sep 17 00:00:00 2001
|
||||
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
||||
Date: Wed, 22 Nov 2017 18:07:11 +1000
|
||||
Subject: Disable ConfigDialog modality
|
||||
|
||||
|
||||
diff --git a/src/qmmpui/configdialog.cpp b/src/qmmpui/configdialog.cpp
|
||||
index 9aefb3a..de9c651 100644
|
||||
--- a/src/qmmpui/configdialog.cpp
|
||||
+++ b/src/qmmpui/configdialog.cpp
|
||||
@@ -62,7 +62,9 @@ ConfigDialog::ConfigDialog (QWidget *parent) : QDialog (parent)
|
||||
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);
|
||||
--
|
||||
2.15.0
|
||||
|
||||
Reference in New Issue
Block a user