mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 10:15:38 +08:00
Move Notification sounds into CNotificationPlayer
This commit is contained in:
committed by
Mat Sutcliffe
parent
77a8c46790
commit
d5b3a336dd
@@ -79,9 +79,6 @@ namespace BlackCore
|
||||
m_audioMixer->makeMixerConnection(IAudioMixer::InputVoiceChannel2, IAudioMixer::OutputOutputDevice1);
|
||||
this->setVoiceOutputVolume(90);
|
||||
|
||||
// Load sounds (init), not possible in own thread
|
||||
QTimer::singleShot(10 * 1000, this, &CContextAudio::initNotificationSounds);
|
||||
|
||||
m_unusedVoiceChannels.push_back(m_channel1);
|
||||
m_unusedVoiceChannels.push_back(m_channel2);
|
||||
|
||||
@@ -452,13 +449,7 @@ namespace BlackCore
|
||||
}
|
||||
}
|
||||
|
||||
CSoundGenerator::playNotificationSound(90, notification);
|
||||
}
|
||||
|
||||
void CContextAudio::initNotificationSounds()
|
||||
{
|
||||
// not possible in own thread
|
||||
CSoundGenerator::playNotificationSound(0, CNotificationSounds::LoadSounds);
|
||||
m_notificationPlayer.play(notification, 90);
|
||||
}
|
||||
|
||||
void CContextAudio::enableAudioLoopback(bool enable)
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "blackmisc/settingscache.h"
|
||||
#include "blackmisc/icons.h"
|
||||
#include "blacksound/selcalplayer.h"
|
||||
#include "blacksound/notificationplayer.h"
|
||||
|
||||
#include <QHash>
|
||||
#include <QList>
|
||||
@@ -118,9 +119,6 @@ namespace BlackCore
|
||||
CContextAudio *registerWithDBus(BlackMisc::CDBusServer *server);
|
||||
|
||||
private:
|
||||
//! Init notification sounds
|
||||
void initNotificationSounds();
|
||||
|
||||
//! \copydoc IVoice::connectionStatusChanged
|
||||
//! \sa IContextAudio::changedVoiceRooms
|
||||
void onConnectionStatusChanged(IVoiceChannel::ConnectionStatus oldStatus, IVoiceChannel::ConnectionStatus newStatus);
|
||||
@@ -159,6 +157,7 @@ namespace BlackCore
|
||||
QHash<BlackMisc::Aviation::CComSystem::ComUnit, QSharedPointer<IVoiceChannel>> m_voiceChannelMapping;
|
||||
QHash<QSharedPointer<IVoiceChannel>, IAudioMixer::OutputPort> m_voiceChannelOutputPortMapping;
|
||||
BlackSound::CSelcalPlayer *m_selcalPlayer = nullptr;
|
||||
BlackSound::CNotificationPlayer m_notificationPlayer;
|
||||
|
||||
// settings
|
||||
BlackMisc::CSetting<BlackMisc::Audio::TSettings> m_audioSettings { this };
|
||||
|
||||
Reference in New Issue
Block a user