/*
 * DV Player plugin for VDR
 *
 * Copyright (C) 2003, 2004 Erich Bachl <erich.bachl@vr-web.de>
 *
 * This code is distributed under the terms and conditions of the
 * GNU GENERAL PUBLIC LICENSE. See the file COPYING for details.
 *
 */

#define __DV_C

#include <stdlib.h>
//#include <vdr/plugin.h>
#include <vdr/device.h>

#include "i18n.h"
#include "menusetup.h"
#include "status.h"
#include "dv.h"
#include "device.h"

const char *VERSION        = "0.0.3";
static const char *DESCRIPTION    = "Setup.Camcorder$Camcorder Plugin";
static const char *MAINMENUENTRY  = "Setup.Camcorder$Camcorder";

const char *cPluginDV::Version(void) { return VERSION; }
const char *cPluginDV::Description(void) { return tr(DESCRIPTION); }
const char *cPluginDV::MainMenuEntry(void) { return tr(MAINMENUENTRY); }

cPluginDV::cPluginDV(void) // 1. VDR call
{
  DVDevice = NULL;
  DVStatus = NULL;
}

cPluginDV::~cPluginDV()
{
  if(DVDevice)
  {
    //delete DVDevice;
    DVDevice = NULL;
  }

  if(DVStatus)
  {
    delete DVStatus;
    DVStatus = NULL;
  }
}

bool cPluginDV::Initialize(void) // early initialization, 3. VDR call
{
  RegisterI18n(DVPhrases);
  DVDevice = new cDVDevice;
  return true;
}

bool cPluginDV::Start(void) // final initialization, 5. VDR call
{
  RegisterI18n(DVPhrases);
  DVStatus = new cDVStatus;
  return true;
}

void cPluginDV::Housekeeping(void)
{
}

cOsdMenu *cPluginDV::MainMenuAction(void)
{
  return new cMenuSetupAnalogtv(this);
}

cMenuSetupPage *cPluginDV::SetupMenu(void)
{
  return new cMenuSetupAnalogtv(this);
}

bool cPluginDV::SetupParse(const char *Name, const char *Value) // 2. VDR call
{
  return true;
}

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