TDME2 1.9.121
AudioBufferManager_AudioBufferManaged.h
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4
5#include <tdme/tdme.h>
7
8using std::string;
9
11
12/**
13 * Managed audio buffer entity
14 * @author Andreas Drewke
15 */
17{
18 friend class AudioBufferManager;
19 friend class Sound;
20
21private:
23 string id;
24 int32_t alId;
26
27 /**
28 * Protected constructor
29 * @param audioBufferManager audio buffer manager
30 * @param id id
31 * @param alId Open AL id
32 */
34
35 /**
36 * @return audio buffer id
37 */
38 inline const string& getId() {
39 return id;
40 }
41
42 /**
43 * @return Open AL id
44 */
45 inline int32_t getAlId() {
46 return alId;
47 }
48
49 /**
50 * Set up Open AL audio buffer id
51 * @param alId al Id
52 */
53 inline void setAlId(int32_t alId) {
54 this->alId = alId;
55 }
56
57 /**
58 * @return reference counter
59 */
60 inline int32_t getReferenceCounter() {
61 return referenceCounter;
62 }
63
64 /**
65 * decrement reference counter
66 * @return if reference counter = 0
67 */
70 return referenceCounter == 0;
71 }
72
73 /**
74 * increment reference counter
75 */
78 }
79
80};
AudioBufferManager_AudioBufferManaged(AudioBufferManager *audioBufferManager, const string &id, int32_t alId)
Protected constructor.
void setAlId(int32_t alId)
Set up Open AL audio buffer id.
Sound audio entity implementation.
Definition: Sound.h:20