/********************************************************************************
 * transponders.h channelscan part to parse transponder lists *.tpls
 * 
 *
 * See REDME for copyright information and
 * how to reach the authors.
 *
 ********************************************************************************/


#ifndef _SCAN_H
#define _SCAN_H


#include <linux/dvb/frontend.h>
#include <string>
#include <vector>
#include <vdr/sources.h>
#include <vdr/sources.h>
#include <vdr/device.h>
#include <vdr/channels.h>
#include "filter.h"
#include "channelscan.h"
#include "transponders.h"

using std::string;
using std::vector;
using std::cerr;
using std::endl;

class SdtFilter;
class PatFilter;

// -- cScan --------------------------------------------------------

class cScan : public cThread {
friend class SdtFilter;
private:
   cScan(const cScan&);
   cScan&operator=(const cScan&);

   int fd_frontend;
   cDevice *device;
   cChannel *channel;
   bool displayVideo; // show Video during scanning
   int sourceCode;    // internal VDR Code for dvb Sources  see vdr/sources.c
   int cardnr;
   int currentTp;
   int totalTp;
   int newChannels;
   SdtFilter *SFilter;
   PatFilter *PFilter;

protected:
    virtual void Action(void);
public:
    cScan();
    ~cScan();
    bool StartScanning();
    bool Signal(int frequency, char pol, int symbolrate);
    int GetCurrentTp() { return currentTp; }
};

#endif //_SCAN__H
