i6engine  1.0
AudioFacade.h
Go to the documentation of this file.
1 /*
2  * i6engine
3  * Copyright (2016) Daniel Bonrath, Michael Baer, All rights reserved.
4  *
5  * This file is part of i6engine; i6engine is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
25 #ifndef __I6ENGINE_API_AUDIOFACADE_H__
26 #define __I6ENGINE_API_AUDIOFACADE_H__
27 
28 #include <atomic>
29 #include <cstdint>
30 #include <functional>
31 
34 
36 
37 namespace i6e {
38 namespace api {
39 
41  public:
42  AudioFacade();
43  ~AudioFacade();
44 
48  void createNode(int64_t comId, const std::string & f, bool l, double m, const Vec3 & p, const Vec3 & d, bool cacheable, const std::string & category);
49 
53  void deleteNode(int64_t comId);
54 
58  void updateListener(const Vec3 & position, const Quaternion & rotation, const Vec3 & velocity);
59 
63  void updatePosition(int64_t comId, const Vec3 & position);
64 
68  audio::SoundHandle playSound(const std::string & f, double m, const Vec3 & p, const Vec3 & d, bool cacheable, const std::string & category);
69 
73  audio::SoundHandle playSoundWithCallback(const std::string & f, double m, const Vec3 & p, const Vec3 & d, bool cacheable, const std::string & category, const std::function<void(bool)> callback);
74 
78  void stopSound(audio::SoundHandle handle);
79 
83  void resetSubSystem();
84 
85  private:
86  std::atomic<audio::SoundHandle> _handleCounter;
87 
91  AudioFacade(const AudioFacade &) = delete;
92 
96  AudioFacade & operator=(const AudioFacade &) = delete;
97  };
98 
99 } /* namespace api */
100 } /* namespace i6e */
101 
102 #endif /* __I6ENGINE_API_AUDIOFACADE_H__ */
103 
uint64_t SoundHandle
Definition: AudioConfig.h:37
Class describing a 3d rotation.
Definition: i6eQuaternion.h:58
#define ISIXE_MODULES_API
Implements 3-dimensional vectors.
Definition: i6eVector.h:48