mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-18 03:15:34 +08:00
Mute functionality, corrected setting volume
This commit is contained in:
@@ -30,7 +30,6 @@ namespace BlackCore
|
|||||||
*/
|
*/
|
||||||
CContextVoice::~CContextVoice()
|
CContextVoice::~CContextVoice()
|
||||||
{
|
{
|
||||||
Q_ASSERT(this->m_voice);
|
|
||||||
this->leaveAllVoiceRooms();
|
this->leaveAllVoiceRooms();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,7 +88,6 @@ namespace BlackCore
|
|||||||
{
|
{
|
||||||
Q_ASSERT(this->m_voice);
|
Q_ASSERT(this->m_voice);
|
||||||
Q_ASSERT(audioDevice.getType() != CAudioDevice::Unknown);
|
Q_ASSERT(audioDevice.getType() != CAudioDevice::Unknown);
|
||||||
this->log(Q_FUNC_INFO, audioDevice.toQString());
|
|
||||||
if (audioDevice.getType() == CAudioDevice::InputDevice)
|
if (audioDevice.getType() == CAudioDevice::InputDevice)
|
||||||
{
|
{
|
||||||
this->m_voice->setInputDevice(audioDevice);
|
this->m_voice->setInputDevice(audioDevice);
|
||||||
@@ -103,14 +101,24 @@ namespace BlackCore
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set volumnes
|
* Set volumes
|
||||||
*/
|
*/
|
||||||
void CContextVoice::setVolumes(const CComSystem &com1, const CComSystem &com2)
|
void CContextVoice::setVolumes(const CComSystem &com1, const CComSystem &com2)
|
||||||
{
|
{
|
||||||
Q_ASSERT(this->m_voice);
|
Q_ASSERT(this->m_voice);
|
||||||
this->log(Q_FUNC_INFO, com1.toQString(), com2.toQString());
|
this->m_voice->setRoomOutputVolume(IVoice::COM1, com1.getVolumeOutput());
|
||||||
this->m_voice->setRoomOutputVolume(IVoice::COM1, com1.getVolumeInput());
|
this->m_voice->setRoomOutputVolume(IVoice::COM2, com2.getVolumeOutput());
|
||||||
this->m_voice->setRoomOutputVolume(IVoice::COM2, com2.getVolumeInput());
|
this->m_voice->switchAudioOutput(IVoice::COM1, com1.isEnabled());
|
||||||
|
this->m_voice->switchAudioOutput(IVoice::COM2, com2.isEnabled());
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Muted?
|
||||||
|
*/
|
||||||
|
bool CContextVoice::isMuted() const
|
||||||
|
{
|
||||||
|
Q_ASSERT(this->m_voice);
|
||||||
|
return this->m_voice->isMuted();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -163,7 +171,4 @@ namespace BlackCore
|
|||||||
}
|
}
|
||||||
return callsigns;
|
return callsigns;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -130,12 +130,18 @@ namespace BlackCore
|
|||||||
virtual void setCurrentAudioDevice(const BlackMisc::Voice::CAudioDevice &audioDevice);
|
virtual void setCurrentAudioDevice(const BlackMisc::Voice::CAudioDevice &audioDevice);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Set volumes
|
* \brief Set volumes, also allows to mute
|
||||||
* \param com1
|
* \param com1
|
||||||
* \param com2
|
* \param com2
|
||||||
*/
|
*/
|
||||||
virtual void setVolumes(const BlackMisc::Aviation::CComSystem &com1, const BlackMisc::Aviation::CComSystem &com2);
|
virtual void setVolumes(const BlackMisc::Aviation::CComSystem &com1, const BlackMisc::Aviation::CComSystem &com2);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Is muted?
|
||||||
|
* \return
|
||||||
|
*/
|
||||||
|
virtual bool isMuted() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CVoiceVatlib *m_voice;
|
CVoiceVatlib *m_voice;
|
||||||
BlackMisc::Voice::CAudioDevice m_currentInputDevice;
|
BlackMisc::Voice::CAudioDevice m_currentInputDevice;
|
||||||
|
|||||||
Reference in New Issue
Block a user