-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathComponentAudioSource.h
More file actions
71 lines (48 loc) · 1.44 KB
/
ComponentAudioSource.h
File metadata and controls
71 lines (48 loc) · 1.44 KB
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
62
63
64
65
66
67
68
69
70
71
#ifndef __COMPONENTAUDIOSOURCE_H__
#define __COMPONENTAUDIOSOURCE_H__
#include "Component.h"
#include <string>
#include <vector>
class Primitive;
class ResourceFileAudio;
class AudioEvent;
class ComponentCar;
class ComponentAudioSource : public Component
{
public:
ComponentAudioSource(ComponentType type, GameObject* game_object);
~ComponentAudioSource();
void Update();
void OnInspector(bool debug);
void Save(Data& file) const;
void Load(Data& conf);
void Remove();
void OnPlay();
void OnStop();
long unsigned GetWiseID() const;
void PlayAudio(unsigned id_audio);
private:
bool play_event_pending = false;
unsigned play_event_pending_index = 0;
void PlayEvent(unsigned index) const;
void StopEvent(unsigned index) const;
void StopAllEvents() const;
std::vector<AudioEvent*> list_of_events;
AudioEvent *empty_event = nullptr;
unsigned int wwise_id_go;
float scale_factor_attenuation = 1.0f;
Primitive *attenuation_sphere = nullptr;
void UpdateEventSelected(unsigned int pos, AudioEvent *new_event);
void CreateAttenuationShpere(const AudioEvent *event);
void DeleteAttenuationShpere();
void UpdateAttenuationSpherePos();
void ModifyAttenuationFactor();
void RemoveAllEvents();
// Inspector options
void ShowAddRemoveButtons();
void ShowListOfEvents();
void ShowPlayStopButtons(unsigned index);
// RTCP related values. Uniquely, with car
ComponentCar *car_linked = nullptr;
};
#endif // !__COMPONENTAUDIOSOURCE_H__