The initial channel and volume can now be defined in the "Setup/Miscellaneous" menu

This commit is contained in:
Klaus Schmidinger 2006-04-09 13:26:56 +02:00
parent e36da7ab8d
commit 87ba3ae558
8 changed files with 98 additions and 5 deletions

View File

@ -1021,6 +1021,8 @@ Thomas Keil <tk@commedia-group.com>
3 seconds
for reporting a bug in handling the color buttons in the "Edit channel" menu
for adding a note about the config files of plugins to INSTALL
for a patch that was used as a base to implement setting the initial channel and
volume
Kenneth Aafløy <ke-aa@frisurf.no>
for fixing checking CA capabilities with the dvb-kernel driver

View File

@ -4490,3 +4490,5 @@ Video Disk Recorder Revision History
- cMenuEditIntItem and cMenuEditChanItem can now be given strings to label the
minimum and maximum values, and the case that no channel has been selected,
respectively.
- The initial channel and volume can now be defined in the "Setup/Miscellaneous"
menu (based on a patch from Thomas Keil).

9
MANUAL
View File

@ -779,6 +779,15 @@ Version 1.3
Zap Timeout = 3 The time (in seconds) until a channel counts as "previous"
for switching with '0'
Inital channel = 0 The number of the channel that shall be tuned to when
VDR starts. Default is 0, which means that it will
tune to the channel that was on before VDR was stopped.
Initial volume = -1 The volume that shall be set when VDR starts. Default
is -1, which means that the same volume as before
VDR was stopped will be used. The valid range is from
0 (silent) to 255 (loudest).
* Executing system commands
The "VDR" menu option "Commands" allows you to execute any system commands

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: config.c 1.142 2006/02/25 14:12:16 kls Exp $
* $Id: config.c 1.143 2006/04/09 12:12:01 kls Exp $
*/
#include "config.h"
@ -271,6 +271,8 @@ cSetup::cSetup(void)
CurrentChannel = -1;
CurrentVolume = MAXVOLUME;
CurrentDolby = 0;
InitialChannel = 0;
InitialVolume = -1;
}
cSetup& cSetup::operator= (const cSetup &s)
@ -430,6 +432,8 @@ bool cSetup::Parse(const char *Name, const char *Value)
else if (!strcasecmp(Name, "CurrentChannel")) CurrentChannel = atoi(Value);
else if (!strcasecmp(Name, "CurrentVolume")) CurrentVolume = atoi(Value);
else if (!strcasecmp(Name, "CurrentDolby")) CurrentDolby = atoi(Value);
else if (!strcasecmp(Name, "InitialChannel")) InitialChannel = atoi(Value);
else if (!strcasecmp(Name, "InitialVolume")) InitialVolume = atoi(Value);
else
return false;
return true;
@ -496,6 +500,8 @@ bool cSetup::Save(void)
Store("CurrentChannel", CurrentChannel);
Store("CurrentVolume", CurrentVolume);
Store("CurrentDolby", CurrentDolby);
Store("InitialChannel", InitialChannel);
Store("InitialVolume", InitialVolume);
Sort();

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: config.h 1.248 2006/03/31 12:41:50 kls Exp $
* $Id: config.h 1.249 2006/04/09 12:09:05 kls Exp $
*/
#ifndef __CONFIG_H
@ -237,6 +237,8 @@ public:
int CurrentChannel;
int CurrentVolume;
int CurrentDolby;
int InitialChannel;
int InitialVolume;
int __EndData__;
cSetup(void);
cSetup& operator= (const cSetup &s);

68
i18n.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: i18n.c 1.254 2006/04/08 13:52:28 kls Exp $
* $Id: i18n.c 1.255 2006/04/09 13:04:50 kls Exp $
*
* Translations provided by:
*
@ -4404,6 +4404,72 @@ const tI18nPhrase Phrases[] = {
"Zap timeout (s)",
"Èasový limit Zap (s)",
},
{ "Setup.Miscellaneous$Initial channel",
"Kanal beim Einschalten",
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
},
{ "Setup.Miscellaneous$Initial volume",
"Lautstärke beim Einschalten",
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
},
{ "Setup.Miscellaneous$as before",
"wie vorher",
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
},
// The days of the week:
{ "MTWTFSS",
"MDMDFSS",

4
menu.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: menu.c 1.426 2006/04/09 12:00:15 kls Exp $
* $Id: menu.c 1.427 2006/04/09 13:13:33 kls Exp $
*/
#include "menu.h"
@ -2584,6 +2584,8 @@ cMenuSetupMisc::cMenuSetupMisc(void)
Add(new cMenuEditIntItem( tr("Setup.Miscellaneous$Min. user inactivity (min)"), &data.MinUserInactivity));
Add(new cMenuEditIntItem( tr("Setup.Miscellaneous$SVDRP timeout (s)"), &data.SVDRPTimeout));
Add(new cMenuEditIntItem( tr("Setup.Miscellaneous$Zap timeout (s)"), &data.ZapTimeout));
Add(new cMenuEditChanItem(tr("Setup.Miscellaneous$Initial channel"), &data.InitialChannel, tr("Setup.Miscellaneous$as before")));
Add(new cMenuEditIntItem( tr("Setup.Miscellaneous$Initial volume"), &data.InitialVolume, -1, 255, tr("Setup.Miscellaneous$as before")));
}
// --- cMenuSetupPluginItem --------------------------------------------------

6
vdr.c
View File

@ -22,7 +22,7 @@
*
* The project's page is at http://www.cadsoft.de/vdr
*
* $Id: vdr.c 1.253 2006/04/09 09:10:41 kls Exp $
* $Id: vdr.c 1.254 2006/04/09 12:22:46 kls Exp $
*/
#include <getopt.h>
@ -632,6 +632,10 @@ int main(int argc, char *argv[])
if (!cDevice::WaitForAllDevicesReady(DEVICEREADYTIMEOUT))
dsyslog("not all devices ready after %d seconds", DEVICEREADYTIMEOUT);
if (Setup.InitialChannel > 0)
Setup.CurrentChannel = Setup.InitialChannel;
if (Setup.InitialVolume >= 0)
Setup.CurrentVolume = Setup.InitialVolume;
Channels.SwitchTo(Setup.CurrentChannel);
if (MuteAudio)
cDevice::PrimaryDevice()->ToggleMute();