Removed MIDI, removed undocumented (yet supported) formats (#1008)
* Removed MIDI, removed undocumented (yet supported) formats Resolve #1006 * Adjusted CI for MIDI removal
This commit is contained in:
		
							parent
							
								
									03025119c4
								
							
						
					
					
						commit
						f59b41fe08
					
				
							
								
								
									
										12
									
								
								.github/workflows/build.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										12
									
								
								.github/workflows/build.yml
									
									
									
									
										vendored
									
									
								
							@ -60,12 +60,6 @@ jobs:
 | 
				
			|||||||
          cp ./bass/c/x64/bass.lib ./lib/
 | 
					          cp ./bass/c/x64/bass.lib ./lib/
 | 
				
			||||||
          cp ./bass/x64/bass.dll ./bin/
 | 
					          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
 | 
					          curl http://www.un4seen.com/files/bassopus24.zip -o bassopus.zip
 | 
				
			||||||
          unzip -d bass -o bassopus.zip
 | 
					          unzip -d bass -o bassopus.zip
 | 
				
			||||||
          cp ./bass/c/bassopus.h ./lib
 | 
					          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 ./lib/
 | 
				
			||||||
          cp ./bass/libs/x86_64/libbass.so ./bin/
 | 
					          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
 | 
					          curl http://www.un4seen.com/files/bassopus24-linux.zip -o bassopus.zip
 | 
				
			||||||
          unzip -d bass -o bassopus.zip
 | 
					          unzip -d bass -o bassopus.zip
 | 
				
			||||||
          cp ./bass/bassopus.h ./lib
 | 
					          cp ./bass/bassopus.h ./lib
 | 
				
			||||||
 | 
				
			|||||||
@ -117,7 +117,17 @@ endif()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
target_include_directories(Attorney_Online PRIVATE src lib)
 | 
					target_include_directories(Attorney_Online PRIVATE src lib)
 | 
				
			||||||
target_link_directories(Attorney_Online PRIVATE 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)
 | 
					if(AO_ENABLE_DISCORD_RPC)
 | 
				
			||||||
  target_compile_definitions(Attorney_Online PRIVATE AO_ENABLE_DISCORD_RPC)
 | 
					  target_compile_definitions(Attorney_Online PRIVATE AO_ENABLE_DISCORD_RPC)
 | 
				
			||||||
 | 
				
			|||||||
@ -7,10 +7,9 @@
 | 
				
			|||||||
#include "options.h"
 | 
					#include "options.h"
 | 
				
			||||||
#include "widgets/aooptionsdialog.h"
 | 
					#include "widgets/aooptionsdialog.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <bassmidi.h>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
static QtMessageHandler original_message_handler;
 | 
					static QtMessageHandler original_message_handler;
 | 
				
			||||||
static AOApplication *message_handler_context;
 | 
					static AOApplication *message_handler_context;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void message_handler(QtMsgType type, const QMessageLogContext &context, const QString &msg)
 | 
					void message_handler(QtMsgType type, const QMessageLogContext &context, const QString &msg)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  Q_EMIT message_handler_context->qt_log_message(type, context, 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);
 | 
					        BASS_Init(static_cast<int>(a), 48000, BASS_DEVICE_LATENCY, nullptr, nullptr);
 | 
				
			||||||
        load_bass_plugins();
 | 
					        load_bass_plugins();
 | 
				
			||||||
        qInfo() << info.name << "was set as the default audio output device.";
 | 
					        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;
 | 
					        return;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    BASS_Init(-1, 48000, BASS_DEVICE_LATENCY, nullptr, nullptr);
 | 
					    BASS_Init(-1, 48000, BASS_DEVICE_LATENCY, nullptr, nullptr);
 | 
				
			||||||
    load_bass_plugins();
 | 
					    load_bass_plugins();
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  BASS_SetConfigPtr(BASS_CONFIG_MIDI_DEFFONT, QString(get_base_path() + "soundfont.sf2").toStdString().c_str());
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if (defined(_WIN32) || defined(_WIN64))
 | 
					#if (defined(_WIN32) || defined(_WIN64))
 | 
				
			||||||
void AOApplication::load_bass_plugins()
 | 
					void AOApplication::load_bass_plugins()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  BASS_PluginLoad("bassopus.dll", 0);
 | 
					  BASS_PluginLoad("bassopus.dll", 0);
 | 
				
			||||||
  BASS_PluginLoad("bassmidi.dll", 0);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
#elif defined __APPLE__
 | 
					#elif defined __APPLE__
 | 
				
			||||||
void AOApplication::load_bass_plugins()
 | 
					void AOApplication::load_bass_plugins()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  BASS_PluginLoad("libbassopus.dylib", 0);
 | 
					  BASS_PluginLoad("libbassopus.dylib", 0);
 | 
				
			||||||
  BASS_PluginLoad("libbassmidi.dylib", 0);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
#elif (defined(LINUX) || defined(__linux__))
 | 
					#elif (defined(LINUX) || defined(__linux__))
 | 
				
			||||||
void AOApplication::load_bass_plugins()
 | 
					void AOApplication::load_bass_plugins()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  BASS_PluginLoad("libbassopus.so", 0);
 | 
					  BASS_PluginLoad("libbassopus.so", 0);
 | 
				
			||||||
  BASS_PluginLoad("libbassmidi.so", 0);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
#error This operating system is unsupported for BASS plugins.
 | 
					#error This operating system is unsupported for BASS plugins.
 | 
				
			||||||
 | 
				
			|||||||
@ -35,7 +35,7 @@ QString AOMusicPlayer::playStream(QString song, int streamId, bool loopEnabled,
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  QString f_path = song;
 | 
					  QString f_path = song;
 | 
				
			||||||
  DWORD newstream;
 | 
					  HSTREAM newstream;
 | 
				
			||||||
  if (f_path.startsWith("http"))
 | 
					  if (f_path.startsWith("http"))
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    if (!Options::getInstance().streamingEnabled())
 | 
					    if (!Options::getInstance().streamingEnabled())
 | 
				
			||||||
@ -51,18 +51,8 @@ QString AOMusicPlayer::playStream(QString song, int streamId, bool loopEnabled,
 | 
				
			|||||||
    flags |= BASS_STREAM_PRESCAN | BASS_UNICODE | BASS_ASYNCFILE;
 | 
					    flags |= BASS_STREAM_PRESCAN | BASS_UNICODE | BASS_ASYNCFILE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    f_path = ao_app->get_real_path(ao_app->get_music_path(song));
 | 
					    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();
 | 
					  int error = BASS_ErrorGetCode();
 | 
				
			||||||
  if (Options::getInstance().audioOutputDevice() != "default")
 | 
					  if (Options::getInstance().audioOutputDevice() != "default")
 | 
				
			||||||
 | 
				
			|||||||
@ -360,7 +360,7 @@ QString AOApplication::get_court_sfx(QString p_identifier, QString p_misc)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
QString AOApplication::get_sfx_suffix(VPath sound_to_check)
 | 
					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
 | 
					  // Check if we were provided a direct filepath with a suffix already
 | 
				
			||||||
  QString path = sound_to_check.toQString();
 | 
					  QString path = sound_to_check.toQString();
 | 
				
			||||||
  // Loop through our suffixes
 | 
					  // Loop through our suffixes
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user