mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-09 21:45:34 +08:00
Preparation for 2 COM keys and increase/decrease volume hotkeys
Ref T672, Ref T642
This commit is contained in:
@@ -290,6 +290,8 @@ namespace BlackCore
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO << volume; }
|
||||
|
||||
bool wasMuted = isMuted();
|
||||
volume = qMin(CSettings::MaxAudioVolume, volume);
|
||||
|
||||
bool changedVoiceOutput = m_voiceOutputDevice->getOutputVolume() != volume;
|
||||
if (changedVoiceOutput)
|
||||
{
|
||||
@@ -588,9 +590,11 @@ namespace BlackCore
|
||||
return false;
|
||||
}
|
||||
|
||||
void CContextAudio::setVoiceTransmission(bool enable)
|
||||
void CContextAudio::setVoiceTransmission(bool enable, COM com)
|
||||
{
|
||||
// FIXME: Use the 'active' channel instead of hardcoded COM1
|
||||
// FIXME: Use com
|
||||
Q_UNUSED(com);
|
||||
if (!m_voiceChannelMapping.contains(CComSystem::Com1)) { return; }
|
||||
QSharedPointer<IVoiceChannel> voiceChannelCom1 = m_voiceChannelMapping.value(CComSystem::Com1);
|
||||
IAudioMixer::OutputPort mixerOutputPort = m_voiceChannelOutputPortMapping.value(voiceChannelCom1);
|
||||
@@ -606,6 +610,21 @@ namespace BlackCore
|
||||
}
|
||||
}
|
||||
|
||||
void CContextAudio::setVoiceTransmissionCom1(bool enabled)
|
||||
{
|
||||
this->setVoiceTransmission(enabled, COM1);
|
||||
}
|
||||
|
||||
void CContextAudio::setVoiceTransmissionCom2(bool enabled)
|
||||
{
|
||||
this->setVoiceTransmission(enabled, COM2);
|
||||
}
|
||||
|
||||
void CContextAudio::setVoiceTransmissionComActive(bool enabled)
|
||||
{
|
||||
this->setVoiceTransmission(enabled, COMActive);
|
||||
}
|
||||
|
||||
void CContextAudio::onConnectionStatusChanged(BlackCore::IVoiceChannel::ConnectionStatus oldStatus,
|
||||
BlackCore::IVoiceChannel::ConnectionStatus newStatus)
|
||||
{
|
||||
@@ -677,6 +696,20 @@ namespace BlackCore
|
||||
this->setVoiceOutputVolume(s.getAudioVolume());
|
||||
}
|
||||
|
||||
void CContextAudio::audioIncreaseVolume(bool enabled)
|
||||
{
|
||||
if (!enabled) { return; }
|
||||
const int v = qRound(this->getVoiceOutputVolume() * 1.2);
|
||||
this->setVoiceOutputVolume(v);
|
||||
}
|
||||
|
||||
void CContextAudio::audioDecreaseVolume(bool enabled)
|
||||
{
|
||||
if (!enabled) { return; }
|
||||
const int v = qRound(this->getVoiceOutputVolume() / 1.2);
|
||||
this->setVoiceOutputVolume(v);
|
||||
}
|
||||
|
||||
QSharedPointer<IVoiceChannel> CContextAudio::getVoiceChannelBy(const CVoiceRoom &voiceRoom)
|
||||
{
|
||||
QSharedPointer<IVoiceChannel> voiceChannel;
|
||||
|
||||
Reference in New Issue
Block a user