vdr-plugin-iptv/setup.c

62 lines
1.9 KiB
C
Raw Normal View History

2007-09-15 17:38:38 +02:00
/*
* setup.c: IPTV plugin for the Video Disk Recorder
*
* See the README file for copyright information and how to reach the author.
*
2007-09-16 15:49:35 +02:00
* $Id: setup.c,v 1.5 2007/09/16 13:49:35 rahrenbe Exp $
2007-09-15 17:38:38 +02:00
*/
#include "common.h"
#include "config.h"
#include "setup.h"
2007-09-16 15:49:35 +02:00
#ifndef trVDR
#define trVDR(s) tr(s)
#endif
2007-09-15 17:38:38 +02:00
cIptvPluginSetup::cIptvPluginSetup(void)
{
2007-09-16 15:38:20 +02:00
tsBufferSize = IptvConfig.GetTsBufferSize();
tsBufferPrefill = IptvConfig.GetTsBufferPrefillRatio();
udpBufferSize = IptvConfig.GetUdpBufferSize();
httpBufferSize = IptvConfig.GetHttpBufferSize();
fileBufferSize = IptvConfig.GetFileBufferSize();
2007-09-15 17:38:38 +02:00
Setup();
2007-09-16 15:38:20 +02:00
SetHelp(trVDR("Channels"), NULL, NULL, NULL);
2007-09-15 17:38:38 +02:00
}
void cIptvPluginSetup::Setup(void)
{
int current = Current();
Clear();
2007-09-16 15:38:20 +02:00
Add(new cMenuEditIntItem(tr("TS buffer size [MB]"), &tsBufferSize, 2, 16));
Add(new cMenuEditIntItem(tr("TS buffer prefill ratio [%]"), &tsBufferPrefill, 0, 40));
Add(new cMenuEditIntItem(tr("UDP buffer size [packets]"), &udpBufferSize, 1, 14));
Add(new cMenuEditIntItem(tr("HTTP buffer size [packets]"), &httpBufferSize, 1, 14));
Add(new cMenuEditIntItem(tr("FILE buffer size [packets]"), &fileBufferSize, 1, 14));
2007-09-15 17:38:38 +02:00
SetCurrent(Get(current));
Display();
}
eOSState cIptvPluginSetup::ProcessKey(eKeys Key)
{
eOSState state = cMenuSetupPage::ProcessKey(Key);
return state;
}
void cIptvPluginSetup::Store(void)
{
2007-09-16 15:38:20 +02:00
// Store values into setup.conf
SetupStore("TsBufferSize", tsBufferSize);
SetupStore("TsBufferPrefill", tsBufferPrefill);
SetupStore("UdpBufferSize", udpBufferSize);
SetupStore("HttpBufferSize", httpBufferSize);
SetupStore("FileBufferSize", fileBufferSize);
// Update global config
IptvConfig.SetTsBufferSize(tsBufferSize);
IptvConfig.SetTsBufferPrefillRatio(tsBufferPrefill);
IptvConfig.SetUdpBufferSize(udpBufferSize);
IptvConfig.SetHttpBufferSize(httpBufferSize);
IptvConfig.SetFileBufferSize(fileBufferSize);
2007-09-15 17:38:38 +02:00
}