mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-25 18:25:42 +08:00
refs #220, improved voice room handling by providing join/left flag and connection handling
This commit is contained in:
@@ -55,7 +55,8 @@ namespace BlackCore
|
||||
void audioTestCompleted();
|
||||
|
||||
//! Voice rooms changed
|
||||
void changedVoiceRooms(const BlackMisc::Audio::CVoiceRoomList &voiceRooms);
|
||||
//! \details the flag indicates, whether a room got connected or disconnected
|
||||
void changedVoiceRooms(const BlackMisc::Audio::CVoiceRoomList &voiceRooms, bool connected);
|
||||
|
||||
public slots:
|
||||
//! Get voice rooms for COM1, COM2:
|
||||
|
||||
@@ -372,12 +372,24 @@ namespace BlackCore
|
||||
switch (newStatus)
|
||||
{
|
||||
case IVoice::Connected:
|
||||
emit this->changedVoiceRooms(this->m_voice->getComVoiceRooms());
|
||||
emit this->changedVoiceRooms(this->m_voice->getComVoiceRooms(), true);
|
||||
break;
|
||||
case IVoice::Disconnecting:
|
||||
emit this->changedVoiceRooms(this->m_voice->getComVoiceRooms());
|
||||
break;
|
||||
case IVoice::Connecting:
|
||||
break;
|
||||
case IVoice::ConnectingFailed:
|
||||
case IVoice::DisconnectedError:
|
||||
{
|
||||
const QString e = QString("Voice room %1 error").arg(comUnit);
|
||||
qWarning(e.toUtf8().constData());
|
||||
|
||||
// no break here!
|
||||
}
|
||||
case IVoice::Disconnected:
|
||||
// good chance to update aircraft
|
||||
if (this->getIContextOwnAircraft()) m_voice->setMyAircraftCallsign(this->getIContextOwnAircraft()->getOwnAircraft().getCallsign());
|
||||
emit this->changedVoiceRooms(this->m_voice->getComVoiceRooms(), false);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace BlackCore
|
||||
"audioTestCompleted", this, SIGNAL(audioTestCompleted()));
|
||||
Q_ASSERT(s);
|
||||
s = connection.connect(serviceName, IContextAudio::ObjectPath(), IContextAudio::InterfaceName(),
|
||||
"changedVoiceRooms", this, SIGNAL(changedVoiceRooms(BlackMisc::Audio::CVoiceRoomList)));
|
||||
"changedVoiceRooms", this, SIGNAL(changedVoiceRooms(BlackMisc::Audio::CVoiceRoomList, bool)));
|
||||
Q_ASSERT(s);
|
||||
Q_UNUSED(s);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user