#ifndef MENU_H
#define MENU_H
#include "diseqc.h"
#include "filter.h"
#include <vdr/plugin.h>

class config {
public:
  int ActualSource;
  int fd_frontend;
  int DvbCard;
  int AByte;
  int repeat;
  int Lat;
  int Long;
  int SN;
  int EW;
  int UseGotoX;
  int card[4];
  int ShowInfo;
  config() {ActualSource=0; DvbCard=0; AByte=49; repeat=false; Lat=0; Long=0; SN=false; EW=true; UseGotoX=false; card[0]=1; card[1]=1; card[2]=1; card[3]=1;  ShowInfo=false;};
};

class cMenuSetupRotor : public cMenuSetupPage {
private:
  int newDvbCard;
  void Setup(void);
protected:
  virtual void Store(void);
public:
  cMenuSetupRotor(void);
  virtual eOSState ProcessKey(eKeys Key);
};

class cSubMenuSetupRotor : public cMenuSetupPage {
protected:
  virtual void Store(void) {};
public:
  cSubMenuSetupRotor(void);
};

class cMainMenuRotor : public cOsdMenu, public cThread {
private:
  int oldupdate,Position,Nr,Frequenz,Symbolrate,edw;
  char Pol;
  cChannel *OldChannel;
  bool m_Active,HasSwitched,assign;
  char SS[700];
  char SNR[700];
  bool Signal(int Frequenz, char Pol, int Symbolrate);
  cFont::tPixelData CharData[256*35];
protected:
  virtual void Action(void);
public:
  cMainMenuRotor(void);
  ~cMainMenuRotor();
  virtual eOSState ProcessKey(eKeys Key);
};

class PatFilter;
class SdtFilter;

class cMenuScan : public cOsdMenu {
private:
  int num;
  cChannel Channel[64];
  PatFilter *PFilter;
  SdtFilter *SFilter;
  cOsdItem* n[64];
public:
  cMenuScan();
  ~cMenuScan();
  virtual eOSState ProcessKey(eKeys Key);
  void AddChannel(int Num);
  void NewChannel(const cChannel *Transponder, const char *Name, const char *ShortName, const char *Provider, int Nid, int Tid, int Sid);
  void SetPids(int Sid,int Vpid, int Ppid, int *Apids, char ALangs[][4], int *Dpids, char DLangs[][4], int Tpid);
  void SetCaIds(int Sid,const int *CaIds);
  void SetCaDescriptors(int Sid,int Level);
  cChannel* GetChannel(int Sid);
  void display(int num);
};

extern config data;

#endif
