/*
 * xms.c: A plugin for the Video Disk Recorder
 *
 * See the README file for copyright information and how to reach the author.
 *
 * $Id$
 */
#include <vdr/plugin.h>
#include <vdr/tools.h>
#include "i18n.h"
#include "config.h"
#include "menu.h"
#include "tools.h"

static const char *VERSION        = "0.0.1";
static const char *DESCRIPTION    = "xtended media selection";
static const char *MAINMENUENTRY  = "XMS";
int xmsLogLevel = 3;


class cPluginXms : public cPlugin {
public:
  cPluginXms(void);
  virtual ~cPluginXms();
  virtual const char *Version(void) { return VERSION; }
  virtual const char *Description(void) { return tr(DESCRIPTION); }
  virtual const char *CommandLineHelp(void);
  virtual bool ProcessArgs(int argc, char *argv[]);
  virtual bool Initialize(void);
  virtual bool Start(void);
  virtual void Stop(void);
  virtual void Housekeeping(void);
  virtual const char *MainMenuEntry(void) { return MAINMENUENTRY; }
  virtual cOsdObject *MainMenuAction(void);
  virtual cMenuSetupPage *SetupMenu(void);
  virtual bool SetupParse(const char *Name, const char *Value);
  };

cPluginXms::cPluginXms(void)
{_
}

cPluginXms::~cPluginXms()
{_
  SLDEBUG("# destructor of cPluginXms");
}

const char *cPluginXms::CommandLineHelp(void)
{_
  return NULL;
}

bool cPluginXms::ProcessArgs(int argc, char *argv[])
{_
  return true;
}

bool cPluginXms::Initialize(void)
{_
  RegisterI18n(Phrases);	
  return true;
}

bool cPluginXms::Start(void)
{_
  if(!XmsSetup.IsDbOpened()) XmsSetup.DbOpen();	
  return true;
}

void cPluginXms::Stop(void)
{_
  if(XmsSetup.IsDbOpened()) XmsSetup.DbClose();	
}

void cPluginXms::Housekeeping(void)
{_
}

cOsdObject *cPluginXms::MainMenuAction(void)
{_
  return new cXmsMenu();
}

cMenuSetupPage *cPluginXms::SetupMenu(void)
{_
  return new cMenuSetupXms();
}

bool cPluginXms::SetupParse(const char *Name, const char *Value)
{_
  return XmsSetup.SetupParse(Name, Value);
}

VDRPLUGINCREATOR(cPluginXms); // Don't touch this!
