2016-04-08 18:14:50 +02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								///////////////////////////////////////////////////////////////////////////////////
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-22 03:53:16 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								// Copyright (C) 2016 F4EXB                                                      //
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-08 18:14:50 +02: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                  //
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								//                                                                               //
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								// 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 13:18:07 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#ifndef PLUGINS_CHANNELRX_DEMODDSD_DSDDECODER_H_
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#define PLUGINS_CHANNELRX_DEMODDSD_DSDDECODER_H_
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-08 18:14:50 +02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-11 00:20:55 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#include "dsd_decoder.h"
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-08 18:14:50 +02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-09 13:12:48 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								class AudioFifo;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-08 18:14:50 +02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								class DSDDecoder
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								{
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								public:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    DSDDecoder();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    ~DSDDecoder();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-11 02:48:12 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    void pushSample(short sample) { m_decoder.run(sample); }
							 | 
						
					
						
							
								
									
										
										
										
											2016-08-19 19:30:32 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    short getFilteredSample() const { return m_decoder.getFilteredSample(); }
							 | 
						
					
						
							
								
									
										
										
										
											2016-08-24 18:35:12 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    short getSymbolSyncSample() const { return m_decoder.getSymbolSyncSample(); }
							 | 
						
					
						
							
								
									
										
										
										
											2016-09-04 01:06:10 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2016-08-31 14:11:11 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    short *getAudio1(int& nbSamples) { return m_decoder.getAudio1(nbSamples); }
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    void resetAudio1() { m_decoder.resetAudio1(); }
							 | 
						
					
						
							
								
									
										
										
										
											2016-09-04 01:06:10 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    short *getAudio2(int& nbSamples) { return m_decoder.getAudio2(nbSamples); }
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    void resetAudio2() { m_decoder.resetAudio2(); }
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2016-05-09 09:24:28 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    void enableMbelib(bool enable) { m_decoder.enableMbelib(enable); }
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-08 18:14:50 +02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2016-08-31 16:15:53 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    bool mbeDVReady1() const { return m_decoder.mbeDVReady1(); }
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    void resetMbeDV1() { m_decoder.resetMbeDV1(); }
							 | 
						
					
						
							
								
									
										
										
										
											2016-09-04 01:06:10 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    bool mbeDVReady2() const { return m_decoder.mbeDVReady2(); }
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    void resetMbeDV2() { m_decoder.resetMbeDV2(); }
							 | 
						
					
						
							
								
									
										
										
										
											2016-08-31 16:15:53 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    const unsigned char *getMbeDVFrame1() const { return m_decoder.getMbeDVFrame1(); }
							 | 
						
					
						
							
								
									
										
										
										
											2016-09-04 01:06:10 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    const unsigned char *getMbeDVFrame2() const { return m_decoder.getMbeDVFrame2(); }
							 | 
						
					
						
							
								
									
										
										
										
											2016-09-04 02:10:52 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    bool getVoice1On() const { return m_decoder.getVoice1On(); }
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    bool getVoice2On() const { return m_decoder.getVoice2On(); }
							 | 
						
					
						
							
								
									
										
										
										
											2016-09-07 00:16:08 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    void setTDMAStereo(bool tdmaStereo) { m_decoder.setTDMAStereo(tdmaStereo); }
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-06 00:29:58 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    bool getSymbolPLLLocked() const { return m_decoder.getSymbolPLLLocked(); }
							 | 
						
					
						
							
								
									
										
										
										
											2016-09-04 01:06:10 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2016-05-08 06:00:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    int getMbeRateIndex() const { return (int) m_decoder.getMbeRate(); }
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-22 03:53:16 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    int getInLevel() const { return m_decoder.getInLevel(); }
							 | 
						
					
						
							
								
									
										
										
										
											2016-08-18 02:47:49 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    int getCarrierPos() const { return m_decoder.getCarrierPos(); }
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    int getZeroCrossingPos() const { return m_decoder.getZeroCrossingPos(); }
							 | 
						
					
						
							
								
									
										
										
										
											2016-08-18 13:35:11 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    int getSymbolSyncQuality() const { return m_decoder.getSymbolSyncQuality(); }
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-23 06:27:28 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    int getSamplesPerSymbol() const { return m_decoder.getSamplesPerSymbol(); }
							 | 
						
					
						
							
								
									
										
										
										
											2016-08-18 19:38:39 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    void enableCosineFiltering(bool on) { m_decoder.enableCosineFiltering(on); }
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-23 06:27:28 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    DSDcc::DSDDecoder::DSDSyncType getSyncType() const { return m_decoder.getSyncType(); }
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    DSDcc::DSDDecoder::DSDStationType getStationType() const { return m_decoder.getStationType(); }
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-22 03:53:16 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    const char *getFrameTypeText() const { return m_decoder.getFrameTypeText(); }
							 | 
						
					
						
							
								
									
										
										
										
											2017-01-13 02:16:28 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    const DSDcc::DSDDMR& getDMRDecoder() const { return m_decoder.getDMRDecoder(); }
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-23 06:27:28 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    const DSDcc::DSDDstar& getDStarDecoder() const { return m_decoder.getDStarDecoder(); }
							 | 
						
					
						
							
								
									
										
										
										
											2016-08-08 01:04:56 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    const DSDcc::DSDdPMR& getDPMRDecoder() const { return m_decoder.getDPMRDecoder(); }
							 | 
						
					
						
							
								
									
										
										
										
											2016-09-20 19:35:51 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    const DSDcc::DSDYSF& getYSFDecoder() const { return m_decoder.getYSFDecoder(); }
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-22 03:53:16 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2016-09-28 17:58:29 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    void setMyPoint(float lat, float lon) { m_decoder.setMyPoint(lat, lon); }
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-22 03:53:16 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    void setAudioGain(float gain) { m_decoder.setAudioGain(gain); }
							 | 
						
					
						
							
								
									
										
										
										
											2016-08-06 11:03:05 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    void setBaudRate(int baudRate);
							 | 
						
					
						
							
								
									
										
										
										
											2017-05-07 10:23:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    void setSymbolPLLLock(bool pllLock) { m_decoder.setSymbolPLLLock(pllLock); }
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-22 03:53:16 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-08 18:14:50 +02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								private:
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-21 02:13:57 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    DSDcc::DSDDecoder m_decoder;
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-08 18:14:50 +02:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								};
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2016-10-02 13:18:07 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#endif /* PLUGINS_CHANNELRX_DEMODDSD_DSDDECODER_H_ */
							 |