mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-20 12:35:43 +08:00
Ref T730, style and removed "old voice code"
This commit is contained in:
committed by
Mat Sutcliffe
parent
8d84dcbe08
commit
6111c428e9
@@ -12,6 +12,7 @@
|
|||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
|
|
||||||
|
using namespace BlackMisc;
|
||||||
using namespace BlackCore::Afv::Clients;
|
using namespace BlackCore::Afv::Clients;
|
||||||
using namespace BlackCore::Afv::Model;
|
using namespace BlackCore::Afv::Model;
|
||||||
|
|
||||||
@@ -20,7 +21,7 @@ int main(int argc, char *argv[])
|
|||||||
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||||
QGuiApplication qa(argc, argv);
|
QGuiApplication qa(argc, argv);
|
||||||
|
|
||||||
BlackCore::CApplication a("sampleafvclient", BlackMisc::CApplicationInfo::Sample);
|
BlackCore::CApplication a("sampleafvclient", CApplicationInfo::Sample);
|
||||||
|
|
||||||
CAfvMapReader *afvMapReader = new CAfvMapReader(&a);
|
CAfvMapReader *afvMapReader = new CAfvMapReader(&a);
|
||||||
afvMapReader->updateFromMap();
|
afvMapReader->updateFromMap();
|
||||||
|
|||||||
@@ -286,53 +286,6 @@ namespace BlackCore
|
|||||||
void CContextAudio::setVoiceTransmission(bool enable, PTTCOM com)
|
void CContextAudio::setVoiceTransmission(bool enable, PTTCOM com)
|
||||||
{
|
{
|
||||||
m_voiceClient.setPttForCom(enable, com);
|
m_voiceClient.setPttForCom(enable, com);
|
||||||
|
|
||||||
/**
|
|
||||||
|
|
||||||
// first apporach of T609 multiple COM
|
|
||||||
QSharedPointer<IVoiceChannel> voiceChannelCom = nullptr;
|
|
||||||
CComSystem::ComUnit usedUnit = CComSystem::Com1;
|
|
||||||
|
|
||||||
if (com == COM1 && m_voiceChannelMapping.contains(CComSystem::Com1)) { usedUnit = CComSystem::Com1; voiceChannelCom = m_voiceChannelMapping.value(usedUnit); }
|
|
||||||
else if (com == COM2 && m_voiceChannelMapping.contains(CComSystem::Com2)) { usedUnit = CComSystem::Com2; voiceChannelCom = m_voiceChannelMapping.value(usedUnit); }
|
|
||||||
else if (com == COMActive && m_voiceChannelMapping.contains(CComSystem::Com1)) { usedUnit = CComSystem::Com1; voiceChannelCom = m_voiceChannelMapping.value(usedUnit); }
|
|
||||||
else if (com == COMActive && m_voiceChannelMapping.contains(CComSystem::Com2)) { usedUnit = CComSystem::Com2; voiceChannelCom = m_voiceChannelMapping.value(usedUnit); }
|
|
||||||
if (!voiceChannelCom) { return; }
|
|
||||||
IAudioMixer::OutputPort mixerOutputPort = m_voiceChannelOutputPortMapping.value(voiceChannelCom);
|
|
||||||
|
|
||||||
// use values from simulator?
|
|
||||||
if (enable && this->isComIntegratedWithSimulator())
|
|
||||||
{
|
|
||||||
const CComSystem comSystem = this->getOwnComSystem(usedUnit);
|
|
||||||
enable = comSystem.isTransmitEnabled(); // consider muted
|
|
||||||
}
|
|
||||||
|
|
||||||
if (enable)
|
|
||||||
{
|
|
||||||
m_audioMixer->makeMixerConnection(IAudioMixer::InputMicrophone, mixerOutputPort);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_audioMixer->removeMixerConnection(IAudioMixer::InputMicrophone, mixerOutputPort);
|
|
||||||
}
|
|
||||||
|
|
||||||
**/
|
|
||||||
|
|
||||||
/** fixme KB 201908 to be removed if the above works
|
|
||||||
if (!m_voiceChannelMapping.contains(CComSystem::Com1)) { return; }
|
|
||||||
QSharedPointer<IVoiceChannel> voiceChannelCom1 = m_voiceChannelMapping.value(CComSystem::Com1);
|
|
||||||
IAudioMixer::OutputPort mixerOutputPort = m_voiceChannelOutputPortMapping.value(voiceChannelCom1);
|
|
||||||
if (enable)
|
|
||||||
{
|
|
||||||
m_audioMixer->makeMixerConnection(IAudioMixer::InputMicrophone, mixerOutputPort);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Remove for both output ports, just in case.
|
|
||||||
m_audioMixer->removeMixerConnection(IAudioMixer::InputMicrophone, IAudioMixer::OutputVoiceChannel1);
|
|
||||||
m_audioMixer->removeMixerConnection(IAudioMixer::InputMicrophone, IAudioMixer::OutputVoiceChannel2);
|
|
||||||
}
|
|
||||||
**/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CContextAudio::setVoiceTransmissionCom1(bool enabled)
|
void CContextAudio::setVoiceTransmissionCom1(bool enabled)
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ namespace BlackSound
|
|||||||
m_pushTimer = new QTimer(this);
|
m_pushTimer = new QTimer(this);
|
||||||
bool ok = connect(m_pushTimer, &QTimer::timeout, this, &CSoundGenerator::pushTimerExpired);
|
bool ok = connect(m_pushTimer, &QTimer::timeout, this, &CSoundGenerator::pushTimerExpired);
|
||||||
Q_ASSERT(ok);
|
Q_ASSERT(ok);
|
||||||
Q_UNUSED(ok); // suppress Clang warning in release build
|
Q_UNUSED(ok) // suppress Clang warning in release build
|
||||||
m_pushTimer->start(20);
|
m_pushTimer->start(20);
|
||||||
}
|
}
|
||||||
m_pushModeIODevice = m_audioOutput->start(); // push, IO device not owned
|
m_pushModeIODevice = m_audioOutput->start(); // push, IO device not owned
|
||||||
@@ -345,8 +345,8 @@ namespace BlackSound
|
|||||||
|
|
||||||
qint64 CSoundGenerator::writeData(const char *data, qint64 len)
|
qint64 CSoundGenerator::writeData(const char *data, qint64 len)
|
||||||
{
|
{
|
||||||
Q_UNUSED(data);
|
Q_UNUSED(data)
|
||||||
Q_UNUSED(len);
|
Q_UNUSED(len)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -454,7 +454,7 @@ namespace BlackSound
|
|||||||
void CSoundGenerator::playFile(int volume, const QString &file, bool removeFileAfterPlaying)
|
void CSoundGenerator::playFile(int volume, const QString &file, bool removeFileAfterPlaying)
|
||||||
{
|
{
|
||||||
if (!QFile::exists(file)) { return; }
|
if (!QFile::exists(file)) { return; }
|
||||||
Q_UNUSED(volume);
|
Q_UNUSED(volume)
|
||||||
QSound::play(file);
|
QSound::play(file);
|
||||||
// I cannot delete the file here, only after it has been played
|
// I cannot delete the file here, only after it has been played
|
||||||
if (removeFileAfterPlaying) { new CTimedFileDeleter(file, 1000 * 60, QCoreApplication::instance()); }
|
if (removeFileAfterPlaying) { new CTimedFileDeleter(file, 1000 * 60, QCoreApplication::instance()); }
|
||||||
|
|||||||
Reference in New Issue
Block a user