From 217fcb26808f74c9de81b4c653757f75ba13852f Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 17 Mar 2002 18:00:00 +0100 Subject: =?UTF-8?q?Version=201.0.0pre4=20-=20Added=20'Ca'=20code=20201=20f?= =?UTF-8?q?or=20'Cryptoworks,=20GOD-DIGITAL'=20to=20'ca.conf'=20(thanks=20?= =?UTF-8?q?to=20=20=20Bernd=20Schweikert).=20-=20Fixed=20avoiding=20the=20?= =?UTF-8?q?primary=20DVB=20interface=20in=20case=20Setup.PrimaryLimit=20is?= =?UTF-8?q?=200.=20-=20Fixed=20handling=20CICAM=20settings=20if=20the=20fi?= =?UTF-8?q?rst=20one=20of=20a=20DVB=20card=20was=20FTA.=20-=20Fixed=20reac?= =?UTF-8?q?ting=20on=20changes=20in=20CICAM=20settings=20(needed=20to=20re?= =?UTF-8?q?start=20VDR=20before).=20-=20The=20"Blue"=20button=20in=20the?= =?UTF-8?q?=20"Main"=20menu=20now=20works=20as=20"Stop"=20button=20if=20a?= =?UTF-8?q?=20recording=20=20=20is=20currently=20being=20replayed.=20-=20N?= =?UTF-8?q?ew=20command=20line=20option=20'-m'=20to=20mute=20audio=20of=20?= =?UTF-8?q?the=20primary=20DVB=20device=20at=20=20=20startup=20(suggested?= =?UTF-8?q?=20by=20Mirko=20G=FCnther).=20-=20The=20new=20SVDRP=20command?= =?UTF-8?q?=20VOLU=20can=20be=20used=20to=20control=20the=20audio=20volume?= =?UTF-8?q?=20(suggested=20=20=20by=20Mirko=20G=FCnther).=20-=20Fixed=20re?= =?UTF-8?q?setting=20'mute'=20state=20when=20setting=20the=20volume=20to?= =?UTF-8?q?=20a=20non-zero=20value.=20-=20Added=20log=20messages=20when=20?= =?UTF-8?q?deleting=20recordings=20in=20case=20the=20disk=20runs=20full=20?= =?UTF-8?q?while=20=20=20recording.=20-=20Fixed=20closing=20a=20pipe=20(us?= =?UTF-8?q?ed=20for=20replaying=20Dolby=20Digital=20audio),=20which=20=20?= =?UTF-8?q?=20sometimes=20left=20'zombie'=20processes=20behind=20(thanks?= =?UTF-8?q?=20to=20Werner=20Fink=20for=20helping=20=20=20to=20debug=20this?= =?UTF-8?q?=20one).=20-=20Now=20starting=20the=20Dolby=20Digital=20output?= =?UTF-8?q?=20thread=20only=20if=20the=20recording=20actually=20=20=20cont?= =?UTF-8?q?ains=20Dolby=20Digital=20audio=20data=20(thanks=20to=20Werner?= =?UTF-8?q?=20Fink).=20-=20Implemented=20OSD=20for=20Volume=20and=20Mute?= =?UTF-8?q?=20(works=20only=20if=20there=20is=20no=20other=20OSD=20=20=20a?= =?UTF-8?q?ctivity,=20but=20this=20should=20be=20no=20problem=20for=20norm?= =?UTF-8?q?al=20use).=20-=20Changed=20the=20MANUAL=20description=20of=20th?= =?UTF-8?q?e=20"Conditional=20Access"=20setup=20parameters=20=20=20to=20re?= =?UTF-8?q?flect=20the=20actual=20"CICAM=20DVBn=20m"=20notation=20in=20the?= =?UTF-8?q?=20"Setup"=20menu.=20-=20The=20new=20Setup=20parameter=20"Use?= =?UTF-8?q?=20time=20from=20transponder"=20can=20be=20used=20to=20define?= =?UTF-8?q?=20which=20=20=20transponder=20shall=20be=20used=20to=20set=20t?= =?UTF-8?q?he=20system=20time=20(see=20MANUAL=20for=20details).=20=20=20If?= =?UTF-8?q?=20you=20have=20been=20using=20the=20SetSystemTime=20option=20p?= =?UTF-8?q?reviously,=20you=20now=20MUST=20=20=20select=20a=20channel=20th?= =?UTF-8?q?at=20you=20trust=20to=20have=20a=20reliable=20time=20base.=20-?= =?UTF-8?q?=20Grouped=20the=20Setup=20parameters=20into=20several=20sub-me?= =?UTF-8?q?nus,=20so=20that=20each=20group=20of=20=20=20parameters=20fits?= =?UTF-8?q?=20on=20a=20single=20screen=20-=20unless=20the=20height=20of=20?= =?UTF-8?q?the=20OSD=20has=20been=20=20=20set=20to=20a=20small=20value=20(?= =?UTF-8?q?based=20on=20code=20from=20Markus=20Lang).=20-=20Changed=20the?= =?UTF-8?q?=20title=20of=20the=20"Main"=20menu=20to=20"VDR".=20-=20Fixed?= =?UTF-8?q?=20displaying=20a=20system=20message=20while=20the=20replay=20m?= =?UTF-8?q?ode=20is=20being=20shown.=20-=20Physically=20removing=20a=20del?= =?UTF-8?q?eted=20recording=20if=20one=20with=20the=20same=20name=20shall?= =?UTF-8?q?=20be=20=20=20deleted=20again.=20-=20The=20"Left"=20and=20"Righ?= =?UTF-8?q?t"=20keys=20are=20now=20used=20to=20page=20up=20and=20down=20in?= =?UTF-8?q?=20text=20displays=20=20=20(like=20the=20EPG=20descriptions=20o?= =?UTF-8?q?r=20the=20results=20of=20commands=20executed=20from=20the=20=20?= =?UTF-8?q?=20"Commands"=20menu).=20-=20Fixed=20high=20CPU=20usage=20in=20?= =?UTF-8?q?transfer=20mode.=20-=20Replaced=20'killproc'=20with=20'killall'?= =?UTF-8?q?=20in=20'runvdr',=20since=20apparently=20'killproc'=20=20=20is?= =?UTF-8?q?=20not=20available=20by=20default=20on=20some=20Linux=20distrib?= =?UTF-8?q?utions,=20whereas=20'killall'=20is.=20=20=20Please=20check=20if?= =?UTF-8?q?=20your=20system=20provides=20'killall'=20-=20if=20it=20doesn't?= =?UTF-8?q?,=20please=20change=20=20=20this=20back=20in=20'runvdr'=20and?= =?UTF-8?q?=20report=20this=20(thanks=20to=20Achim=20Lange).=20-=20The=20"?= =?UTF-8?q?Commands"=20menu=20now=20automatically=20assigns=20number=20key?= =?UTF-8?q?s=20as=20hotkeys=20to=20the=20=20=20commands.=20If=20you=20have?= =?UTF-8?q?=20preceeded=20your=20commands=20with=20digits=20you=20may=20wa?= =?UTF-8?q?nt=20to=20=20=20remove=20these=20from=20your=20'commands.conf'?= =?UTF-8?q?=20file.=20-=20The=20new=20Setup=20item=20"Restart"=20can=20be?= =?UTF-8?q?=20used=20to=20force=20a=20complete=20restart=20of=20VDR,=20=20?= =?UTF-8?q?=20including=20reloading=20the=20driver.=20Note=20that=20this?= =?UTF-8?q?=20can=20only=20work=20if=20VDR=20and=20the=20=20=20driver=20ar?= =?UTF-8?q?e=20wrapped=20into=20a=20mechanism=20that=20actually=20performs?= =?UTF-8?q?=20this=20action=20if=20VDR=20=20=20exits.=20The=20'runvdr'=20s?= =?UTF-8?q?cript=20can=20be=20used=20for=20this=20purpose.=20-=20Refined?= =?UTF-8?q?=20texts=20of=20the=20"Setup"=20menu.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vdr.c | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'vdr.c') diff --git a/vdr.c b/vdr.c index a246be1..17ae148 100644 --- a/vdr.c +++ b/vdr.c @@ -22,7 +22,7 @@ * * The project's page is at http://www.cadsoft.de/people/kls/vdr * - * $Id: vdr.c 1.98 2002/03/03 14:56:03 kls Exp $ + * $Id: vdr.c 1.101 2002/03/09 17:10:16 kls Exp $ */ #include @@ -50,8 +50,6 @@ #define SHUTDOWNWAIT 300 // seconds to wait in user prompt before automatic shutdown #define MANUALSTART 600 // seconds the next timer must be in the future to assume manual start -#define VOLUMEDELTA 5 // used to increase/decrease the volume - static int Interrupted = 0; static void SignalHandler(int signum) @@ -85,6 +83,7 @@ int main(int argc, char *argv[]) int SVDRPport = DEFAULTSVDRPPORT; const char *ConfigDirectory = NULL; bool DaemonMode = false; + bool MuteAudio = false; int WatchdogTimeout = DEFAULTWATCHDOG; const char *Terminal = NULL; const char *Shutdown = NULL; @@ -97,6 +96,7 @@ int main(int argc, char *argv[]) { "epgfile", required_argument, NULL, 'E' }, { "help", no_argument, NULL, 'h' }, { "log", required_argument, NULL, 'l' }, + { "mute", no_argument, NULL, 'm' }, { "port", required_argument, NULL, 'p' }, { "record", required_argument, NULL, 'r' }, { "shutdown", required_argument, NULL, 's' }, @@ -108,7 +108,7 @@ int main(int argc, char *argv[]) int c; int option_index = 0; - while ((c = getopt_long(argc, argv, "a:c:dD:E:hl:p:r:s:t:v:w:", long_options, &option_index)) != -1) { + while ((c = getopt_long(argc, argv, "a:c:dD:E:hl:mp:r:s:t:v:w:", long_options, &option_index)) != -1) { switch (c) { case 'a': cDvbApi::SetAudioCommand(optarg); break; @@ -143,6 +143,7 @@ int main(int argc, char *argv[]) " -l LEVEL, --log=LEVEL set log level (default: 3)\n" " 0 = no logging, 1 = errors only,\n" " 2 = errors and info, 3 = errors, info and debug\n" + " -m, --mute mute audio of the primary DVB device at startup\n" " -p PORT, --port=PORT use PORT for SVDRP (default: %d)\n" " 0 turns off SVDRP\n" " -r CMD, --record=CMD call CMD before and after a recording\n" @@ -170,6 +171,8 @@ int main(int argc, char *argv[]) fprintf(stderr, "vdr: invalid log level: %s\n", optarg); return 2; break; + case 'm': MuteAudio = true; + break; case 'p': if (isnumber(optarg)) SVDRPport = atoi(optarg); else { @@ -269,7 +272,10 @@ int main(int argc, char *argv[]) cSIProcessor::Read(); Channels.SwitchTo(Setup.CurrentChannel); - cDvbApi::PrimaryDvbApi->SetVolume(Setup.CurrentVolume, true); + if (MuteAudio) + cDvbApi::PrimaryDvbApi->ToggleMute(); + else + cDvbApi::PrimaryDvbApi->SetVolume(Setup.CurrentVolume, true); cEITScanner EITScanner; @@ -351,10 +357,16 @@ int main(int argc, char *argv[]) case kVolUp: case kVolDn|k_Repeat: case kVolDn: - cDvbApi::PrimaryDvbApi->SetVolume(NORMALKEY(key) == kVolDn ? -VOLUMEDELTA : VOLUMEDELTA); - break; case kMute: - cDvbApi::PrimaryDvbApi->ToggleMute(); + if (key == kMute) { + if (!cDvbApi::PrimaryDvbApi->ToggleMute() && !Menu) + break; // no need to display "mute off" + } + else + cDvbApi::PrimaryDvbApi->SetVolume(NORMALKEY(key) == kVolDn ? -VOLUMEDELTA : VOLUMEDELTA); + if (!Menu && (!ReplayControl || !ReplayControl->Visible())) + Menu = cDisplayVolume::Create(); + cDisplayVolume::Process(key); break; // Power off: case kPower: isyslog(LOG_INFO, "Power button pressed"); -- cgit v1.2.3