#ifndef __EXTB_SETUP_MENU_H__
#define __EXTB_SETUP_MENU_H__

#include "extboardio.h"
#include <vdr/plugin.h>


class cExtBMenuSetup
  : public cMenuSetupPage
{
  /// Link to IO Access
  cExtBoardIO*    m_pExt;
  /// Make modifications on tempoary data
  cExtbSetup m_tempSetup;
  /// Which Source is used during boot
  int m_nVideoSourceOnBoot,m_nOldVideoSourceOnBoot;
  enum { eF_BOOT_VGA=0,   eF_BOOT_AUX,    eF_BOOT_OFF };
  /// Which Mode is used for Scart Pin 8
  int m_nScartPin8Mode,m_nOldScartPin8Mode;
  enum { eF_SC8_PWR=0,    eF_SC8_VDR,     eF_SC8_OFF  };
  struct ScartBootMode {
      int nScartPin8Mode;     //0 = Power On, 1=VDR On, 2 = Off
      int nVideoSourceOnBoot; //0 = VGA, 1 = AUX, 2 = Off
    } static const ScartBootModes[];
  
  /// Which Videomode is used for the source
  enum { eRGB=0, eSVID  };
  struct VideoMode {
    int nDVB; //0 = RGB, 1=S-Video
    int nVGA; //0 = RGB, 1=S-Video
    int nAUX; //0 = RGB, 1=S-Video
  } static const VideoModes[];
  int m_nVideoModeDVB,m_nOldVideoModeDVB;
  int m_nVideoModeVGA,m_nOldVideoModeVGA;
  int m_nVideoModeAUX,m_nOldVideoModeAUX;

  char *m_szVideoModesDVB[2];
  char *m_szVideoModesAUX[2];
  char *m_szVideoModesVGA[2];
  char *m_szScartPin8Mode[3];
  char *m_szVideoSourceOnBoot[3];

  int m_nWaitForInit;
  bool m_bShouldInitMenu;
protected:
  virtual void Store(void);
  virtual eOSState ProcessKey(eKeys Key);
public:
  cExtBMenuSetup(cExtBoardIO*    pExt);
  virtual ~cExtBMenuSetup(void);
};

#endif
