aboutsummaryrefslogtreecommitdiffstats
path: root/core/device.cpp
blob: 2766c5e4ea7ed5e40d03a30cd311bcbbf884b1aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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;
}