mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-23 05:45:35 +08:00
Ref T422, private slots -> private
This commit is contained in:
@@ -51,14 +51,15 @@ namespace BlackCore
|
|||||||
IContextAudio(mode, runtime),
|
IContextAudio(mode, runtime),
|
||||||
m_voice(new CVoiceVatlib())
|
m_voice(new CVoiceVatlib())
|
||||||
{
|
{
|
||||||
|
//! \todo KB 2018-11 those are supposed to be Qt::QueuedConnection, but not yet changed (risk to break something)
|
||||||
m_channel1 = m_voice->createVoiceChannel();
|
m_channel1 = m_voice->createVoiceChannel();
|
||||||
connect(m_channel1.data(), &IVoiceChannel::connectionStatusChanged, this, &CContextAudio::ps_connectionStatusChanged);
|
connect(m_channel1.data(), &IVoiceChannel::connectionStatusChanged, this, &CContextAudio::onConnectionStatusChanged);
|
||||||
connect(m_channel1.data(), &IVoiceChannel::userJoinedRoom, this, &CContextAudio::ps_userJoinedRoom);
|
connect(m_channel1.data(), &IVoiceChannel::userJoinedRoom, this, &CContextAudio::onUserJoinedRoom);
|
||||||
connect(m_channel1.data(), &IVoiceChannel::userLeftRoom, this, &CContextAudio::ps_userLeftRoom);
|
connect(m_channel1.data(), &IVoiceChannel::userLeftRoom, this, &CContextAudio::onUserLeftRoom);
|
||||||
m_channel2 = m_voice->createVoiceChannel();
|
m_channel2 = m_voice->createVoiceChannel();
|
||||||
connect(m_channel2.data(), &IVoiceChannel::connectionStatusChanged, this, &CContextAudio::ps_connectionStatusChanged);
|
connect(m_channel2.data(), &IVoiceChannel::connectionStatusChanged, this, &CContextAudio::onConnectionStatusChanged);
|
||||||
connect(m_channel2.data(), &IVoiceChannel::userJoinedRoom, this, &CContextAudio::ps_userJoinedRoom);
|
connect(m_channel2.data(), &IVoiceChannel::userJoinedRoom, this, &CContextAudio::onUserJoinedRoom);
|
||||||
connect(m_channel2.data(), &IVoiceChannel::userLeftRoom, this, &CContextAudio::ps_userLeftRoom);
|
connect(m_channel2.data(), &IVoiceChannel::userLeftRoom, this, &CContextAudio::onUserLeftRoom);
|
||||||
|
|
||||||
m_voiceInputDevice = m_voice->createInputDevice();
|
m_voiceInputDevice = m_voice->createInputDevice();
|
||||||
m_voiceOutputDevice = m_voice->createOutputDevice();
|
m_voiceOutputDevice = m_voice->createOutputDevice();
|
||||||
@@ -77,7 +78,7 @@ namespace BlackCore
|
|||||||
this->setVoiceOutputVolume(90);
|
this->setVoiceOutputVolume(90);
|
||||||
|
|
||||||
// Load sounds (init), not possible in own thread
|
// Load sounds (init), not possible in own thread
|
||||||
QTimer::singleShot(10 * 1000, this, &CContextAudio::ps_initNotificationSounds);
|
QTimer::singleShot(10 * 1000, this, &CContextAudio::initNotificationSounds);
|
||||||
|
|
||||||
m_unusedVoiceChannels.push_back(m_channel1);
|
m_unusedVoiceChannels.push_back(m_channel1);
|
||||||
m_unusedVoiceChannels.push_back(m_channel2);
|
m_unusedVoiceChannels.push_back(m_channel2);
|
||||||
@@ -441,7 +442,7 @@ namespace BlackCore
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CContextAudio::ps_initNotificationSounds()
|
void CContextAudio::initNotificationSounds()
|
||||||
{
|
{
|
||||||
// not possible in own thread
|
// not possible in own thread
|
||||||
CSoundGenerator::playNotificationSound(0, CNotificationSounds::NotificationsLoadSounds);
|
CSoundGenerator::playNotificationSound(0, CNotificationSounds::NotificationsLoadSounds);
|
||||||
@@ -515,7 +516,7 @@ namespace BlackCore
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CContextAudio::ps_setVoiceTransmission(bool enable)
|
void CContextAudio::setVoiceTransmission(bool enable)
|
||||||
{
|
{
|
||||||
// FIXME: Use the 'active' channel instead of hardcoded COM1
|
// FIXME: Use the 'active' channel instead of hardcoded COM1
|
||||||
if (!m_voiceChannelMapping.contains(BlackMisc::Aviation::CComSystem::Com1)) { return; }
|
if (!m_voiceChannelMapping.contains(BlackMisc::Aviation::CComSystem::Com1)) { return; }
|
||||||
@@ -533,7 +534,7 @@ namespace BlackCore
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CContextAudio::ps_connectionStatusChanged(BlackCore::IVoiceChannel::ConnectionStatus oldStatus,
|
void CContextAudio::onConnectionStatusChanged(BlackCore::IVoiceChannel::ConnectionStatus oldStatus,
|
||||||
BlackCore::IVoiceChannel::ConnectionStatus newStatus)
|
BlackCore::IVoiceChannel::ConnectionStatus newStatus)
|
||||||
{
|
{
|
||||||
Q_UNUSED(oldStatus);
|
Q_UNUSED(oldStatus);
|
||||||
@@ -559,12 +560,12 @@ namespace BlackCore
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CContextAudio::ps_userJoinedRoom(const CCallsign & /**callsign**/)
|
void CContextAudio::onUserJoinedRoom(const CCallsign & /**callsign**/)
|
||||||
{
|
{
|
||||||
emit this->changedVoiceRoomMembers();
|
emit this->changedVoiceRoomMembers();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CContextAudio::ps_userLeftRoom(const CCallsign & /**callsign**/)
|
void CContextAudio::onUserLeftRoom(const CCallsign & /**callsign**/)
|
||||||
{
|
{
|
||||||
emit this->changedVoiceRoomMembers();
|
emit this->changedVoiceRoomMembers();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -115,24 +115,23 @@ namespace BlackCore
|
|||||||
//! Register myself in DBus
|
//! Register myself in DBus
|
||||||
CContextAudio *registerWithDBus(BlackMisc::CDBusServer *server);
|
CContextAudio *registerWithDBus(BlackMisc::CDBusServer *server);
|
||||||
|
|
||||||
private slots:
|
private:
|
||||||
|
//! Init notification sounds
|
||||||
|
void initNotificationSounds();
|
||||||
|
|
||||||
//! \copydoc IVoice::connectionStatusChanged
|
//! \copydoc IVoice::connectionStatusChanged
|
||||||
//! \sa IContextAudio::changedVoiceRooms
|
//! \sa IContextAudio::changedVoiceRooms
|
||||||
void ps_connectionStatusChanged(IVoiceChannel::ConnectionStatus oldStatus, IVoiceChannel::ConnectionStatus newStatus);
|
void onConnectionStatusChanged(IVoiceChannel::ConnectionStatus oldStatus, IVoiceChannel::ConnectionStatus newStatus);
|
||||||
|
|
||||||
//! Init notification sounds
|
|
||||||
void ps_initNotificationSounds();
|
|
||||||
|
|
||||||
//! Enable/disable voice transmission
|
//! Enable/disable voice transmission
|
||||||
void ps_setVoiceTransmission(bool enable);
|
void setVoiceTransmission(bool enable);
|
||||||
|
|
||||||
//! User joined the room
|
//! User joined the room
|
||||||
void ps_userJoinedRoom(const BlackMisc::Aviation::CCallsign &callsign);
|
void onUserJoinedRoom(const BlackMisc::Aviation::CCallsign &callsign);
|
||||||
|
|
||||||
//! User left the room
|
//! User left the room
|
||||||
void ps_userLeftRoom(const BlackMisc::Aviation::CCallsign &callsign);
|
void onUserLeftRoom(const BlackMisc::Aviation::CCallsign &callsign);
|
||||||
|
|
||||||
private:
|
|
||||||
//! Connection in transition
|
//! Connection in transition
|
||||||
bool inTransitionState() const;
|
bool inTransitionState() const;
|
||||||
|
|
||||||
@@ -141,7 +140,7 @@ namespace BlackCore
|
|||||||
//! Voice channel by room
|
//! Voice channel by room
|
||||||
QSharedPointer<IVoiceChannel> getVoiceChannelBy(const BlackMisc::Audio::CVoiceRoom &voiceRoom);
|
QSharedPointer<IVoiceChannel> getVoiceChannelBy(const BlackMisc::Audio::CVoiceRoom &voiceRoom);
|
||||||
|
|
||||||
CActionBind m_actionPtt { pttHotkeyAction(), pttHotkeyIcon(), this, &CContextAudio::ps_setVoiceTransmission };
|
CActionBind m_actionPtt { pttHotkeyAction(), pttHotkeyIcon(), this, &CContextAudio::setVoiceTransmission };
|
||||||
|
|
||||||
std::unique_ptr<IVoice> m_voice; //!< underlying voice lib
|
std::unique_ptr<IVoice> m_voice; //!< underlying voice lib
|
||||||
std::unique_ptr<IAudioMixer> m_audioMixer;
|
std::unique_ptr<IAudioMixer> m_audioMixer;
|
||||||
|
|||||||
Reference in New Issue
Block a user