Small fixes in init voice context, found during "merge testing"

This commit is contained in:
Klaus Basan
2014-06-13 13:47:36 +02:00
parent ce55bf49c7
commit c8bf23bf86
4 changed files with 15 additions and 9 deletions

View File

@@ -46,8 +46,8 @@ namespace BlackCore
connect(this->m_voice, &CVoiceVatlib::connectionStatusChanged, this, &CContextAudio::connectionStatusChanged); connect(this->m_voice, &CVoiceVatlib::connectionStatusChanged, this, &CContextAudio::connectionStatusChanged);
if (this->getIContextApplication()) this->connect(this->m_voice, &IVoice::statusMessage, this->getIContextApplication(), &IContextApplication::sendStatusMessage); if (this->getIContextApplication()) this->connect(this->m_voice, &IVoice::statusMessage, this->getIContextApplication(), &IContextApplication::sendStatusMessage);
// 5. load sounds (init) // 5. load sounds (init), not possible in own thread
CSoundGenerator::playNotificationSound(0, CNotificationSounds::NotificationsLoadSounds); QTimer::singleShot(10 * 1000, this, SLOT(initNotificationSounds()));
} }
/* /*
@@ -297,6 +297,15 @@ namespace BlackCore
BlackSound::CSoundGenerator::playNotificationSound(90, notificationSound); BlackSound::CSoundGenerator::playNotificationSound(90, notificationSound);
} }
/*
* Notification
*/
void CContextAudio::initNotificationSounds()
{
// not possible in own thread
CSoundGenerator::playNotificationSound(0, CNotificationSounds::NotificationsLoadSounds);
}
/* /*
* Mic test. * Mic test.
*/ */

View File

@@ -118,6 +118,9 @@ namespace BlackCore
//! \sa IContextAudio::changedVoiceRooms //! \sa IContextAudio::changedVoiceRooms
void connectionStatusChanged(IVoice::ComUnit comUnit, IVoice::ConnectionStatus oldStatus, IVoice::ConnectionStatus newStatus); void connectionStatusChanged(IVoice::ComUnit comUnit, IVoice::ConnectionStatus oldStatus, IVoice::ConnectionStatus newStatus);
//! Init notification sounds
void initNotificationSounds();
private: private:
//! Connection in transition //! Connection in transition
bool inTransitionState() const; bool inTransitionState() const;

View File

@@ -42,12 +42,6 @@ namespace BlackCore
m_voice->GetInputDevices(onInputHardwareDeviceReceived, this); m_voice->GetInputDevices(onInputHardwareDeviceReceived, this);
m_voice->GetOutputDevices(onOutputHardwareDeviceReceived, this); m_voice->GetOutputDevices(onOutputHardwareDeviceReceived, this);
// TODO: read audio device settings here and init with the same devices
// If not, settings are there or it is the first run, use the default one
// TODO: KB, setting this kind of default device results in an error
// setInputDevice(defaultAudioInputDevice());
// setOutputDevice(defaultAudioOutputDevice());
connect(this, &CVoiceVatlib::userJoinedLeft, this, &CVoiceVatlib::onUserJoinedLeft, Qt::QueuedConnection); connect(this, &CVoiceVatlib::userJoinedLeft, this, &CVoiceVatlib::onUserJoinedLeft, Qt::QueuedConnection);
this->m_voiceRooms.push_back(CVoiceRoom()); // COM1 this->m_voiceRooms.push_back(CVoiceRoom()); // COM1

View File

@@ -221,7 +221,7 @@ namespace BlackCore
*/ */
static inline void cleanup(Cvatlib_Voice_Simple *pointer) static inline void cleanup(Cvatlib_Voice_Simple *pointer)
{ {
pointer->Destroy(); if (pointer) pointer->Destroy();
} }
}; };