-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSound.hpp
61 lines (53 loc) · 1.53 KB
/
Sound.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
52
53
54
55
56
57
58
59
60
61
//
// Created by Pierre Bougon on 30/03/17.
//
#ifndef SOUND_HPP_
#define SOUND_HPP_
namespace arcade
{
///
/// \enum SoundMode
/// \brief Used to control the way sound is played
///
enum SoundAction
{
UNIQUE, /// Sound played once
REPEAT, /// Sound played indefinitly (common for musics)
VOLUME, // Update the volume
PLAY, // Play a sound
PAUSE, /// Pause a sound
RESUME, /// Resume a sound
STOP /// Stop completly a sound
};
///
/// \enum SoundType
/// \brief Used to differenciate the sound type
///
/// It might be very usefull with some sound libraries which need to know
/// this type of differences
///
enum SoundType
{
MUSIC, /// The sound is a music
SOUND /// The sound is an normal sound
};
///
/// \struct SoundMode
/// \brief Contain informations on the sound to play and the way of playing it
///
struct Sound
{
///
/// \fn Sound(unsigned int id, SoundMode mode = UNIQUE, SoundType type = SOUND, float volume = 50.0f);
/// \brief Constructor of a sound
/// \param id Id du son à controller
/// \param mode Mode du son
/// \param type Type de son
/// \param volume Volume du son
Sound(unsigned int id, SoundAction mode = UNIQUE, float volume = 50.0f);
unsigned int id; /// Id of the sound
SoundAction mode; /// Mode of the sound (control)
float volume; /// Volume
};
}
#endif // !SOUND_HPP_