2016-04-08 12:14:50 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
2016-04-21 21:53:16 -04:00
|
|
|
// Copyright (C) 2016 F4EXB //
|
2016-04-08 12:14:50 -04:00
|
|
|
// written by Edouard Griffiths //
|
|
|
|
// //
|
|
|
|
// This program is free software; you can redistribute it and/or modify //
|
|
|
|
// it under the terms of the GNU General Public License as published by //
|
|
|
|
// the Free Software Foundation as version 3 of the License, or //
|
2019-04-11 00:39:30 -04:00
|
|
|
// (at your option) any later version. //
|
2016-04-08 12:14:50 -04:00
|
|
|
// //
|
|
|
|
// This program is distributed in the hope that it will be useful, //
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
|
|
|
// GNU General Public License V3 for more details. //
|
|
|
|
// //
|
|
|
|
// You should have received a copy of the GNU General Public License //
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2016-10-02 07:18:07 -04:00
|
|
|
#ifndef PLUGINS_CHANNELRX_DEMODDSD_DSDDECODER_H_
|
|
|
|
#define PLUGINS_CHANNELRX_DEMODDSD_DSDDECODER_H_
|
2016-04-08 12:14:50 -04:00
|
|
|
|
2019-04-15 04:40:09 -04:00
|
|
|
#include "dsdcc/dsd_decoder.h"
|
2016-04-08 12:14:50 -04:00
|
|
|
|
2016-04-09 07:12:48 -04:00
|
|
|
class AudioFifo;
|
|
|
|
|
2016-04-08 12:14:50 -04:00
|
|
|
class DSDDecoder
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
DSDDecoder();
|
|
|
|
~DSDDecoder();
|
|
|
|
|
2016-04-10 20:48:12 -04:00
|
|
|
void pushSample(short sample) { m_decoder.run(sample); }
|
2016-08-19 13:30:32 -04:00
|
|
|
short getFilteredSample() const { return m_decoder.getFilteredSample(); }
|
2016-08-24 12:35:12 -04:00
|
|
|
short getSymbolSyncSample() const { return m_decoder.getSymbolSyncSample(); }
|
2016-09-03 19:06:10 -04:00
|
|
|
|
2016-08-31 08:11:11 -04:00
|
|
|
short *getAudio1(int& nbSamples) { return m_decoder.getAudio1(nbSamples); }
|
|
|
|
void resetAudio1() { m_decoder.resetAudio1(); }
|
2016-09-03 19:06:10 -04:00
|
|
|
short *getAudio2(int& nbSamples) { return m_decoder.getAudio2(nbSamples); }
|
|
|
|
void resetAudio2() { m_decoder.resetAudio2(); }
|
|
|
|
|
2016-05-09 03:24:28 -04:00
|
|
|
void enableMbelib(bool enable) { m_decoder.enableMbelib(enable); }
|
2016-04-08 12:14:50 -04:00
|
|
|
|
2016-08-31 10:15:53 -04:00
|
|
|
bool mbeDVReady1() const { return m_decoder.mbeDVReady1(); }
|
|
|
|
void resetMbeDV1() { m_decoder.resetMbeDV1(); }
|
2016-09-03 19:06:10 -04:00
|
|
|
bool mbeDVReady2() const { return m_decoder.mbeDVReady2(); }
|
|
|
|
void resetMbeDV2() { m_decoder.resetMbeDV2(); }
|
2016-08-31 10:15:53 -04:00
|
|
|
const unsigned char *getMbeDVFrame1() const { return m_decoder.getMbeDVFrame1(); }
|
2016-09-03 19:06:10 -04:00
|
|
|
const unsigned char *getMbeDVFrame2() const { return m_decoder.getMbeDVFrame2(); }
|
2016-09-03 20:10:52 -04:00
|
|
|
bool getVoice1On() const { return m_decoder.getVoice1On(); }
|
|
|
|
bool getVoice2On() const { return m_decoder.getVoice2On(); }
|
2016-09-06 18:16:08 -04:00
|
|
|
void setTDMAStereo(bool tdmaStereo) { m_decoder.setTDMAStereo(tdmaStereo); }
|
2017-05-05 18:29:58 -04:00
|
|
|
bool getSymbolPLLLocked() const { return m_decoder.getSymbolPLLLocked(); }
|
2016-09-03 19:06:10 -04:00
|
|
|
|
2016-05-08 00:00:37 -04:00
|
|
|
int getMbeRateIndex() const { return (int) m_decoder.getMbeRate(); }
|
|
|
|
|
2016-04-21 21:53:16 -04:00
|
|
|
int getInLevel() const { return m_decoder.getInLevel(); }
|
2016-08-17 20:47:49 -04:00
|
|
|
int getCarrierPos() const { return m_decoder.getCarrierPos(); }
|
|
|
|
int getZeroCrossingPos() const { return m_decoder.getZeroCrossingPos(); }
|
2016-08-18 07:35:11 -04:00
|
|
|
int getSymbolSyncQuality() const { return m_decoder.getSymbolSyncQuality(); }
|
2016-04-23 00:27:28 -04:00
|
|
|
int getSamplesPerSymbol() const { return m_decoder.getSamplesPerSymbol(); }
|
2016-08-18 13:38:39 -04:00
|
|
|
void enableCosineFiltering(bool on) { m_decoder.enableCosineFiltering(on); }
|
2016-04-23 00:27:28 -04:00
|
|
|
DSDcc::DSDDecoder::DSDSyncType getSyncType() const { return m_decoder.getSyncType(); }
|
|
|
|
DSDcc::DSDDecoder::DSDStationType getStationType() const { return m_decoder.getStationType(); }
|
2016-04-21 21:53:16 -04:00
|
|
|
const char *getFrameTypeText() const { return m_decoder.getFrameTypeText(); }
|
2017-01-12 20:16:28 -05:00
|
|
|
const DSDcc::DSDDMR& getDMRDecoder() const { return m_decoder.getDMRDecoder(); }
|
2016-04-23 00:27:28 -04:00
|
|
|
const DSDcc::DSDDstar& getDStarDecoder() const { return m_decoder.getDStarDecoder(); }
|
2016-08-07 19:04:56 -04:00
|
|
|
const DSDcc::DSDdPMR& getDPMRDecoder() const { return m_decoder.getDPMRDecoder(); }
|
2016-09-20 13:35:51 -04:00
|
|
|
const DSDcc::DSDYSF& getYSFDecoder() const { return m_decoder.getYSFDecoder(); }
|
2018-06-20 03:15:17 -04:00
|
|
|
const DSDcc::DSDNXDN& getNXDNDecoder() const { return m_decoder.getNXDNDecoder(); }
|
2016-04-21 21:53:16 -04:00
|
|
|
|
2016-09-28 11:58:29 -04:00
|
|
|
void setMyPoint(float lat, float lon) { m_decoder.setMyPoint(lat, lon); }
|
2016-04-21 21:53:16 -04:00
|
|
|
void setAudioGain(float gain) { m_decoder.setAudioGain(gain); }
|
2016-08-06 05:03:05 -04:00
|
|
|
void setBaudRate(int baudRate);
|
2017-05-07 04:23:37 -04:00
|
|
|
void setSymbolPLLLock(bool pllLock) { m_decoder.setSymbolPLLLock(pllLock); }
|
2017-12-26 14:29:23 -05:00
|
|
|
void useHPMbelib(bool useHP) { m_decoder.useHPMbelib(useHP); }
|
2018-03-28 02:43:11 -04:00
|
|
|
void set48k(bool to48k);
|
2018-04-22 19:04:47 -04:00
|
|
|
void setUpsampling(int upsampling);
|
2016-04-21 21:53:16 -04:00
|
|
|
|
2016-04-08 12:14:50 -04:00
|
|
|
private:
|
2016-04-20 20:13:57 -04:00
|
|
|
DSDcc::DSDDecoder m_decoder;
|
2016-04-08 12:14:50 -04:00
|
|
|
};
|
|
|
|
|
2016-10-02 07:18:07 -04:00
|
|
|
#endif /* PLUGINS_CHANNELRX_DEMODDSD_DSDDECODER_H_ */
|