TDME2  1.9.200
AudioBufferManager_AudioBufferManaged.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 
5 #include <tdme/tdme.h>
6 #include <tdme/audio/fwd-tdme.h>
7 
8 using 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 
21 private:
23  string id;
24  uint32_t alId { 0 };
25  int32_t referenceCounter { 0 };
26 
27  // forbid class copy
29 
30  /**
31  * Protected constructor
32  * @param audioBufferManager audio buffer manager
33  * @param id id
34  * @param alId OpenAL buffer id
35  */
38  id(id),
39  alId(alId) {
40  //
41  }
42 
43  /**
44  * @return audio buffer id
45  */
46  inline const string& getId() {
47  return id;
48  }
49 
50  /**
51  * @return OpenAL buffer id
52  */
53  inline uint32_t getAlId() {
54  return alId;
55  }
56 
57  /**
58  * Set up OpenAL audio buffer id
59  * @param alId OpenAL buffer id
60  */
61  inline void setAlId(uint32_t alId) {
62  this->alId = alId;
63  }
64 
65  /**
66  * @return reference counter
67  */
68  inline int32_t getReferenceCounter() {
69  return referenceCounter;
70  }
71 
72  /**
73  * decrement reference counter
74  * @return if reference counter = 0
75  */
76  inline bool decrementReferenceCounter() {
78  return referenceCounter == 0;
79  }
80 
81  /**
82  * increment reference counter
83  */
84  inline void incrementReferenceCounter() {
86  }
87 
88 };
void setAlId(uint32_t alId)
Set up OpenAL audio buffer id.
Sound audio entity implementation.
Definition: Sound.h:19
#define FORBID_CLASS_COPY(CLASS)
Definition: tdme.h:6