Aether3D Game Engine
AudioSourceComponent.hpp
1 #ifndef AUDIO_SOURCE_COMPONENT
2 #define AUDIO_SOURCE_COMPONENT
3 
4 #include <string>
5 
6 namespace ae3d
7 {
10  {
11  public:
13  class GameObject* GetGameObject() const { return gameObject; }
14 
16  bool Is3D() const { return is3D; }
17 
19  void SetClipId( unsigned audioClipId );
20 
22  void Set3D( bool enable ) { is3D = enable; }
23 
25  void Play() const;
26 
28  std::string GetSerialized() const;
29 
30  private:
31  friend class GameObject;
32 
34  static int Type() { return 3; }
35 
37  static unsigned New();
38 
40  static AudioSourceComponent* Get( unsigned index );
41 
42  GameObject* gameObject = nullptr;
43  unsigned clipId = 0;
44  bool is3D = false;
45  };
46 }
47 
48 #endif
Definition: AudioClip.hpp:4
void Play() const
Plays the clip.
std::string GetSerialized() const
class GameObject * GetGameObject() const
Definition: AudioSourceComponent.hpp:13
void Set3D(bool enable)
Definition: AudioSourceComponent.hpp:22
GameObject is composed of components that define its behavior.
Definition: GameObject.hpp:9
Contains an audio clip and methods to play it.
Definition: AudioSourceComponent.hpp:9
void SetClipId(unsigned audioClipId)
bool Is3D() const
Definition: AudioSourceComponent.hpp:16