refs #220, improved voice room handling by providing join/left flag and connection handling

This commit is contained in:
Klaus Basan
2014-06-05 13:21:08 +02:00
parent 58e97b6958
commit 6344923725
5 changed files with 37 additions and 30 deletions

View File

@@ -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:

View File

@@ -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;

View File

@@ -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);
}