mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2026-01-16 18:45:38 -05:00
37 lines
617 B
C++
37 lines
617 B
C++
#pragma once
|
|
|
|
#ifdef __APPLE__
|
|
#define BUF_SIZE (16384*2)
|
|
#define SRATE 2000000
|
|
#else
|
|
#define BUF_SIZE (16384*5)
|
|
#define SRATE 2500000
|
|
#endif
|
|
#define DEFAULT_FFT_SIZE 2048
|
|
|
|
//#define DEFAULT_FREQ 98900000
|
|
#define DEFAULT_FREQ 132000000
|
|
#define AUDIO_FREQUENCY 44100
|
|
|
|
#include <mutex>
|
|
#include <atomic>
|
|
|
|
class ReferenceCounter {
|
|
public:
|
|
mutable std::mutex m_mutex;
|
|
|
|
void setRefCount(int rc) {
|
|
refCount.store(rc);
|
|
}
|
|
|
|
void decRefCount() {
|
|
refCount.store(refCount.load()-1);
|
|
}
|
|
|
|
int getRefCount() {
|
|
return refCount.load();
|
|
}
|
|
protected:
|
|
std::atomic<int> refCount;
|
|
};
|