aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/hrtf.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-04-06 13:00:29 -0700
committerChris Robinson <[email protected]>2017-04-06 13:00:29 -0700
commit338d61f9072bfb811266012c2a9c0a290cf353d1 (patch)
tree0ef0b218db261569105a782824c5bf50ea3a3067 /Alc/hrtf.h
parent94f514ae5a0392f5f01f2b479d1d858af688ae24 (diff)
Reference count HRTFs and unload them when unused
Diffstat (limited to 'Alc/hrtf.h')
-rw-r--r--Alc/hrtf.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/Alc/hrtf.h b/Alc/hrtf.h
index 4e25dde3..3ec3e19e 100644
--- a/Alc/hrtf.h
+++ b/Alc/hrtf.h
@@ -6,6 +6,7 @@
#include "alMain.h"
#include "alstring.h"
+#include "atomic.h"
#define HRTFDELAY_BITS (20)
@@ -21,6 +22,8 @@
struct HrtfEntry;
struct Hrtf {
+ RefCount ref;
+
ALuint sampleRate;
ALsizei irSize;
ALubyte evCount;
@@ -37,6 +40,8 @@ void FreeHrtfs(void);
vector_EnumeratedHrtf EnumerateHrtf(const_al_string devname);
void FreeHrtfList(vector_EnumeratedHrtf *list);
struct Hrtf *GetLoadedHrtf(struct HrtfEntry *entry);
+void Hrtf_IncRef(struct Hrtf *hrtf);
+void Hrtf_DecRef(struct Hrtf *hrtf);
void GetHrtfCoeffs(const struct Hrtf *Hrtf, ALfloat elevation, ALfloat azimuth, ALfloat spread, ALfloat (*coeffs)[2], ALsizei *delays);