diff options
author | horchi <vdr@jwendel.de> | 2012-11-28 09:17:32 +0100 |
---|---|---|
committer | horchi <vdr@jwendel.de> | 2012-11-28 09:17:32 +0100 |
commit | 0197b5c98cdeec3740644655963e1f100d73998e (patch) | |
tree | 029168cfc6a31cb3bb6309f2b8ae577302307d8d /config.c | |
download | vdr-plugin-seduatmo-0197b5c98cdeec3740644655963e1f100d73998e.tar.gz vdr-plugin-seduatmo-0197b5c98cdeec3740644655963e1f100d73998e.tar.bz2 |
initial Release of vdr-plugin-seduatmo
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 114 |
1 files changed, 114 insertions, 0 deletions
diff --git a/config.c b/config.c new file mode 100644 index 0000000..1411775 --- /dev/null +++ b/config.c @@ -0,0 +1,114 @@ +/* + * seduthred.c: A plugin for the Video Disk Recorder + * + * See the README file for copyright information and how to reach the author. + * + * $Id: config.c,v 1.27 2012/11/28 06:29:24 wendel Exp $ + */ + +#include <string.h> + +#include "config.h" +#include "common.h" + +//*************************************************************************** +// Global Configuration +//*************************************************************************** + +cSeduConfig cfg; + +//*************************************************************************** +// cConfigData +//*************************************************************************** + +cSeduConfig::cSeduConfig() +{ + // to be configured + + frequence = 25; + threshold = 17; + average = 10; + adjRed = 57; + adjGreen = 100; + adjBlue = 70; + gamma = 14; + xDeep = 2; + yDeep = 1; + black = 0; + + detectCineBars = cbBoth; + + seduMode = smMiniDMX; + strcpy(seduRGBOrder, "BGR"); + loglevel = 0; + + showMainmenu = yes; + viewMode = vmAtmo; + fixedR = 111; + fixedG = 101; + fixedB = 0; + + // calculated + + leds = 0; + ledCount = 0; + grabWidth = na; + grabHeight = na; +} + +cSeduConfig::~cSeduConfig() +{ + if (leds) delete leds; +} + +//*************************************************************************** +// Create Leds from config +//*************************************************************************** + +cSeduConfig::cLed* cSeduConfig::createLeds(cLedConfs* conf) +{ + int seq = 0; + delete leds; + + grabWidth = 0; + grabHeight = 0; + + ledCount = conf->Count(); + leds = new cLed[ledCount]; + memset(leds, 0, ledCount*sizeof(cLed)); + + for (cLedConf* l = conf->First(); l; l = conf->Next(l)) + { + tell(0, "led%d (%d) %d/%d %d/%d", seq, l->Pos(), + l->X(), l->Y(), + l->ToX(), l->ToY()); + + if (l->isValid()) + { + // calc size of led matrix + + if (grabWidth < l->X()) + grabWidth = l->X(); + if (grabWidth < l->ToX()) + grabWidth = l->ToX(); + if (grabHeight < l->Y()) + grabHeight = l->Y(); + if (grabHeight < l->ToY()) + grabHeight = l->ToY(); + + leds[seq].lp = (LedPosition)l->Pos(); + leds[seq].x = l->X(); + leds[seq].y = l->Y(); + leds[seq].toX = l->ToX(); + leds[seq].toY = l->ToY(); + + seq++; + } + } + + ledCount = seq; + grabWidth++; + grabHeight++; + + return leds; +} |