mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-09 05:28:09 +08:00
@@ -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<uint>(notification), true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "blackcore/context_runtime.h"
|
||||
#include "blackcore/context_all_interfaces.h"
|
||||
#include "blackmisc/notificationsounds.h"
|
||||
#include <QTimer>
|
||||
|
||||
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;
|
||||
|
||||
@@ -216,7 +216,7 @@ namespace BlackGui
|
||||
|
||||
// sound
|
||||
if (this->getIContextAudio())
|
||||
this->getIContextAudio()->playNotification(BlackSound::CNotificationSounds::NotificationTextMessage);
|
||||
this->getIContextAudio()->playNotification(BlackSound::CNotificationSounds::NotificationTextMessagePrivate, true);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -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
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user