From 546d3c897031d2b6f1c36c4b9cd94e3b9e0e62b9 Mon Sep 17 00:00:00 2001 From: Cerapter Date: Tue, 23 Oct 2018 09:33:58 +0200 Subject: [PATCH] Moved bassopus stuff to its own function. Not that it works, so whatever. --- courtroom.cpp | 20 ++++++++++++++++---- courtroom.h | 2 ++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/courtroom.cpp b/courtroom.cpp index c38a607..2d5468e 100644 --- a/courtroom.cpp +++ b/courtroom.cpp @@ -22,8 +22,7 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow() if (ao_app->get_audio_output_device() == "Default") { BASS_Init(-1, 48000, BASS_DEVICE_LATENCY, 0, NULL); - BASS_PluginLoad("bassopus.dll", BASS_UNICODE); - BASS_PluginLoad("libbassopus.so", 0); + load_bass_opus_plugin(); } else { @@ -33,8 +32,7 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow() { BASS_SetDevice(a); BASS_Init(a, 48000, BASS_DEVICE_LATENCY, 0, NULL); - BASS_PluginLoad("bassopus.dll", BASS_UNICODE); - BASS_PluginLoad("libbassopus.so", 0); + load_bass_opus_plugin(); qDebug() << info.name << "was set as the default audio output device."; break; } @@ -3514,3 +3512,17 @@ Courtroom::~Courtroom() delete objection_player; delete blip_player; } + +#if (defined (_WIN32) || defined (_WIN64)) +void Courtroom::load_bass_opus_plugin() +{ + BASS_PluginLoad("bassopus.dll", 0); +} +#elif (defined (LINUX) || defined (__linux__)) +void Courtroom::load_bass_opus_plugin() +{ + BASS_PluginLoad("libbassopus.so", 0); +} +#else +#error This operating system is unsupported for bass plugins. +#endif diff --git a/courtroom.h b/courtroom.h index 4aa4f00..1ee09cd 100644 --- a/courtroom.h +++ b/courtroom.h @@ -645,6 +645,8 @@ private slots: void on_switch_area_music_clicked(); void ping_server(); + + void load_bass_opus_plugin(); }; #endif // COURTROOM_H