/*
 * PhotoCD plugin for VDR
 * pcd_setup.c: Setup the plugin
 *
 * See the README file for copyright information and how to reach the author.
 *
 * This code is distributed under the terms and conditions of the
 * GNU GENERAL PUBLIC LICENSE. See the file COPYING for details.
 *
 */

#include <vdr/menuitems.h>
#include "pcd_setup.h"
#include "pcd_i18n.h"

cPcdSetupData PcdSetupData;

// --- cVcdSetupData ---------------------------------------------------------

cPcdSetupData::cPcdSetupData(void)
{
  DriveSpeed = 8;
  HideMainMenuEntry = 0;
  Quality = 9;
  Pal = 1;
  QuickScaling = 0;
  SlideInterval = 10;
}


// --- cPcdSetupMenu ---------------------------------------------------------

cPcdSetupMenu::cPcdSetupMenu(cPCD *Pcd)
{
  pcd = Pcd;
  setupData = PcdSetupData;
  SetSection(tr("PCD"));
  Add(new cMenuEditIntItem(tr("Setup.PhotoCD$Drive speed"), &setupData.DriveSpeed, 1, 50));
  Add(new cMenuEditBoolItem(tr("Setup.PhotoCD$Hide main menu entry"), &setupData.HideMainMenuEntry));
  Add(new cMenuEditIntItem(tr("Setup.PhotoCD$MPEG quality"), &setupData.Quality, 1, 31));
  Add(new cMenuEditBoolItem(tr("Setup.PhotoCD$Pal"), &setupData.Pal));
  Add(new cMenuEditBoolItem(tr("Setup.PhotoCD$Quick scaling"), &setupData.QuickScaling));
  Add(new cMenuEditBoolItem(tr("Setup.PhotoCD$No adjustment"), &setupData.NoAdjust));
  Add(new cMenuEditIntItem(tr("Setup.PhotoCD$Slideshow interval (sec)"), &setupData.SlideInterval, 5, 300));
}

void cPcdSetupMenu::Store(void)
{
  PcdSetupData = setupData;
  SetupStore("DriveSpeed", PcdSetupData.DriveSpeed);
  pcd->SetDriveSpeed(PcdSetupData.DriveSpeed);
  SetupStore("HideMainMenuEntry", PcdSetupData.HideMainMenuEntry);
  SetupStore("Quality", PcdSetupData.Quality);
  SetupStore("Pal", PcdSetupData.Pal);
  SetupStore("Quickscaling", PcdSetupData.QuickScaling);
  SetupStore("Nofit", PcdSetupData.NoAdjust);
  SetupStore("SlideshowInterval", PcdSetupData.SlideInterval);
}
