read and store qt audio device
This commit is contained in:
parent
35f2333403
commit
d94d2fb405
@ -23,6 +23,9 @@
|
||||
#include <QStringList>
|
||||
#include <QColor>
|
||||
#include <QScreen>
|
||||
#ifdef QTAUDIO
|
||||
#include <QAudioDeviceInfo>
|
||||
#endif
|
||||
|
||||
class NetworkManager;
|
||||
class Lobby;
|
||||
@ -173,6 +176,9 @@ public:
|
||||
|
||||
// Returns the audio device used for the client.
|
||||
QString get_audio_output_device();
|
||||
#ifdef QTAUDIO
|
||||
QAudioDeviceInfo QtAudioDevice;
|
||||
#endif
|
||||
|
||||
// Returns whether the user would like to have custom shownames on by default.
|
||||
bool get_showname_enabled_by_default();
|
||||
@ -196,8 +202,7 @@ public:
|
||||
pos_size_type get_element_dimensions(QString p_identifier, QString p_file);
|
||||
|
||||
//Returns the name of the font with p_identifier from p_file
|
||||
QString get_font_name(QString p_identifier, QString p_file);
|
||||
|
||||
QString get_font_name(QString p_identifier, QString p_file);
|
||||
|
||||
//Returns the value of font_size with p_identifier from p_file
|
||||
int get_font_size(QString p_identifier, QString p_file);
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "aomovie.h"
|
||||
#include "aocharmovie.h"
|
||||
#include "aomusicplayer.h"
|
||||
#include "aooptionsdialog.h"
|
||||
#include "aosfxplayer.h"
|
||||
#include "aoblipplayer.h"
|
||||
#include "aoevidencebutton.h"
|
||||
|
@ -28,6 +28,20 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow()
|
||||
}
|
||||
}
|
||||
}
|
||||
#elif defined QTAUDIO
|
||||
|
||||
if (ao_app->get_audio_output_device() != "default")
|
||||
{
|
||||
foreach (const QAudioDeviceInfo &deviceInfo, QAudioDeviceInfo::availableDevices(QAudio::AudioOutput))
|
||||
{
|
||||
if (ao_app->get_audio_output_device() == deviceInfo.deviceName())
|
||||
{
|
||||
ao_app->QtAudioDevice = deviceInfo;
|
||||
qDebug() << deviceInfo.deviceName() << "was set as the default audio output device.";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
keepalive_timer = new QTimer(this);
|
||||
|
Loading…
Reference in New Issue
Block a user