CubicSDR/src/demod/DemodDefs.h

69 lines
1.7 KiB
C
Raw Normal View History

// Copyright (c) Charles J. Cliffe
// SPDX-License-Identifier: GPL-2.0+
2014-12-11 19:07:21 -05:00
#pragma once
#include "ThreadBlockingQueue.h"
#include "CubicSDRDefs.h"
#include "liquid/liquid.h"
#include <vector>
#include <atomic>
#include <mutex>
#include <memory>
2015-07-29 18:34:58 -04:00
#include "IOThread.h"
2015-01-01 18:08:54 -05:00
2014-12-11 19:07:21 -05:00
class DemodulatorThread;
class DemodulatorThreadIQData {
2014-12-11 19:07:21 -05:00
public:
long long frequency;
2015-01-11 17:08:16 -05:00
long long sampleRate;
2014-12-26 16:15:35 -05:00
std::vector<liquid_float_complex> data;
2014-12-11 19:07:21 -05:00
2014-12-24 01:28:33 -05:00
DemodulatorThreadIQData() :
2015-01-11 17:08:16 -05:00
frequency(0), sampleRate(0) {
2014-12-11 19:07:21 -05:00
2014-12-24 01:28:33 -05:00
}
2014-12-11 19:07:21 -05:00
2015-09-09 23:46:23 -04:00
DemodulatorThreadIQData & operator=(const DemodulatorThreadIQData &other) {
frequency = other.frequency;
sampleRate = other.sampleRate;
data.assign(other.data.begin(), other.data.end());
return *this;
}
virtual ~DemodulatorThreadIQData() = default;
2014-12-11 19:07:21 -05:00
};
2015-11-17 19:32:47 -05:00
class Modem;
class ModemKit;
class DemodulatorThreadPostIQData {
public:
2014-12-24 01:28:33 -05:00
std::vector<liquid_float_complex> data;
2015-01-11 17:08:16 -05:00
long long sampleRate;
std::string modemName;
std::string modemType;
2015-11-17 19:32:47 -05:00
Modem *modem;
ModemKit *modemKit;
2014-12-24 01:28:33 -05:00
DemodulatorThreadPostIQData() :
2015-11-17 19:32:47 -05:00
sampleRate(0), modem(nullptr), modemKit(nullptr) {
2014-12-24 01:28:33 -05:00
}
virtual ~DemodulatorThreadPostIQData() = default;
};
typedef std::shared_ptr<DemodulatorThreadIQData> DemodulatorThreadIQDataPtr;
typedef std::shared_ptr<DemodulatorThreadPostIQData> DemodulatorThreadPostIQDataPtr;
2014-12-11 19:07:21 -05:00
typedef ThreadBlockingQueue<DemodulatorThreadIQDataPtr> DemodulatorThreadInputQueue;
typedef ThreadBlockingQueue<DemodulatorThreadPostIQDataPtr> DemodulatorThreadPostInputQueue;
typedef std::shared_ptr<DemodulatorThreadInputQueue> DemodulatorThreadInputQueuePtr;
typedef std::shared_ptr<DemodulatorThreadPostInputQueue> DemodulatorThreadPostInputQueuePtr;