refs #258, notification sounds

* added to RuntimeBasedComponent
This commit is contained in:
Klaus Basan
2014-06-05 02:36:38 +02:00
parent 1b804ca8d7
commit aac967a4a6
4 changed files with 14 additions and 2 deletions

View File

@@ -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);
}
}

View File

@@ -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;

View File

@@ -216,7 +216,7 @@ namespace BlackGui
// sound
if (this->getIContextAudio())
this->getIContextAudio()->playNotification(BlackSound::CNotificationSounds::NotificationTextMessage);
this->getIContextAudio()->playNotification(BlackSound::CNotificationSounds::NotificationTextMessagePrivate, true);
}
/*

View File

@@ -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
};
};
}