2017-02-01 19:54:22 +01:00
|
|
|
#
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2010, 2011, 2012
|
|
|
|
* Jan van Katwijk (J.vanKatwijk@gmail.com)
|
|
|
|
* Lazy Chair Programming
|
|
|
|
*
|
2017-05-19 15:20:19 +02:00
|
|
|
* This file is part of the DAB library
|
2017-02-01 19:54:22 +01:00
|
|
|
*
|
2017-05-19 15:20:19 +02:00
|
|
|
* DAB library is free software; you can redistribute it and/or modify
|
2017-02-01 19:54:22 +01:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
2017-05-19 15:20:19 +02:00
|
|
|
* DAB library is distributed in the hope that it will be useful,
|
2017-02-01 19:54:22 +01:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2017-05-19 15:20:19 +02:00
|
|
|
* along with DAB library; if not, write to the Free Software
|
2017-02-01 19:54:22 +01:00
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*
|
|
|
|
* We have to create a simple virtual class here, since we
|
|
|
|
* want the interface with different devices (including filehandling)
|
|
|
|
* to be transparent
|
|
|
|
*/
|
2017-05-19 15:20:19 +02:00
|
|
|
#ifndef __DEVICE_HANDLER__
|
|
|
|
#define __DEVICE_HANDLER__
|
2017-02-01 19:54:22 +01:00
|
|
|
|
|
|
|
#include <stdint.h>
|
2017-05-19 15:20:19 +02:00
|
|
|
#include <complex>
|
2017-08-02 13:13:21 +02:00
|
|
|
#include <thread>
|
2017-05-19 15:20:19 +02:00
|
|
|
using namespace std;
|
2017-02-01 19:54:22 +01:00
|
|
|
|
2017-05-19 15:20:19 +02:00
|
|
|
class deviceHandler {
|
2017-02-01 19:54:22 +01:00
|
|
|
public:
|
2017-05-19 15:20:19 +02:00
|
|
|
deviceHandler (void);
|
|
|
|
virtual ~deviceHandler (void);
|
2017-02-01 19:54:22 +01:00
|
|
|
virtual int32_t defaultFrequency (void);
|
2019-01-06 15:47:31 +01:00
|
|
|
virtual bool restartReader (int32_t);
|
2017-02-01 19:54:22 +01:00
|
|
|
virtual void stopReader (void);
|
2017-05-19 15:20:19 +02:00
|
|
|
virtual int32_t getSamples (std::complex<float> *, int32_t);
|
2017-02-01 19:54:22 +01:00
|
|
|
virtual int32_t Samples (void);
|
|
|
|
virtual void resetBuffer (void);
|
|
|
|
virtual int16_t bitDepth (void) { return 10;}
|
|
|
|
virtual void setGain (int32_t);
|
2017-05-19 15:20:19 +02:00
|
|
|
virtual bool has_autogain (void);
|
|
|
|
virtual void set_autogain (bool);
|
2018-10-29 19:21:55 +01:00
|
|
|
//
|
|
|
|
// for the sdrplay
|
|
|
|
virtual void set_ifgainReduction (int);
|
|
|
|
virtual void set_lnaState (int);
|
2017-02-01 19:54:22 +01:00
|
|
|
//
|
|
|
|
protected:
|
|
|
|
int32_t lastFrequency;
|
|
|
|
int32_t vfoOffset;
|
|
|
|
int theGain;
|
2017-08-02 13:13:21 +02:00
|
|
|
virtual void run (void);
|
2017-02-01 19:54:22 +01:00
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|