mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
Make Vatsim Voice UDP port configurable and 3290 the default
This commit is contained in:
committed by
Klaus Basan
parent
c72742029b
commit
28b404d065
@@ -52,6 +52,22 @@ namespace BlackCore
|
||||
//! \copydoc BlackCore::TSettingTrait::humanReadable
|
||||
static const QString &humanReadable() { static const QString name("Output device"); return name; }
|
||||
};
|
||||
|
||||
//! Audio input device settings
|
||||
struct TVatsimVoiceUdpPort : public BlackMisc::TSettingTrait<int>
|
||||
{
|
||||
//! \copydoc BlackMisc::TSettingTrait::key
|
||||
static const char *key() { return "audio/vatsimvoiceudpport"; }
|
||||
|
||||
//! \copydoc BlackCore::TSettingTrait::humanReadable
|
||||
static const QString &humanReadable() { static const QString name("Vatsim voice UDP port"); return name; }
|
||||
|
||||
//! \copydoc BlackMisc::TSettingTrait::defaultValue
|
||||
static int defaultValue() { return 3290; }
|
||||
|
||||
//! \copydoc BlackCore::TSettingTrait::isValid
|
||||
static bool isValid(int port) { return port >= 0 && port <= 65535; }
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace BlackCore
|
||||
CVoiceVatlib::CVoiceVatlib(QObject *parent) :
|
||||
IVoice(parent),
|
||||
m_audioService(Vat_CreateAudioService()),
|
||||
m_udpPort(Vat_CreateUDPAudioPort(m_audioService.data(), 0))
|
||||
m_udpPort(Vat_CreateUDPAudioPort(m_audioService.data(), m_vatsimVoicePortSetting.getThreadLocal()))
|
||||
{
|
||||
Vat_SetVoiceLogHandler(SeverityLevel::SeverityError, CVoiceVatlib::voiceLogHandler);
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#ifndef BLACKCORE_VOICE_VATLIB_H
|
||||
#define BLACKCORE_VOICE_VATLIB_H
|
||||
|
||||
#include "blackcore/audio/audiosettings.h"
|
||||
#include "blackcore/audiomixer.h"
|
||||
#include "blackcore/blackcoreexport.h"
|
||||
#include "blackcore/voice.h"
|
||||
@@ -116,6 +117,9 @@ namespace BlackCore
|
||||
|
||||
static void voiceLogHandler(SeverityLevel severity, const char *context, const char *message);
|
||||
|
||||
// settings
|
||||
BlackMisc::CSettingReadOnly<BlackCore::Audio::TVatsimVoiceUdpPort> m_vatsimVoicePortSetting { this };
|
||||
|
||||
QScopedPointer<VatAudioService, VatAudioServiceDeleter> m_audioService;
|
||||
QScopedPointer<VatUDPAudioPort, VatUDPAudioPortDeleter> m_udpPort;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user