From fe9499ba901f5c32dd0b3841a2b6e599fefc144f Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 24 Nov 2002 18:00:00 +0100 Subject: =?UTF-8?q?Version=201.1.17=20-=20Added=20new=20entries=20to=20'ca?= =?UTF-8?q?.conf'.=20-=20Fixed=20closing=20unused=20PID=20handles=20(thank?= =?UTF-8?q?s=20to=20Stefan=20Schluenss=20for=20reporting=20this=20=20=20on?= =?UTF-8?q?e).=20-=20Added=20more=20examples=20to=20'diseqc.conf'=20(thank?= =?UTF-8?q?s=20to=20Oliver=20Endriss).=20-=20Fixed=20disabling=20multiple?= =?UTF-8?q?=20recordings=20on=20a=20single=20DVB=20card=20(comment=20out?= =?UTF-8?q?=20the=20definition=20=20=20of=20the=20macros=20DO=5FREC=5FAND?= =?UTF-8?q?=5FPLAY=5FON=5FPRIMARY=5FDEVICE=20and=20DO=5FMULTIPLE=5FRECORDI?= =?UTF-8?q?NGS=20in=20=20=20dvbdevice.c).=20-=20Plugins=20can=20now=20have?= =?UTF-8?q?=20their=20very=20own=20OSD=20setup=20in=20the=20object=20they?= =?UTF-8?q?=20return=20from=20=20=20a=20call=20to=20cPlugin::MainMenuActio?= =?UTF-8?q?n().=20In=20order=20to=20implement=20this,=20the=20return=20typ?= =?UTF-8?q?e=20=20=20of=20cPlugin::MainMenuAction()=20had=20to=20be=20chan?= =?UTF-8?q?ged=20from=20(cOsdMenu=20*)=20to=20(cOsdObject=20*).=20=20=20So?= =?UTF-8?q?=20in=20case=20you=20are=20compiling=20an=20existing=20plugin?= =?UTF-8?q?=20with=20this=20version=20of=20VDR=20and=20you=20=20=20get=20a?= =?UTF-8?q?n=20error=20message,=20simply=20change=20cOsdMenu=20to=20cOsdOb?= =?UTF-8?q?ject=20in=20the=20plugin's=20source=20=20=20for=20the=20MainMen?= =?UTF-8?q?uAction()=20function.=20=20=20Plugin=20authors=20who=20have=20s?= =?UTF-8?q?o=20far=20(ab)used=20the=20cControl=20mechanism=20to=20implemen?= =?UTF-8?q?t=20their=20=20=20own=20raw=20OSD=20should=20take=20a=20look=20?= =?UTF-8?q?at=20the=20new=20demo=20plugin=20'osddemo'.=20It=20implements?= =?UTF-8?q?=20=20=20a=20very=20primitive=20game=20that=20shows=20how=20a?= =?UTF-8?q?=20plugin=20can=20have=20its=20own=20raw=20OSD.=20Especially=20?= =?UTF-8?q?=20=20look=20into=20cLineGame=20and=20see=20how=20it=20implemen?= =?UTF-8?q?ts=20the=20Show()=20function.=20See=20also=20=20=20the=20chapte?= =?UTF-8?q?r=20on=20"User=20interaction"=20in=20PLUGINS.html.=20-=20Added?= =?UTF-8?q?=20three=20new=20fields=20to=20the=20lines=20in=20'channels.con?= =?UTF-8?q?f':=20NID,=20TID=20and=20RID.=20NID=20and=20=20=20TID=20are=20t?= =?UTF-8?q?he=20Network=20and=20Transport=20Stream=20IDs,=20respectively.?= =?UTF-8?q?=20RID=20is=20an=20additional=20ID=20=20=20that=20can=20be=20us?= =?UTF-8?q?ed=20to=20tell=20apart=20channels=20that=20would=20otherwise=20?= =?UTF-8?q?be=20indistinguishable.=20=20=20This=20is=20typically=20the=20c?= =?UTF-8?q?ase=20with=20radio=20channels,=20which=20may=20have=20the=20sam?= =?UTF-8?q?e=20NID,=20TID=20=20=20and=20SID,=20but=20different=20"radio=20?= =?UTF-8?q?IDs".=20This=20new=20field=20is=20therefore=20called=20RID=20("?= =?UTF-8?q?radio=20=20=20ID").=20Currently=20NID=20and=20TID=20are=20not?= =?UTF-8?q?=20yet=20used=20by=20VDR=20and=20should=20always=20be=200.=20Th?= =?UTF-8?q?e=20=20=20RID=20is=20actually=20used=20when=20building=20the=20?= =?UTF-8?q?"unique=20channel=20ID",=20so=20if=20you=20have=20channels=20?= =?UTF-8?q?=20=20in=20your=20'channels.conf'=20file=20that=20cause=20error?= =?UTF-8?q?=20messages=20when=20loading,=20you=20can=20set=20=20=20the=20R?= =?UTF-8?q?IDs=20of=20these=20channels=20to=20different=20values.=20=20=20?= =?UTF-8?q?When=20reading=20an=20old=20'channels.conf'=20these=20new=20fie?= =?UTF-8?q?lds=20will=20be=20automatically=20=20=20initialized=20to=200=20?= =?UTF-8?q?and=20once=20the=20file=20is=20written=20back=20to=20disk=20the?= =?UTF-8?q?y=20will=20be=20appended=20=20=20to=20the=20channel=20definitio?= =?UTF-8?q?ns.=20=20=20Thanks=20to=20R=C3=A9gis=20Bossut=20for=20pointing?= =?UTF-8?q?=20out=20that=20with=20some=20providers=20the=20channels=20can?= =?UTF-8?q?=20=20=20only=20be=20distinguished=20through=20the=20RID.=20-?= =?UTF-8?q?=20The=20"unique=20channel=20ID"=20now=20contains=20an=20option?= =?UTF-8?q?al=205th=20part=20(the=20RID).=20See=20man=20vdr(5).=20-=20Upda?= =?UTF-8?q?ted=20'channels.conf.cable'=20and=20made=20some=20channels=20un?= =?UTF-8?q?ique=20using=20the=20new=20RID=20=20=20(thanks=20to=20Andreas?= =?UTF-8?q?=20Kool=20for=20pointing=20out=20the=20problems).=20-=20Made=20?= =?UTF-8?q?some=20channels=20unique=20in=20'channels.conf.terr'=20using=20?= =?UTF-8?q?the=20new=20RID.=20-=20Extended=20the=20'-l'=20option=20to=20al?= =?UTF-8?q?low=20logging=20to=20LOG=5FLOCALn=20(n=3D0..7)=20by=20writing,?= =?UTF-8?q?=20for=20=20=20instance,=20'-l=203.7'=20(suggested=20by=20J?= =?UTF-8?q?=C3=BCrgen=20Schmidt).=20-=20Now=20deleting=20stale=20lock=20fi?= =?UTF-8?q?les=20if=20they=20have=20a=20time=20stamp=20that=20is=20outside?= =?UTF-8?q?=20the=20window=20=20=20'now=20+/-=20LOCKFILESTALETIME'.=20This?= =?UTF-8?q?=20improves=20things=20in=20cases=20where=20the=20system=20time?= =?UTF-8?q?=20=20=20makes=20far=20jumps,=20so=20that=20a=20lock=20file=20m?= =?UTF-8?q?ight=20end=20up=20with=20a=20time=20stamp=20that=20lies=20=20?= =?UTF-8?q?=20in=20the=20distant=20future=20(thanks=20to=20Oliver=20Endris?= =?UTF-8?q?s).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PLUGINS/SRC/osddemo/osddemo.c | 153 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 PLUGINS/SRC/osddemo/osddemo.c (limited to 'PLUGINS/SRC/osddemo/osddemo.c') diff --git a/PLUGINS/SRC/osddemo/osddemo.c b/PLUGINS/SRC/osddemo/osddemo.c new file mode 100644 index 0000000..f806178 --- /dev/null +++ b/PLUGINS/SRC/osddemo/osddemo.c @@ -0,0 +1,153 @@ +/* + * osddemo.c: A plugin for the Video Disk Recorder + * + * See the README file for copyright information and how to reach the author. + * + * $Id: osddemo.c 1.1 2002/11/24 10:32:59 kls Exp $ + */ + +#include + +static const char *VERSION = "0.0.1"; +static const char *DESCRIPTION = "Demo of arbitrary OSD setup"; +static const char *MAINMENUENTRY = "Osd Demo"; + +// --- cLineGame ------------------------------------------------------------- + +class cLineGame : public cOsdObject { +private: + cOsdBase *osd; + int x; + int y; + eDvbColor color; +public: + cLineGame(void); + ~cLineGame(); + virtual void Show(void); + virtual eOSState ProcessKey(eKeys Key); + }; + +cLineGame::cLineGame(void) +{ + osd = NULL; + x = y = 50; + color = clrRed; +} + +cLineGame::~cLineGame() +{ + delete osd; +} + +void cLineGame::Show(void) +{ + osd = cOsd::OpenRaw(100, 50); + if (osd) { + osd->Create(0, 0, 100, 200, 4); + osd->AddColor(clrBackground); + osd->AddColor(clrRed); + osd->AddColor(clrGreen); + osd->AddColor(clrYellow); + osd->AddColor(clrBlue); + osd->Clear(); + osd->Flush(); + } +} + +eOSState cLineGame::ProcessKey(eKeys Key) +{ + eOSState state = cOsdObject::ProcessKey(Key); + if (state == osUnknown) { + switch (Key & ~k_Repeat) { + case kUp: if (y > 0) y--; break; + case kDown: if (y < 196) y++; break; + case kLeft: if (x > 0) x--; break; + case kRight: if (x < 96) x++; break; + case kRed: color = clrRed; break; + case kGreen: color = clrGreen; break; + case kYellow: color = clrYellow; break; + case kBlue: color = clrBlue; break; + case kOk: return osEnd; + default: return state; + } + osd->Fill(x, y, x + 3, y + 3, color); + osd->Flush(); + state = osContinue; + } + return state; +} + +// --- cPluginOsddemo -------------------------------------------------------- + +class cPluginOsddemo : public cPlugin { +private: + // Add any member variables or functions you may need here. +public: + cPluginOsddemo(void); + virtual ~cPluginOsddemo(); + virtual const char *Version(void) { return VERSION; } + virtual const char *Description(void) { return DESCRIPTION; } + virtual const char *CommandLineHelp(void); + virtual bool ProcessArgs(int argc, char *argv[]); + virtual bool Start(void); + virtual void Housekeeping(void); + virtual const char *MainMenuEntry(void) { return MAINMENUENTRY; } + virtual cOsdObject *MainMenuAction(void); + virtual cMenuSetupPage *SetupMenu(void); + virtual bool SetupParse(const char *Name, const char *Value); + }; + +cPluginOsddemo::cPluginOsddemo(void) +{ + // Initialize any member variables here. + // DON'T DO ANYTHING ELSE THAT MAY HAVE SIDE EFFECTS, REQUIRE GLOBAL + // VDR OBJECTS TO EXIST OR PRODUCE ANY OUTPUT! +} + +cPluginOsddemo::~cPluginOsddemo() +{ + // Clean up after yourself! +} + +const char *cPluginOsddemo::CommandLineHelp(void) +{ + // Return a string that describes all known command line options. + return NULL; +} + +bool cPluginOsddemo::ProcessArgs(int argc, char *argv[]) +{ + // Implement command line argument processing here if applicable. + return true; +} + +bool cPluginOsddemo::Start(void) +{ + // Start any background activities the plugin shall perform. + return true; +} + +void cPluginOsddemo::Housekeeping(void) +{ + // Perform any cleanup or other regular tasks. +} + +cOsdObject *cPluginOsddemo::MainMenuAction(void) +{ + // Perform the action when selected from the main VDR menu. + return new cLineGame; +} + +cMenuSetupPage *cPluginOsddemo::SetupMenu(void) +{ + // Return a setup menu in case the plugin supports one. + return NULL; +} + +bool cPluginOsddemo::SetupParse(const char *Name, const char *Value) +{ + // Parse your own setup parameters and store their values. + return false; +} + +VDRPLUGINCREATOR(cPluginOsddemo); // Don't touch this! -- cgit v1.2.3