2014-10-30 22:51:33 -04:00
|
|
|
#pragma once
|
|
|
|
|
2015-01-09 17:17:56 -05:00
|
|
|
#define CUBICSDR_VERSION "v0.01a"
|
2015-01-10 20:33:30 -05:00
|
|
|
#define CUBICSDR_TITLE "CubicSDR " CUBICSDR_VERSION " by Charles J. Cliffe (@ccliffe)"
|
|
|
|
|
|
|
|
const char filePathSeparator =
|
|
|
|
#ifdef _WIN32
|
|
|
|
'\\';
|
|
|
|
#else
|
|
|
|
'/';
|
|
|
|
#endif
|
2015-01-09 17:17:56 -05:00
|
|
|
|
2014-12-16 21:58:35 -05:00
|
|
|
#ifdef __APPLE__
|
2014-12-18 20:11:25 -05:00
|
|
|
#define BUF_SIZE (16384*2)
|
2015-01-11 17:08:16 -05:00
|
|
|
#define DEFAULT_SAMPLE_RATE 2000000
|
2014-12-16 21:58:35 -05:00
|
|
|
#else
|
2014-12-31 19:45:01 -05:00
|
|
|
#define BUF_SIZE (16384*5)
|
2015-01-11 17:08:16 -05:00
|
|
|
#define DEFAULT_SAMPLE_RATE 2500000
|
2014-12-16 21:58:35 -05:00
|
|
|
#endif
|
2014-12-28 05:13:46 -05:00
|
|
|
#define DEFAULT_FFT_SIZE 2048
|
2014-10-30 22:51:33 -04:00
|
|
|
|
2015-01-10 12:27:03 -05:00
|
|
|
#define DEFAULT_FREQ 100000000
|
2014-12-16 20:33:44 -05:00
|
|
|
#define AUDIO_FREQUENCY 44100
|
2014-12-24 00:11:41 -05:00
|
|
|
|
|
|
|
#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;
|
|
|
|
};
|