forked from rpbpolis/spic-prj-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AudioSource.hpp
51 lines (41 loc) · 1.13 KB
/
AudioSource.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef AUDIOSOURCE_H_
#define AUDIOSOURCE_H_
#include "Component.hpp"
#include <string>
namespace spic {
/**
* @brief Component which can play audio.
*/
class AudioSource : public Component {
public:
/**
* @brief Call this method to start playing audio.
* @param looping Automatically start over when done.
* @spicapi
*/
void Play(bool looping);
/**
* @brief Call this method to stop playing audio.
* @spicapi
*/
void Stop();
private:
/**
* @brief Path to a locally stored audio file.
*/
std::string audioClip;
/**
* @brief When true, the component will start playing automatically.
*/
bool playOnAwake;
/**
* @brief When true, the audio will play indefinitely.
*/
bool loop;
/**
* @brief Audio volume, between 0.0 and 1.0.
*/
double volume;
};
}
#endif // AUDIOSOURCE_H_