/*
 * extb plugin to VDR (C++)
 *
 * (C) 2004 - 2006 Andreas Brachold <vdr04-at-deltab-dot-de>
 *
 * This code 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; either version 2
 * of the License, or (at your option) any later version.
 *
 * This code 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 for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
 */

#ifndef ___SETUP_EXTB_H___
#define ___SETUP_EXTB_H___

#define memberof(x) (sizeof(x)/sizeof(*x))
#define LED_CNT 14
#define OUT_CNT 4

struct cIOFeature
{
  /// A OR-linked Group with any possible State to activate LED
  int nState[4];
  /// Use Result reversed
  int nReverse;
  
  cIOFeature();
  cIOFeature& operator = (const cIOFeature& x);
};

struct cLEDFeature
  : public cIOFeature
{
    /// A OR-linked Group with any possible State to flash LED
  int nFlash[4];
  /// Use Result reversed
  int nFlashReverse;
  /// Flashing has higher priority and is important than normal Light
  int nFlashImportant;

  cLEDFeature();
  cLEDFeature& operator = (const cLEDFeature& x);
};

struct cExtbSetup 
{
  int          m_bHideMainMenuEntry;
  int   	     m_nMuteMode;
  cLEDFeature  m_ioLEDMode[LED_CNT];
  cIOFeature   m_ioOutputMode[OUT_CNT];
  char         m_szStartUp[64]; 
  char         m_szShutDown[64]; 


  enum eMuteModes
  {
  eMuteModes_Analog = 0,
  eMuteModes_Digital,
  eMuteModes_AnalogDigital,
  eMuteModes_Unsed,
  // the follow value is use only to determine array size
  eMuteModes_Cnt
  };

  enum eIOModes
  {
  // Don't use the LED or Output channel
  eIOModes_Unused = 0,
  // Instant on or off
  eIOModes_Off,
  eIOModes_AlwaysOn,
  // Recording state
  eIOModes_AnyRecording,
  eIOModes_RecordingOnCard1,
  eIOModes_RecordingOnCard2,
  eIOModes_RecordingOnCard3,
  eIOModes_RecordingOnCard4,
  // Replay state
  eIOModes_AnyReplay,
  eIOModes_ReplayVDR,
  eIOModes_ReplayDVD,
  eIOModes_ReplayMP3,
  //Channelfeature
  eIOModes_ChannelHasCA,
  eIOModes_ChannelHasDpid,
  eIOModes_ChannelHasApid,
  eIOModes_ChannelHasTpid,
  eIOModes_ChannelHasVpid, 
  eIOModes_ChannelIsRadio, //if channel has no vpid
  // Audio state
  eIOModes_AudioMute,
  eIOModes_MoreAudioTracks,
  // DVD Plugin Playbackmodes
  eIOModes_DVD_AC3,
  eIOModes_DVD_DTS,
  eIOModes_DVD_PCM,
  eIOModes_DVD_MP2,
  eIOModes_DVD_4_3,
  eIOModes_DVD_16_9,
  // MP3 Plugin Playbackmodes
  eIOModes_MP3_Shuffle,
  eIOModes_MP3_Loop,    
  
  eIOModes_ChannelSourceSat,
  eIOModes_ChannelSourceCable,
  eIOModes_ChannelSourceTerr,
  eIOModes_ChannelSatVPolar,
  eIOModes_ChannelSatHPolar,

  eIOModes_AllCardsRecording,
  // Cutting
  eIOModes_Cutting,
  // OSD
  eIOModes_OsdActive,
  eIOModes_OsdInActive,
  eIOModes_OsdMessage,
  eIOModes_OsdHelpKeyRed,
  eIOModes_OsdHelpKeyGreen,
  eIOModes_OsdHelpKeyYellow,
  eIOModes_OsdHelpKeyBlue,
  // the follow value is use only to determine array size
  eIOModes_Cnt
  };

  
  static const char * m_szMuteModes[eMuteModes_Cnt];
  static const char * m_szIOModes[eIOModes_Cnt];
  
  cExtbSetup(void);
  cExtbSetup(const cExtbSetup& x);
  cExtbSetup& operator = (const cExtbSetup& x);
  
  /// Parse our own setup parameters and store their values.
  bool SetupParse(const char *szName, const char *szValue);
  
  void LoadTranslatedStings(void);
  

  
};

/// The exported one and only Stored setup data
extern cExtbSetup theSetup;

#endif  //___SETUP_EXTB_H___
