API Documentation
Loading...
Searching...
No Matches
SoundManager.h
Go to the documentation of this file.
1#pragma once
2#include "DLLInfo.h"
3#include <NDEVR/SoftwareService.h>
4#include <NDEVR/ApplicationOptions.h>
5#include <NDEVR/Buffer.h>
6#include <NDEVR/String.h>
7#include <NDEVR/TranslatedString.h>
8#ifdef PlaySound
9 #undef PlaySound//somewhere in a windows include?
10#endif
11namespace NDEVR
12{
13 /**--------------------------------------------------------------------------------------------------
14 \brief Contains the definition for a sound resource.
15 **/
21 /**--------------------------------------------------------------------------------------------------
22 \brief Allows the user to make a request for text-to-speech. If the speech cannot be produced, the
23 backup sound is played.
24 **/
30 /**--------------------------------------------------------------------------------------------------
31 \brief Produces sound on the host Device, if possible. Can also create speech from given text.
32 **/
34 {
35 public:
36 virtual bool textToSpeech(const TextToSpeechRequest& s) = 0;
37 virtual bool supportsTextToSpeech() const = 0;
38 virtual void enableTextToSpeech(bool enable) = 0;
40 virtual bool playSound(const String& s) = 0;
41 virtual bool textToSpeechEnabled() const = 0;
42 };
43 /**--------------------------------------------------------------------------------------------------
44 \brief Handles iterating through sound factories until one is able to produce sound given the
45 input sound resource.
46 **/
62}
#define NDEVR_WIDGETS_API
Definition DLLInfo.h:59
The default object to store data of any type that should persist through sessions of the application.
Definition Button.h:57
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
Software Services provide an interface for adding to or changing the software behavior via functional...
Definition SoftwareService.h:9
Software Service Managers take a Software service to modify the behavior of the software.
Definition SoftwareService.h:15
Produces sound on the host Device, if possible. Can also create speech from given text.
Definition SoundManager.h:34
virtual bool supportsTextToSpeech() const =0
virtual Buffer< Sound > availableSounds()=0
virtual bool textToSpeechEnabled() const =0
virtual void enableTextToSpeech(bool enable)=0
virtual bool textToSpeech(const TextToSpeechRequest &s)=0
virtual bool playSound(const String &s)=0
Handles iterating through sound factories until one is able to produce sound given the input sound re...
Definition SoundManager.h:48
static void AddSoundFactory(SoundFactory *factory)
static Buffer< SoundFactory * > s_sound_factories
Definition SoundManager.h:60
static Buffer< Sound > AvailableSounds()
static ApplicationOption< bool > grab_volume_keys
Definition SoundManager.h:58
static ApplicationOption< bool > enable_sound
Definition SoundManager.h:56
static ApplicationOption< bool > enable_text_to_speech
Definition SoundManager.h:57
static bool TextToSpeech(const TextToSpeechRequest &s)
static void EnableTextToSpeech(bool enable)
static bool SupportsTextToSpeech()
static bool PlaySound(const String &s)
The core String class for the NDEVR API.
Definition String.h:69
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
Definition TranslatedString.h:13
Definition ACIColor.h:37
Contains the definition for a sound resource.
Definition SoundManager.h:17
String resource
Definition SoundManager.h:19
TranslatedString title
Definition SoundManager.h:18
Allows the user to make a request for text-to-speech. If the speech cannot be produced,...
Definition SoundManager.h:26
String backup_sound
Definition SoundManager.h:28
String text_to_speech
Definition SoundManager.h:27