diff --git a/src/blackcore/context_audio_impl.cpp b/src/blackcore/context_audio_impl.cpp index 2d05f06b2..c651d860a 100644 --- a/src/blackcore/context_audio_impl.cpp +++ b/src/blackcore/context_audio_impl.cpp @@ -46,8 +46,8 @@ namespace BlackCore connect(this->m_voice, &CVoiceVatlib::connectionStatusChanged, this, &CContextAudio::connectionStatusChanged); if (this->getIContextApplication()) this->connect(this->m_voice, &IVoice::statusMessage, this->getIContextApplication(), &IContextApplication::sendStatusMessage); - // 5. load sounds (init) - CSoundGenerator::playNotificationSound(0, CNotificationSounds::NotificationsLoadSounds); + // 5. load sounds (init), not possible in own thread + QTimer::singleShot(10 * 1000, this, SLOT(initNotificationSounds())); } /* @@ -297,6 +297,15 @@ namespace BlackCore BlackSound::CSoundGenerator::playNotificationSound(90, notificationSound); } + /* + * Notification + */ + void CContextAudio::initNotificationSounds() + { + // not possible in own thread + CSoundGenerator::playNotificationSound(0, CNotificationSounds::NotificationsLoadSounds); + } + /* * Mic test. */ diff --git a/src/blackcore/context_audio_impl.h b/src/blackcore/context_audio_impl.h index 7547de191..05f517d50 100644 --- a/src/blackcore/context_audio_impl.h +++ b/src/blackcore/context_audio_impl.h @@ -118,6 +118,9 @@ namespace BlackCore //! \sa IContextAudio::changedVoiceRooms void connectionStatusChanged(IVoice::ComUnit comUnit, IVoice::ConnectionStatus oldStatus, IVoice::ConnectionStatus newStatus); + //! Init notification sounds + void initNotificationSounds(); + private: //! Connection in transition bool inTransitionState() const; diff --git a/src/blackcore/voice_vatlib.cpp b/src/blackcore/voice_vatlib.cpp index 4609724f6..d3d70b923 100644 --- a/src/blackcore/voice_vatlib.cpp +++ b/src/blackcore/voice_vatlib.cpp @@ -42,12 +42,6 @@ namespace BlackCore m_voice->GetInputDevices(onInputHardwareDeviceReceived, 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); this->m_voiceRooms.push_back(CVoiceRoom()); // COM1 diff --git a/src/blackcore/voice_vatlib.h b/src/blackcore/voice_vatlib.h index 6ce9b5739..e7987678a 100644 --- a/src/blackcore/voice_vatlib.h +++ b/src/blackcore/voice_vatlib.h @@ -221,7 +221,7 @@ namespace BlackCore */ static inline void cleanup(Cvatlib_Voice_Simple *pointer) { - pointer->Destroy(); + if (pointer) pointer->Destroy(); } };