aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--aoapplication.h2
-rw-r--r--aoblipplayer.cpp3
-rw-r--r--aomusicplayer.cpp3
-rw-r--r--aooptionsdialog.cpp19
-rw-r--r--aooptionsdialog.h2
-rw-r--r--aosfxplayer.cpp3
-rw-r--r--courtroom.cpp22
7 files changed, 43 insertions, 11 deletions
diff --git a/aoapplication.h b/aoapplication.h
index c5ab2bc5..fe5a4789 100644
--- a/aoapplication.h
+++ b/aoapplication.h
@@ -265,7 +265,7 @@ private:
const int CCCC_RELEASE = 1;
const int CCCC_MAJOR_VERSION = 3;
- const int CCCC_MINOR_VERSION = 0;
+ const int CCCC_MINOR_VERSION = 1;
QString current_theme = "default";
diff --git a/aoblipplayer.cpp b/aoblipplayer.cpp
index ed8a8d7f..0ea08978 100644
--- a/aoblipplayer.cpp
+++ b/aoblipplayer.cpp
@@ -29,7 +29,8 @@ void AOBlipPlayer::blip_tick()
HSTREAM f_stream = m_stream_list[f_cycle];
- BASS_ChannelSetDevice(f_stream, BASS_GetDevice());
+ if (ao_app->get_audio_output_device() != "Default")
+ BASS_ChannelSetDevice(f_stream, BASS_GetDevice());
BASS_ChannelPlay(f_stream, false);
}
diff --git a/aomusicplayer.cpp b/aomusicplayer.cpp
index f69128cf..9e763582 100644
--- a/aomusicplayer.cpp
+++ b/aomusicplayer.cpp
@@ -21,7 +21,8 @@ void AOMusicPlayer::play(QString p_song)
this->set_volume(m_volume);
- BASS_ChannelSetDevice(m_stream, BASS_GetDevice());
+ if (ao_app->get_audio_output_device() != "Default")
+ BASS_ChannelSetDevice(m_stream, BASS_GetDevice());
BASS_ChannelPlay(m_stream, false);
}
diff --git a/aooptionsdialog.cpp b/aooptionsdialog.cpp
index 3d6d5d6b..7d307dd3 100644
--- a/aooptionsdialog.cpp
+++ b/aooptionsdialog.cpp
@@ -211,6 +211,11 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app) : QDi
int a = 0;
BASS_DEVICEINFO info;
+ if (needs_default_audiodev())
+ {
+ AudioDeviceCombobox->addItem("Default");
+ }
+
for (a = 0; BASS_GetDeviceInfo(a, &info); a++)
{
AudioDeviceCombobox->addItem(info.name);
@@ -339,3 +344,17 @@ void AOOptionsDialog::discard_pressed()
{
done(0);
}
+
+#if (defined (_WIN32) || defined (_WIN64))
+bool AOOptionsDialog::needs_default_audiodev()
+{
+ return true;
+}
+#elif (defined (LINUX) || defined (__linux__))
+bool AOOptionsDialog::needs_default_audiodev()
+{
+ return false;
+}
+#else
+#error This operating system is not supported.
+#endif
diff --git a/aooptionsdialog.h b/aooptionsdialog.h
index 7d09f218..a48bff9e 100644
--- a/aooptionsdialog.h
+++ b/aooptionsdialog.h
@@ -79,6 +79,8 @@ private:
QLabel *BlankBlipsLabel;
QDialogButtonBox *SettingsButtons;
+ bool needs_default_audiodev();
+
signals:
public slots:
diff --git a/aosfxplayer.cpp b/aosfxplayer.cpp
index 667005df..df26ddf5 100644
--- a/aosfxplayer.cpp
+++ b/aosfxplayer.cpp
@@ -23,7 +23,8 @@ void AOSfxPlayer::play(QString p_sfx, QString p_char)
set_volume(m_volume);
- BASS_ChannelSetDevice(m_stream, BASS_GetDevice());
+ if (ao_app->get_audio_output_device() != "Default")
+ BASS_ChannelSetDevice(m_stream, BASS_GetDevice());
BASS_ChannelPlay(m_stream, false);
}
diff --git a/courtroom.cpp b/courtroom.cpp
index dce4186e..3b9930b8 100644
--- a/courtroom.cpp
+++ b/courtroom.cpp
@@ -19,15 +19,23 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow()
int a = 0;
BASS_DEVICEINFO info;
- for (a = 0; BASS_GetDeviceInfo(a, &info); a++)
+ if (ao_app->get_audio_output_device() == "Default")
{
- if (ao_app->get_audio_output_device() == info.name)
+ BASS_Init(-1, 48000, BASS_DEVICE_LATENCY, 0, NULL);
+ BASS_PluginLoad("bassopus.dll", BASS_UNICODE);
+ }
+ else
+ {
+ for (a = 0; BASS_GetDeviceInfo(a, &info); a++)
{
- BASS_SetDevice(a);
- BASS_Init(a, 48000, BASS_DEVICE_LATENCY, 0, NULL);
- BASS_PluginLoad("bassopus.dll", BASS_UNICODE);
- qDebug() << info.name << "was set as the default audio output device.";
- break;
+ if (ao_app->get_audio_output_device() == info.name)
+ {
+ BASS_SetDevice(a);
+ BASS_Init(a, 48000, BASS_DEVICE_LATENCY, 0, NULL);
+ BASS_PluginLoad("bassopus.dll", BASS_UNICODE);
+ qDebug() << info.name << "was set as the default audio output device.";
+ break;
+ }
}
}