From 78e3da813cb4345e57934a9a60f6316f1e257307 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 15 Jan 2006 18:00:00 +0100 Subject: =?UTF-8?q?Version=201.3.39=20-=20The=20SVDRP=20command=20LSTT=20n?= =?UTF-8?q?ow=20accepts=20the=20new=20option=20'id'=20to=20have=20the=20ch?= =?UTF-8?q?annels=20=20=20of=20the=20timers=20listed=20with=20their=20uniq?= =?UTF-8?q?ue=20channel=20ids=20instead=20of=20their=20numbers=20=20=20(su?= =?UTF-8?q?ggested=20by=20Matthias=20Schniedermeyer).=20-=20Added=20a=20mi?= =?UTF-8?q?ssing=20#include=20=20to=20thread.c=20(thanks?= =?UTF-8?q?=20to=20Ville=20Skytt=C3=A4).=20-=20Fixed=20the=20"plugins-clea?= =?UTF-8?q?n"=20and=20"plugins-install"=20targets=20in=20the=20Makefile=20?= =?UTF-8?q?(thanks=20=20=20to=20Andreas=20Brachold).=20-=20Fixed=20handlin?= =?UTF-8?q?g=20"more=20than=203=20byte"=20key=20sequences=20in=20cKbdRemot?= =?UTF-8?q?e::ReadKeySequence()=20=20=20(thanks=20to=20Peter=20Bieringer).?= =?UTF-8?q?=20If=20you=20are=20using=20the=20PC=20keyboard=20as=20remote?= =?UTF-8?q?=20control=20=20=20input=20you=20may=20need=20to=20make=20VDR?= =?UTF-8?q?=20newly=20learn=20the=20keys=20by=20removing=20the=20remote.co?= =?UTF-8?q?nf=20=20=20file.=20-=20To=20avoid=20problems=20with=20access=20?= =?UTF-8?q?rights=20when=20VDR=20shall=20run=20as=20'root'=20it=20now=20sk?= =?UTF-8?q?ips=20=20=20all=20SetCaps()=20and=20SetUser()=20calls=20when=20?= =?UTF-8?q?it=20is=20started=20as=20'root'=20and=20"-u=20root"=20=20=20is?= =?UTF-8?q?=20given.=20-=20Added=20missing=20i18n=20entry=20for=20the=20"T?= =?UTF-8?q?imer"=20button=20(thanks=20to=20Ville=20Skytt=C3=A4)=20-=20Upda?= =?UTF-8?q?ted=20the=20Finnish=20OSD=20texts=20(thanks=20to=20Rolf=20Ahren?= =?UTF-8?q?berg).=20-=20Making=20the=20"Menu"=20key=20behave=20consistentl?= =?UTF-8?q?y=20has=20not=20been=20well=20received=20by=20several=20=20=20u?= =?UTF-8?q?sers,=20so=20the=20new=20option=20"Setup/OSD/Menu=20button=20cl?= =?UTF-8?q?oses"=20can=20be=20used=20to=20get=20the=20=20=20old=20behavior?= =?UTF-8?q?=20back=20(which=20also=20is=20the=20default=20value=20of=20thi?= =?UTF-8?q?s=20option).=20-=20Dropped=20the=20default=20vdr=20user.=20The?= =?UTF-8?q?=20program=20now=20always=20runs=20under=20the=20user=20id=20?= =?UTF-8?q?=20=20it=20was=20started=20from,=20unless=20the=20'-u'=20option?= =?UTF-8?q?=20is=20given=20and=20it=20was=20started=20from=20=20=20the=20'?= =?UTF-8?q?root'=20user.=20If=20you=20want=20to=20have=20a=20default=20vdr?= =?UTF-8?q?=20user,=20you=20can=20activate=20and=20=20=20adjust=20the=20"V?= =?UTF-8?q?DR=5FUSER=20=3D=20vdr"=20line=20in=20your=20Make.config=20file?= =?UTF-8?q?=20(from=20the=20original=20=20=20patch=20by=20Ludwig=20Nussel)?= =?UTF-8?q?.=20-=20Key=20macros=20can=20now=20be=20defined=20for=20all=20n?= =?UTF-8?q?on-modeless=20keys=20(suggested=20by=20Mirko=20D=C3=B6lle).=20-?= =?UTF-8?q?=20Adjusted=20the=20"KEY=20MACROS"=20section=20of=20vdr.5=20to?= =?UTF-8?q?=20the=20new=20plugin=20calling=20mechanism=20=20=20introduced?= =?UTF-8?q?=20in=20version=201.3.32.=20-=20Removed=20the=20now=20obsolete?= =?UTF-8?q?=20"ca.conf"=20section=20from=20vdr.1=20(thanks=20to=20Ville=20?= =?UTF-8?q?Skytt=C3=A4).=20-=20Added=20missing=20description=20of=20L=20an?= =?UTF-8?q?d=20R=20circular=20polarization=20to=20'diseqc.conf'.=20-=20Add?= =?UTF-8?q?ed=20a=20note=20about=20"modprobe=20capability"=20to=20INSTALL?= =?UTF-8?q?=20(suggested=20by=20Patrick=20Cernko).=20-=20Fixed=20canonical?= =?UTF-8?q?izing=20the=20file=20name=20in=20the=20SVDRP=20command=20GRAB?= =?UTF-8?q?=20to=20allow=20full=20path=20=20=20names=20(thanks=20to=20Stef?= =?UTF-8?q?an=20Huelswitt).=20-=20Added=20a=20missing=20'-'=20to=20the=20e?= =?UTF-8?q?xample=20for=20viewing=20a=20grabbed=20image=20on=20a=20remote?= =?UTF-8?q?=20host=20=20=20(reported=20by=20Philippe=20Gramoull=C3=A9).=20?= =?UTF-8?q?-=20Made=20the=20"What's=20on=20now/next=3F"=20menus=20a=20lot?= =?UTF-8?q?=20faster=20by=20storing=20a=20pointer=20to=20each=20=20=20chan?= =?UTF-8?q?nel's=20schedule=20in=20the=20cChannel=20data.=20-=20Made=20the?= =?UTF-8?q?=20log=20messages=20regarding=20lost=20lock=20of=20devices=20"i?= =?UTF-8?q?nfo"=20instead=20of=20"error"=20=20=20(suggested=20by=20Andreas?= =?UTF-8?q?=20Brachold).=20-=20The=20SVDRP=20command=20GRAB=20allows=20fil?= =?UTF-8?q?e=20names=20without=20extension=20again=20(suggested=20by=20=20?= =?UTF-8?q?=20Stefan=20Huelswitt).=20-=20Pressing=20'0'=20in=20the=20"Sche?= =?UTF-8?q?dule"=20menu=20now=20rotates=20through=20displaying=20"This=20e?= =?UTF-8?q?vent=20on=20=20=20this=20channel",=20"This=20event=20on=20all?= =?UTF-8?q?=20channels"=20and=20"All=20events=20on=20all=20channels".=20?= =?UTF-8?q?=20=20This=20can=20be=20used=20to=20find=20reruns=20of=20a=20gi?= =?UTF-8?q?ven=20show,=20or=20the=20episodes=20of=20a=20series.=20=20=20No?= =?UTF-8?q?te=20that=20if=20there=20are=20many=20channels=20in=20your=20ch?= =?UTF-8?q?annels.conf,=20displaying=20the=20=20=20"All=20events=20on=20al?= =?UTF-8?q?l=20channels"=20page=20may=20take=20a=20while.=20-=20The=20stat?= =?UTF-8?q?us=20markers=20in=20the=20"Schedule"=20menu=20are=20now=20only?= =?UTF-8?q?=20updated=20if=20a=20submenu=20is=20=20=20closed=20in=20which?= =?UTF-8?q?=20a=20timer=20has=20been=20modified,=20which=20speeds=20up=20c?= =?UTF-8?q?losing=20submenus.=20-=20Now=20only=20writing=20Dolby=20Digital?= =?UTF-8?q?=20tracks=20into=20the=20'info.vdr'=20file=20of=20a=20recording?= =?UTF-8?q?=20=20=20if=20Setup.UseDolbyDigital=20is=20true=20(suggested=20?= =?UTF-8?q?by=20Andr=C3=A9=20Weidemann).=20-=20Added=20a=20leading=20'0'?= =?UTF-8?q?=20to=20the=20day=20in=20the=20DayDateTime()=20function=20(than?= =?UTF-8?q?ks=20to=20Rolf=20=20=20Ahrenberg).=20-=20No=20longer=20displayi?= =?UTF-8?q?ng=20color=20buttons=20in=20the=20recording=20info=20menu=20if?= =?UTF-8?q?=20it=20has=20been=20=20=20invoked=20from=20a=20player=20(repor?= =?UTF-8?q?ted=20by=20J=C3=BCrgen=20Schilling).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vdr.c | 54 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 24 deletions(-) (limited to 'vdr.c') diff --git a/vdr.c b/vdr.c index a476a25..bd4f950 100644 --- a/vdr.c +++ b/vdr.c @@ -22,7 +22,7 @@ * * The project's page is at http://www.cadsoft.de/vdr * - * $Id: vdr.c 1.233 2006/01/08 11:49:03 kls Exp $ + * $Id: vdr.c 1.238 2006/01/15 13:31:57 kls Exp $ */ #include @@ -157,14 +157,13 @@ int main(int argc, char *argv[]) // Command line options: -#define DEFAULTVDRUSER "vdr" #define DEFAULTSVDRPPORT 2001 #define DEFAULTWATCHDOG 0 // seconds #define DEFAULTPLUGINDIR PLUGINDIR #define DEFAULTEPGDATAFILENAME "epg.data" bool StartedAsRoot = false; - const char *VdrUser = DEFAULTVDRUSER; + const char *VdrUser = NULL; int SVDRPport = DEFAULTSVDRPPORT; const char *AudioCommand = NULL; const char *ConfigDirectory = NULL; @@ -192,6 +191,9 @@ int main(int argc, char *argv[]) #if defined(VFAT) VfatFileSystem = true; #endif +#if defined(VDR_USER) + VdrUser = VDR_USER; +#endif cPluginManager PluginManager(DEFAULTPLUGINDIR); int ExitCode = 0; @@ -337,16 +339,18 @@ int main(int argc, char *argv[]) // Set user id in case we were started as root: - if (getuid() == 0) { + if (VdrUser && getuid() == 0) { StartedAsRoot = true; - if (!SetKeepCaps(true)) - return 2; - if (!SetUser(VdrUser)) - return 2; - if (!SetKeepCaps(false)) - return 2; - if (!SetCapSysTime()) - return 2; + if (strcmp(VdrUser, "root")) { + if (!SetKeepCaps(true)) + return 2; + if (!SetUser(VdrUser)) + return 2; + if (!SetKeepCaps(false)) + return 2; + if (!SetCapSysTime()) + return 2; + } } // Help and version info: @@ -392,8 +396,8 @@ int main(int argc, char *argv[]) " -r CMD, --record=CMD call CMD before and after a recording\n" " -s CMD, --shutdown=CMD call CMD to shutdown the computer\n" " -t TTY, --terminal=TTY controlling tty\n" - " -u USER, --user=USER run as user USER (default: %s); only applicable\n" - " if started as root\n" + " -u USER, --user=USER run as user USER; only applicable if started as\n" + " root\n" " -v DIR, --video=DIR use DIR as video directory (default: %s)\n" " -V, --version print version information and exit\n" " --vfat encode special characters in recording names to\n" @@ -406,7 +410,6 @@ int main(int argc, char *argv[]) LIRC_DEVICE, DEFAULTSVDRPPORT, RCU_DEVICE, - DEFAULTVDRUSER, VideoDirectory, DEFAULTWATCHDOG ); @@ -471,7 +474,7 @@ int main(int argc, char *argv[]) } isyslog("VDR version %s started", VDRVERSION); - if (StartedAsRoot) + if (StartedAsRoot && VdrUser) isyslog("switched to user '%s'", VdrUser); if (DaemonMode) dsyslog("running as daemon (tid=%d)", cThread::ThreadId()); @@ -687,9 +690,10 @@ int main(int argc, char *argv[]) if (!Channels.BeingEdited() && !Timers.BeingEdited()) { int modified = Channels.Modified(); static time_t ChannelSaveTimeout = 0; + static int TimerState = 0; // Channels and timers need to be stored in a consistent manner, // therefore if one of them is changed, we save both. - if (modified == CHANNELSMOD_USER || Timers.Modified()) + if (modified == CHANNELSMOD_USER || Timers.Modified(TimerState)) ChannelSaveTimeout = 1; // triggers an immediate save else if (modified && !ChannelSaveTimeout) ChannelSaveTimeout = time(NULL) + CHANNELSAVEDELTA; @@ -785,14 +789,17 @@ int main(int argc, char *argv[]) // Keys that must work independent of any interactive mode: switch (key) { // Menu control: - case kMenu: + case kMenu: { key = kNone; // nobody else needs to see this key + bool WasOpen = Interact != NULL; + bool WasMenu = Interact && Interact->IsMenu(); if (Menu) DELETE_MENU; else if (cControl::Control() && cOsd::IsOpen()) cControl::Control()->Hide(); - else + if (!WasOpen || !WasMenu && !Setup.MenuButtonCloses) Menu = new cMenuMain; + } break; // Info: case kInfo: { @@ -978,6 +985,10 @@ int main(int argc, char *argv[]) } else { // Key functions in "normal" viewing mode: + if (KeyMacros.Get(key)) { + cRemote::PutMacro(key); + key = kNone; + } switch (key) { // Toggle channels: case k0: { @@ -1013,11 +1024,6 @@ int main(int argc, char *argv[]) cControl::Launch(new cReplayControl); } break; - // Key macros: - case kRed: - case kGreen: - case kYellow: - case kBlue: cRemote::PutMacro(key); break; default: break; } } -- cgit v1.2.3