summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--boblightservice.c2
-rw-r--r--config.c2
-rw-r--r--config.h5
-rw-r--r--setup_menu.c3
-rw-r--r--vdrboblight.c6
5 files changed, 16 insertions, 2 deletions
diff --git a/boblightservice.c b/boblightservice.c
index 060f2d3..59bbda9 100644
--- a/boblightservice.c
+++ b/boblightservice.c
@@ -32,7 +32,7 @@ int cBoblight::open()
m_boblight = boblight_init();
tell(1, "Successfully loaded and initalized libboblight");
- if (!boblight_connect(m_boblight, NULL, -1, 1000000) || !boblight_setpriority(m_boblight, cfg.priority))
+ if (!boblight_connect(m_boblight, cfg.host, cfg.port, 1000000) || !boblight_setpriority(m_boblight, cfg.priority))
{
tell(0, "Error connecting to boblight %s", boblight_geterror(m_boblight));
close();
diff --git a/config.c b/config.c
index b66fa70..af41f31 100644
--- a/config.c
+++ b/config.c
@@ -45,6 +45,8 @@ cBobConfig::cBobConfig()
autospeed = 0;
interpolation = 1; //bool
priority = 128;
+ strn0cpy(host, "127.0.0.1", 16);
+ port = 19333;
detectCineBars = cbBoth;
cineBarsThreshold = 20;
diff --git a/config.h b/config.h
index 09646c1..ae7a79f 100644
--- a/config.h
+++ b/config.h
@@ -22,6 +22,7 @@
#include "common.h"
#include "ambiservice.h"
+#include <vdr/tools.h>
//***************************************************************************
// Configuration
@@ -53,7 +54,9 @@ class cBobConfig : public cAmbiService
int fixedR;
int fixedG;
int fixedB;
-
+ char host[16];
+ int port;
+
int showMainmenu; //bool
int detectCineBars;
int cineBarsThreshold;
diff --git a/setup_menu.c b/setup_menu.c
index 5ed8328..104ae7a 100644
--- a/setup_menu.c
+++ b/setup_menu.c
@@ -27,6 +27,9 @@ void cAmbiSetup::Setup()
Add(new cMenuEditIntItem(tr("Log level"), &cfg.loglevel, 0, 3));
Add(new cMenuEditBoolItem(tr("Show mainmenu"), &cfg.showMainmenu));
+
+ Add(new cMenuEditStrItem(tr("Boblightd host, ip"), cfg.host, 16));
+ Add(new cMenuEditIntItem(tr("Boblightd port"), &cfg.port));
Add(new cMenuEditIntItem(tr("Updaterate [Hz]"), &cfg.frequence, 1, 15));
diff --git a/vdrboblight.c b/vdrboblight.c
index 2907b49..85be1db 100644
--- a/vdrboblight.c
+++ b/vdrboblight.c
@@ -100,6 +100,9 @@ void cPluginBoblight::Save() {
SetupStore("FixedColorRed", cfg.fixedR);
SetupStore("FixedColorGreen", cfg.fixedG);
SetupStore("FixedColorBlue", cfg.fixedB);
+
+ SetupStore("Host", cfg.host);
+ SetupStore("Port", cfg.port);
}
void cPluginBoblight::Stop(void)
@@ -152,6 +155,9 @@ bool cPluginBoblight::SetupParse(const char* Name, const char* Value)
else if (!strcasecmp(Name, "FixedColorRed")) cfg.fixedR = atoi(Value);
else if (!strcasecmp(Name, "FixedColorGreen")) cfg.fixedG = atoi(Value);
else if (!strcasecmp(Name, "FixedColorBlue")) cfg.fixedB = atoi(Value);
+
+ else if (!strcasecmp(Name, "Host")) strn0cpy(cfg.host, Value, 16);
+ else if (!strcasecmp(Name, "Port")) cfg.port = atoi(Value);
else
return false;