CubicSDR/src/CubicSDRDefs.h

69 lines
1.3 KiB
C
Raw Normal View History

#pragma once
2015-03-26 20:12:54 -04:00
#define CUBICSDR_TITLE "CubicSDR " CUBICSDR_VERSION " by Charles J. Cliffe (@ccliffe) :: www.cubicsdr.com"
2015-01-10 20:33:30 -05:00
2015-02-05 19:30:06 -05:00
#ifndef __BYTE_ORDER
#ifdef _WIN32
#define ATTRIBUTE
#define __LITTLE_ENDIAN 1234
#define __BIG_ENDIAN 4321
#define __PDP_ENDIAN 3412
#define __BYTE_ORDER __LITTLE_ENDIAN
#else
#ifdef __APPLE__
#include <machine/endian.h>
#else
#include <endian.h>
#endif
#endif
#endif
2015-01-10 20:33:30 -05:00
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__
#define BUF_SIZE (16384*6)
2015-01-11 17:08:16 -05:00
#define DEFAULT_SAMPLE_RATE 2000000
2015-01-18 01:36:28 -05:00
#endif
#ifdef __linux__
#define BUF_SIZE (16384*6)
#define DEFAULT_SAMPLE_RATE 2000000
#endif
#ifndef BUF_SIZE
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
2015-01-18 01:36:28 -05:00
#define DEFAULT_FFT_SIZE 2048
2015-01-10 12:27:03 -05:00
#define DEFAULT_FREQ 100000000
#define DEFAULT_DEMOD_TYPE 1
#define DEFAULT_DEMOD_BW 200000
#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;
};