vdr-plugin-streamdev/client/setup.c
schmirl 9c60fb4e42 - changed location of streamdevhosts.conf to VDRCONFDIR/plugins/streamdev
- changed externremux.sh's default location to VDRCONFDIR/plugins/streamdev
- added sample externremux.sh from http://www.vdr-wiki.de/
- stop providing channels after client has been disabled at runtime
- added logging of the client device's card index
- changed default suspend mode to "Always suspended"
- added "Hide Mainmenu Entry" setup option on client
2008-04-07 14:50:32 +00:00

74 lines
2.2 KiB
C

/*
* $Id: setup.c,v 1.5 2008/04/07 14:50:32 schmirl Exp $
*/
#include <vdr/menuitems.h>
#include "client/setup.h"
#include "client/device.h"
#include "i18n.h"
cStreamdevClientSetup StreamdevClientSetup;
cStreamdevClientSetup::cStreamdevClientSetup(void) {
StartClient = false;
RemotePort = 2004;
StreamFilters = false;
SyncEPG = false;
HideMenuEntry = false;
strcpy(RemoteIp, "");
}
bool cStreamdevClientSetup::SetupParse(const char *Name, const char *Value) {
if (strcmp(Name, "StartClient") == 0) StartClient = atoi(Value);
else if (strcmp(Name, "RemoteIp") == 0) {
if (strcmp(Value, "-none-") == 0)
strcpy(RemoteIp, "");
else
strcpy(RemoteIp, Value);
}
else if (strcmp(Name, "RemotePort") == 0) RemotePort = atoi(Value);
else if (strcmp(Name, "StreamFilters") == 0) StreamFilters = atoi(Value);
else if (strcmp(Name, "SyncEPG") == 0) SyncEPG = atoi(Value);
else if (strcmp(Name, "HideMenuEntry") == 0) HideMenuEntry = atoi(Value);
else return false;
return true;
}
cStreamdevClientMenuSetupPage::cStreamdevClientMenuSetupPage(void) {
m_NewSetup = StreamdevClientSetup;
AddBoolEdit (tr("Hide Mainmenu Entry"),m_NewSetup.HideMenuEntry);
AddBoolEdit (tr("Start Client"), m_NewSetup.StartClient);
AddIpEdit (tr("Remote IP"), m_NewSetup.RemoteIp);
AddShortEdit(tr("Remote Port"), m_NewSetup.RemotePort);
AddBoolEdit (tr("Filter Streaming"), m_NewSetup.StreamFilters);
AddBoolEdit (tr("Synchronize EPG"), m_NewSetup.SyncEPG);
SetCurrent(Get(0));
}
cStreamdevClientMenuSetupPage::~cStreamdevClientMenuSetupPage() {
}
void cStreamdevClientMenuSetupPage::Store(void) {
if (m_NewSetup.StartClient != StreamdevClientSetup.StartClient) {
if (m_NewSetup.StartClient)
cStreamdevDevice::Init();
}
SetupStore("StartClient", m_NewSetup.StartClient);
if (strcmp(m_NewSetup.RemoteIp, "") == 0)
SetupStore("RemoteIp", "-none-");
else
SetupStore("RemoteIp", m_NewSetup.RemoteIp);
SetupStore("RemotePort", m_NewSetup.RemotePort);
SetupStore("StreamFilters", m_NewSetup.StreamFilters);
SetupStore("SyncEPG", m_NewSetup.SyncEPG);
SetupStore("HideMenuEntry", m_NewSetup.HideMenuEntry);
StreamdevClientSetup = m_NewSetup;
cStreamdevDevice::ReInit();
}