diff --git a/src/blackgui/runtimebasedcomponent.cpp b/src/blackgui/runtimebasedcomponent.cpp index 187e143a5..17b3cd94a 100644 --- a/src/blackgui/runtimebasedcomponent.cpp +++ b/src/blackgui/runtimebasedcomponent.cpp @@ -114,4 +114,9 @@ namespace BlackGui return this->m_runtime->getIContextSimulator(); } + void CRuntimeBasedComponent::playNotifcationSound(BlackSound::CNotificationSounds::Notification notification) const + { + if (!this->getIContextAudio()) return; + this->getIContextAudio()->playNotification(static_cast(notification), true); + } } diff --git a/src/blackgui/runtimebasedcomponent.h b/src/blackgui/runtimebasedcomponent.h index 57de0ba1e..6bacf61e8 100644 --- a/src/blackgui/runtimebasedcomponent.h +++ b/src/blackgui/runtimebasedcomponent.h @@ -3,6 +3,7 @@ #include "blackcore/context_runtime.h" #include "blackcore/context_all_interfaces.h" +#include "blackmisc/notificationsounds.h" #include namespace BlackGui @@ -94,6 +95,9 @@ namespace BlackGui //! \copydoc CRuntime::canPingApplicationContext bool canPingApplicationContext() const { return this->m_runtime->canPingApplicationContext(); } + //! Play a given notification sound + void playNotifcationSound(BlackSound::CNotificationSounds::Notification notification) const; + private: BlackCore::CRuntime *m_runtime; bool m_runtimeOwner; diff --git a/src/blackgui/textmessagecomponent.cpp b/src/blackgui/textmessagecomponent.cpp index 363f2d90b..f3ce087ad 100644 --- a/src/blackgui/textmessagecomponent.cpp +++ b/src/blackgui/textmessagecomponent.cpp @@ -216,7 +216,7 @@ namespace BlackGui // sound if (this->getIContextAudio()) - this->getIContextAudio()->playNotification(BlackSound::CNotificationSounds::NotificationTextMessage); + this->getIContextAudio()->playNotification(BlackSound::CNotificationSounds::NotificationTextMessagePrivate, true); } /* diff --git a/src/blackmisc/notificationsounds.h b/src/blackmisc/notificationsounds.h index 342e4b870..ad04a7ce0 100644 --- a/src/blackmisc/notificationsounds.h +++ b/src/blackmisc/notificationsounds.h @@ -24,7 +24,10 @@ namespace BlackSound NotificationError = 0, NotificationLogin, NotificationLogoff, - NotificationTextMessage, + NotificationTextMessagePrivate, + NotificationVoiceRoomJoined, + NotificationVoiceRoomLeft, + NotificationsLoadSounds //!< end marker and force loading of sounds, keep as last element }; }; }