#include "configuration.h"
#include <strings.h>
#include <stdlib.h>
cSubtitlesConfiguration gSubtitlesConfiguration;

cSubtitlesConfiguration::cSubtitlesConfiguration()
{
    language = -1;
    language2 = -1;
    hearingImpaired = 0;
    widescreen = 0;
    recording = 1;
    enabled = 1;
    offset = 0;
    sync = 1;
    delay = 0;
    mainmenu = 0;
    dxr3comp = 0;
    bgTransparency = 0;
    fgTransparency = 0;
}

bool cSubtitlesConfiguration::Parse(const char *Name, const char *Value)
{

    // Parse your own setup parameters and store their values.
    if(!strcasecmp(Name, "Language")) language = atoi(Value);
    else if(!strcasecmp(Name, "HearingImpaired")) hearingImpaired = atoi(Value);
    else if(!strcasecmp(Name, "Record")) recording = atoi(Value);
    else if(!strcasecmp(Name, "VideoFormat")) widescreen = atoi(Value);
    else if(!strcasecmp(Name, "Enabled")) enabled = atoi(Value);
    else if(!strcasecmp(Name, "Offset")) offset = atoi(Value);
    else if(!strcasecmp(Name, "Sync")) sync = atoi(Value);  
    else if(!strcasecmp(Name, "Delay")) delay = atoi(Value);
    else if(!strcasecmp(Name, "Language2")) language2 = atoi(Value);
    else if(!strcasecmp(Name, "Mainmenu")) mainmenu = atoi(Value);
    else if(!strcasecmp(Name, "Dxr3comp")) dxr3comp = atoi(Value);
    else if(!strcasecmp(Name, "Transparency") ||
	    !strcasecmp(Name, "BackgroundTransparency")) bgTransparency = atoi(Value);
    else if(!strcasecmp(Name, "ForegroundTransparency")) fgTransparency = atoi(Value);
    else
	return false;
    return true;
}
