aboutsummaryrefslogtreecommitdiffstats
path: root/core/device.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/device.cpp')
-rw-r--r--core/device.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/core/device.cpp b/core/device.cpp
new file mode 100644
index 00000000..2766c5e4
--- /dev/null
+++ b/core/device.cpp
@@ -0,0 +1,23 @@
+
+#include "config.h"
+
+#include "bformatdec.h"
+#include "bs2b.h"
+#include "device.h"
+#include "front_stablizer.h"
+#include "hrtf.h"
+#include "mastering.h"
+
+
+al::FlexArray<ContextBase*> DeviceBase::sEmptyContextArray{0u};
+
+
+DeviceBase::DeviceBase(DeviceType type) : Type{type}, mContexts{&sEmptyContextArray}
+{
+}
+
+DeviceBase::~DeviceBase()
+{
+ auto *oldarray = mContexts.exchange(nullptr, std::memory_order_relaxed);
+ if(oldarray != &sEmptyContextArray) delete oldarray;
+}