aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeifa <26681464+TrickyLeifa@users.noreply.github.com>2024-07-07 15:04:49 +0200
committerGitHub <noreply@github.com>2024-07-07 15:04:49 +0200
commitf59b41fe08b530e44889b1689de54e958ae3cdd2 (patch)
tree6b03ad07a5e700f67ae1946b2397fb0277d9ed55
parent03025119c4a7316e83f5336756d3afc9d1ff82b1 (diff)
Removed MIDI, removed undocumented (yet supported) formats (#1008)
* Removed MIDI, removed undocumented (yet supported) formats Resolve #1006 * Adjusted CI for MIDI removal
-rw-r--r--.github/workflows/build.yml12
-rw-r--r--CMakeLists.txt12
-rw-r--r--src/aoapplication.cpp8
-rw-r--r--src/aomusicplayer.cpp14
-rw-r--r--src/text_file_functions.cpp2
5 files changed, 15 insertions, 33 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 93f18fd9..b0fd027e 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -60,12 +60,6 @@ jobs:
cp ./bass/c/x64/bass.lib ./lib/
cp ./bass/x64/bass.dll ./bin/
- curl http://www.un4seen.com/files/bassmidi24.zip -o bassmidi.zip
- unzip -d bass -o bassmidi.zip
- cp ./bass/c/bassmidi.h ./lib
- cp ./bass/c/x64/bassmidi.lib ./lib/
- cp ./bass/x64/bassmidi.dll ./bin/
-
curl http://www.un4seen.com/files/bassopus24.zip -o bassopus.zip
unzip -d bass -o bassopus.zip
cp ./bass/c/bassopus.h ./lib
@@ -149,12 +143,6 @@ jobs:
cp ./bass/libs/x86_64/libbass.so ./lib/
cp ./bass/libs/x86_64/libbass.so ./bin/
- curl http://www.un4seen.com/files/bassmidi24-linux.zip -o bassmidi.zip
- unzip -d bass -o bassmidi.zip
- cp ./bass/bassmidi.h ./lib
- cp ./bass/libs/x86_64/libbassmidi.so ./lib/
- cp ./bass/libs/x86_64/libbassmidi.so ./bin/
-
curl http://www.un4seen.com/files/bassopus24-linux.zip -o bassopus.zip
unzip -d bass -o bassopus.zip
cp ./bass/bassopus.h ./lib
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6fabdcff..8488259b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -117,7 +117,17 @@ endif()
target_include_directories(Attorney_Online PRIVATE src lib)
target_link_directories(Attorney_Online PRIVATE lib)
-target_link_libraries(Attorney_Online PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Network Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Concurrent Qt${QT_VERSION_MAJOR}::WebSockets Qt${QT_VERSION_MAJOR}::UiTools bass bassopus bassmidi)
+target_link_libraries(Attorney_Online PRIVATE
+ Qt${QT_VERSION_MAJOR}::Core
+ Qt${QT_VERSION_MAJOR}::Gui
+ Qt${QT_VERSION_MAJOR}::Network
+ Qt${QT_VERSION_MAJOR}::Widgets
+ Qt${QT_VERSION_MAJOR}::Concurrent
+ Qt${QT_VERSION_MAJOR}::WebSockets
+ Qt${QT_VERSION_MAJOR}::UiTools
+ bass
+ bassopus
+)
if(AO_ENABLE_DISCORD_RPC)
target_compile_definitions(Attorney_Online PRIVATE AO_ENABLE_DISCORD_RPC)
diff --git a/src/aoapplication.cpp b/src/aoapplication.cpp
index f3260ed2..7a8e4ea3 100644
--- a/src/aoapplication.cpp
+++ b/src/aoapplication.cpp
@@ -7,10 +7,9 @@
#include "options.h"
#include "widgets/aooptionsdialog.h"
-#include <bassmidi.h>
-
static QtMessageHandler original_message_handler;
static AOApplication *message_handler_context;
+
void message_handler(QtMsgType type, const QMessageLogContext &context, const QString &msg)
{
Q_EMIT message_handler_context->qt_log_message(type, context, msg);
@@ -221,33 +220,28 @@ void AOApplication::initBASS()
BASS_Init(static_cast<int>(a), 48000, BASS_DEVICE_LATENCY, nullptr, nullptr);
load_bass_plugins();
qInfo() << info.name << "was set as the default audio output device.";
- BASS_SetConfigPtr(BASS_CONFIG_MIDI_DEFFONT, QString(get_base_path() + "soundfont.sf2").toStdString().c_str());
return;
}
}
BASS_Init(-1, 48000, BASS_DEVICE_LATENCY, nullptr, nullptr);
load_bass_plugins();
}
- BASS_SetConfigPtr(BASS_CONFIG_MIDI_DEFFONT, QString(get_base_path() + "soundfont.sf2").toStdString().c_str());
}
#if (defined(_WIN32) || defined(_WIN64))
void AOApplication::load_bass_plugins()
{
BASS_PluginLoad("bassopus.dll", 0);
- BASS_PluginLoad("bassmidi.dll", 0);
}
#elif defined __APPLE__
void AOApplication::load_bass_plugins()
{
BASS_PluginLoad("libbassopus.dylib", 0);
- BASS_PluginLoad("libbassmidi.dylib", 0);
}
#elif (defined(LINUX) || defined(__linux__))
void AOApplication::load_bass_plugins()
{
BASS_PluginLoad("libbassopus.so", 0);
- BASS_PluginLoad("libbassmidi.so", 0);
}
#else
#error This operating system is unsupported for BASS plugins.
diff --git a/src/aomusicplayer.cpp b/src/aomusicplayer.cpp
index 4265a463..c4a562cb 100644
--- a/src/aomusicplayer.cpp
+++ b/src/aomusicplayer.cpp
@@ -35,7 +35,7 @@ QString AOMusicPlayer::playStream(QString song, int streamId, bool loopEnabled,
}
QString f_path = song;
- DWORD newstream;
+ HSTREAM newstream;
if (f_path.startsWith("http"))
{
if (!Options::getInstance().streamingEnabled())
@@ -51,17 +51,7 @@ QString AOMusicPlayer::playStream(QString song, int streamId, bool loopEnabled,
flags |= BASS_STREAM_PRESCAN | BASS_UNICODE | BASS_ASYNCFILE;
f_path = ao_app->get_real_path(ao_app->get_music_path(song));
-
- QString extension = f_path.split('.').last();
- static const QStringList VALID_EXTENSION_LIST{"mo3", "xm", "mod", "s3m", "it", "mtm", "umx"};
- if (VALID_EXTENSION_LIST.contains(extension, Qt::CaseInsensitive))
- {
- newstream = BASS_MusicLoad(FALSE, f_path.utf16(), 0, 0, flags, 1);
- }
- else
- {
- newstream = BASS_StreamCreateFile(FALSE, f_path.utf16(), 0, 0, flags);
- }
+ newstream = BASS_StreamCreateFile(FALSE, f_path.utf16(), 0, 0, flags);
}
int error = BASS_ErrorGetCode();
diff --git a/src/text_file_functions.cpp b/src/text_file_functions.cpp
index 35efe20c..763efb58 100644
--- a/src/text_file_functions.cpp
+++ b/src/text_file_functions.cpp
@@ -360,7 +360,7 @@ QString AOApplication::get_court_sfx(QString p_identifier, QString p_misc)
QString AOApplication::get_sfx_suffix(VPath sound_to_check)
{
- QStringList suffixes = {".opus", ".ogg", ".mp3", ".wav", ".mid", ".midi", ".xm", ".it", ".s3m", ".mod", ".mtm", ".umx"};
+ QStringList suffixes = {".opus", ".ogg", ".mp3", ".wav"};
// Check if we were provided a direct filepath with a suffix already
QString path = sound_to_check.toQString();
// Loop through our suffixes