mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +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 <QThread>
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackCore::Afv::Clients;
|
||||
using namespace BlackCore::Afv::Model;
|
||||
|
||||
@@ -20,7 +21,7 @@ int main(int argc, char *argv[])
|
||||
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||
QGuiApplication qa(argc, argv);
|
||||
|
||||
BlackCore::CApplication a("sampleafvclient", BlackMisc::CApplicationInfo::Sample);
|
||||
BlackCore::CApplication a("sampleafvclient", CApplicationInfo::Sample);
|
||||
|
||||
CAfvMapReader *afvMapReader = new CAfvMapReader(&a);
|
||||
afvMapReader->updateFromMap();
|
||||
|
||||
@@ -286,53 +286,6 @@ namespace BlackCore
|
||||
void CContextAudio::setVoiceTransmission(bool enable, PTTCOM 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)
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace BlackSound
|
||||
m_pushTimer = new QTimer(this);
|
||||
bool ok = connect(m_pushTimer, &QTimer::timeout, this, &CSoundGenerator::pushTimerExpired);
|
||||
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_pushModeIODevice = m_audioOutput->start(); // push, IO device not owned
|
||||
@@ -345,8 +345,8 @@ namespace BlackSound
|
||||
|
||||
qint64 CSoundGenerator::writeData(const char *data, qint64 len)
|
||||
{
|
||||
Q_UNUSED(data);
|
||||
Q_UNUSED(len);
|
||||
Q_UNUSED(data)
|
||||
Q_UNUSED(len)
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -454,7 +454,7 @@ namespace BlackSound
|
||||
void CSoundGenerator::playFile(int volume, const QString &file, bool removeFileAfterPlaying)
|
||||
{
|
||||
if (!QFile::exists(file)) { return; }
|
||||
Q_UNUSED(volume);
|
||||
Q_UNUSED(volume)
|
||||
QSound::play(file);
|
||||
// I cannot delete the file here, only after it has been played
|
||||
if (removeFileAfterPlaying) { new CTimedFileDeleter(file, 1000 * 60, QCoreApplication::instance()); }
|
||||
|
||||
Reference in New Issue
Block a user