/*
 * advchctrlsetup.c: A plugin for the Video Disk Recorder
 *
 * See the README file for copyright information and how to reach the author.
 *
 * $Id$
 */
 
#include "advchctrlconfig.h"
#include "advchctrli18n.h"
#include "advchctrlsetup.h"

//static const char *SortOpt[] = { "As entered", "None", "Name", NULL };

cAdvChCtrlSetup::cAdvChCtrlSetup(void)
{
    DefaultVolume = advchctrlConfig.defaultvolume;
    HideMainMenu = advchctrlConfig.hidemainmenu;

//  Add(new cMenuEditNumChanItem(tr("Number of channels"),&Lines));
//  Add(new cMenuEditSortByItem(tr("Sort by"),           &SortBy));
    themes[eThemeClassic]       = tr("Classic");
//    themes[eThemeSTTNG]         = tr("ST:TNG Konsolen");
//    themes[eThemeElchi]         = tr("Elchi");
//    themes[eThemeDeepBlue]      = tr("DeepBlue");
//    themes[eThemeMoronimo]      = tr("Moronimo");
    Setup();
}

void cAdvChCtrlSetup::Store(void)
{
    SetupStore("HideMainMenu",	advchctrlConfig.hidemainmenu = HideMainMenu);
    SetupStore("DefaultVolume",	advchctrlConfig.defaultvolume = DefaultVolume);
    SetupStore("Theme",         advchctrlConfig.theme);
    SetupStore("OSDPosition",	advchctrlConfig.osdposition);
    SetupStore("OSDHeight",	advchctrlConfig.osdheight);
    SetupStore("OSDWidth",	advchctrlConfig.osdwidth);
    SetupStore("OSDOffset",	advchctrlConfig.osdoffset);
//  SetupStore("RedLimit",       	advchctrlConfig.redlimit);
//  SetupStore("GreenLimit",     	advchctrlConfig.greenlimit);
}


void cAdvChCtrlSetup::Setup(void)
{
//  int current = Current();
//  Clear();
    Add(new cMenuEditBoolItem(  tr("Hide main menu entry"), &HideMainMenu,       tr("no"),            tr("yes")));
    Add(new cMenuEditStraItem(  tr("Theme"),                &advchctrlConfig.theme,          eThemeMaxNumber,themes));
    Add(new cMenuEditBoolItem(  tr("OSD-Position"),         &advchctrlConfig.osdposition,       tr("bottom"),        tr("top")));
    Add(new cMenuEditIntItem(   tr("OSD-Height"),           &advchctrlConfig.osdheight,      400,                 500));
    Add(new cMenuEditIntItem(   tr("OSD-Width"),            &advchctrlConfig.osdwidth ,      400,                 655));
    Add(new cMenuEditIntItem(   tr("OSD-Horizontal offset"),&advchctrlConfig.osdoffset,      -50,                 50));
    Add(new cMenuEditIntItem(   tr("Default volume"),       &DefaultVolume, 0, 255));


//  Add(new cMenuEditBoolItem(  tr("Show CA system"),              &advchctrlConfig.showcasystem,   tr("no"),            tr("yes")));
//  Add(new cMenuEditIntItem(   tr("Red limit [%]"),               &advchctrlConfig.redlimit,       1,                   50));
//  Add(new cMenuEditIntItem(   tr("Green limit [%]"),             &advchctrlConfig.greenlimit,     51,                  100));
//  Add(new cMenuEditIntItem(   tr("OSD update interval [0.1s]"),  &advchctrlConfig.updateinterval, 1,                   100));
//  Add(new cMenuEditBoolItem(  tr("Analyze stream"),              &advchctrlConfig.analyzestream,  tr("no"),            tr("yes")));

//  SetCurrent(Get(current));
    Display();
}

const cAdvChCtrlTheme advchctrlTheme[eThemeMaxNumber] =
{
  {
    // eThemeClassic
    clrGray50,  // clrBackground
    clrCyan,    // clrTitleBackground
    clrGray50,  // clrMenuBackground
    0xFF000000, // clrTitleText
    0xFFFCC024, // clrActiveText
    clrWhite,   // clrInactiveText
    clrRed,     // clrRed
    clrYellow,  // clrYellow
    clrGreen,   // clrGreen
  },

//  {
//    // eThemeST:TNG
//    clrGray50,  // clrBackground
//    clrYellow,  // clrTitleBackground
//    clrYellow,  // clrMenuBackground
//    clrBlack,   // clrTitleText
//    clrBlack,   // clrActiveText
//    0xFFFCFCFC, // clrInactiveText
//    clrRed,     // clrRed
//    clrYellow,  // clrYellow
//    clrGreen,   // clrGreen
//  },
//  {
    // eThemeElchi
//    0xC8000066, // clrBackground
//    0xC833AAEE, // clrTitleBackground
//    0xC8000066, // clrMenuBackgroun
//    0xFF000000, // clrTitleText
//    0xFFCCBB22, // clrActiveText
//    0xFFFFFFFF, // clrInactiveText
//    0xFFFF0000, // clrRed
//    0xFFFFEE00, // clrYellow
//    0xFF33CC33, // clrGreen
//  },
//  {
    // eThemeDeepBlue
//    0xC80C0C0C, // clrBackground
//    0xC832557A, // clrTitleBackground
//    0xC80C0C0C, // clrMenuBackground
//    0xFF000000, // clrTitleText
//    0xFFCE7B00, // clrActiveText
//    0xFF9A9A9A, // clrInactiveText
//    0xFF992900, // clrRed
//    0xFFCE7B00, // clrYellow
//    0xFF336600, // clrGreen
//  },
//  {
    // eThemeMoronimo
//    0xDF294A6B, // clrBackground
//    0xDF3E5578, // clrTitleBackground
//    0xDF294A6B, // clrBackground
//    0xFF9BBAD7, // clrTitleText
//    0xFFCE7B00, // clrActiveText
//    0xFF9A9A9A, // clrInactiveText
//    0xFF992900, // clrRed
//    0xFFCE7B00, // clrYellow
//    0xFF336600, // clrGreen
//  },
};

