mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
The initial channel is now stored by the channel ID in the setup.conf file
This commit is contained in:
parent
61a9b09403
commit
263dc29508
@ -1028,6 +1028,8 @@ Marc Rovira Vall <tm05462@salleURL.edu>, Ramon Roca <ramon.roca@xcombo.com> and
|
||||
Lars Bläser <LBlaeser@hofheim.de>
|
||||
for reporting a bug in EPG bugfix statistics which made log entries for undefined
|
||||
channels
|
||||
for reporting a problem with the initial channel in case channels are reordered or
|
||||
deleted
|
||||
|
||||
Niko Tarnanen <niko.tarnanen@hut.fi>
|
||||
for translating OSD texts to the Finnish language
|
||||
|
5
HISTORY
5
HISTORY
@ -6607,7 +6607,7 @@ Video Disk Recorder Revision History
|
||||
- Avoiding an unecessary call to Recordings.ResetResume() (thanks to Reinhard
|
||||
Nissl).
|
||||
|
||||
2011-06-12: Version 1.7.19
|
||||
2011-06-13: Version 1.7.19
|
||||
|
||||
- Fixed cString's operator=(const char *String) in case the given string is the
|
||||
same as the existing one (thanks to Dirk Leber).
|
||||
@ -6644,3 +6644,6 @@ Video Disk Recorder Revision History
|
||||
that new value is not the default value (thanks to Derek Kelly for reporting a
|
||||
problem with the fps value being overwritten in case a recording was interrupted
|
||||
and resumed, and the fps value could not be determined after resuming recording).
|
||||
- The initial channel is now stored by the channel ID in the setup.conf file, in
|
||||
order to avoid problems in case channels are reordered or deleted (reported by
|
||||
Lars Bläser).
|
||||
|
4
MANUAL
4
MANUAL
@ -885,8 +885,8 @@ Version 1.6
|
||||
key. Note that the total maximum is also limited by
|
||||
the "OSD/Channel info time" parameter.
|
||||
|
||||
Initial channel = 0 The number of the channel that shall be tuned to when
|
||||
VDR starts. Default is 0, which means that it will
|
||||
Initial channel = The channel ID of the channel that shall be tuned to when
|
||||
VDR starts. Default is empty, 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
|
||||
|
7
config.c
7
config.c
@ -4,7 +4,7 @@
|
||||
* See the main source file 'vdr.c' for copyright information and
|
||||
* how to reach the author.
|
||||
*
|
||||
* $Id: config.c 2.13 2010/06/06 10:06:43 kls Exp $
|
||||
* $Id: config.c 2.14 2011/06/13 14:41:01 kls Exp $
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
@ -395,7 +395,7 @@ cSetup::cSetup(void)
|
||||
CurrentChannel = -1;
|
||||
CurrentVolume = MAXVOLUME;
|
||||
CurrentDolby = 0;
|
||||
InitialChannel = 0;
|
||||
// InitialChannel is initialized by constructor
|
||||
InitialVolume = -1;
|
||||
ChannelsWrap = 0;
|
||||
EmergencyExit = 1;
|
||||
@ -404,6 +404,7 @@ cSetup::cSetup(void)
|
||||
cSetup& cSetup::operator= (const cSetup &s)
|
||||
{
|
||||
memcpy(&__BeginData__, &s.__BeginData__, (char *)&s.__EndData__ - (char *)&s.__BeginData__);
|
||||
InitialChannel = s.InitialChannel;
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -586,7 +587,7 @@ 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, "InitialChannel")) InitialChannel = Value;
|
||||
else if (!strcasecmp(Name, "InitialVolume")) InitialVolume = atoi(Value);
|
||||
else if (!strcasecmp(Name, "ChannelsWrap")) ChannelsWrap = atoi(Value);
|
||||
else if (!strcasecmp(Name, "EmergencyExit")) EmergencyExit = atoi(Value);
|
||||
|
4
config.h
4
config.h
@ -4,7 +4,7 @@
|
||||
* See the main source file 'vdr.c' for copyright information and
|
||||
* how to reach the author.
|
||||
*
|
||||
* $Id: config.h 2.31 2011/05/15 11:46:30 kls Exp $
|
||||
* $Id: config.h 2.32 2011/06/13 14:24:40 kls Exp $
|
||||
*/
|
||||
|
||||
#ifndef __CONFIG_H
|
||||
@ -287,11 +287,11 @@ public:
|
||||
int CurrentChannel;
|
||||
int CurrentVolume;
|
||||
int CurrentDolby;
|
||||
int InitialChannel;
|
||||
int InitialVolume;
|
||||
int ChannelsWrap;
|
||||
int EmergencyExit;
|
||||
int __EndData__;
|
||||
cString InitialChannel;
|
||||
cSetup(void);
|
||||
cSetup& operator= (const cSetup &s);
|
||||
bool Load(const char *FileName);
|
||||
|
16
menuitems.c
16
menuitems.c
@ -4,7 +4,7 @@
|
||||
* See the main source file 'vdr.c' for copyright information and
|
||||
* how to reach the author.
|
||||
*
|
||||
* $Id: menuitems.c 2.8 2010/12/12 13:41:09 kls Exp $
|
||||
* $Id: menuitems.c 2.9 2011/06/13 14:48:41 kls Exp $
|
||||
*/
|
||||
|
||||
#include "menuitems.h"
|
||||
@ -713,7 +713,19 @@ void cMenuEditStraItem::Set(void)
|
||||
cMenuEditChanItem::cMenuEditChanItem(const char *Name, int *Value, const char *NoneString)
|
||||
:cMenuEditIntItem(Name, Value, NoneString ? 0 : 1, Channels.MaxNumber())
|
||||
{
|
||||
channelID = NULL;
|
||||
noneString = NoneString;
|
||||
dummyValue = 0;
|
||||
Set();
|
||||
}
|
||||
|
||||
cMenuEditChanItem::cMenuEditChanItem(const char *Name, cString *ChannelID, const char *NoneString)
|
||||
:cMenuEditIntItem(Name, &dummyValue, NoneString ? 0 : 1, Channels.MaxNumber())
|
||||
{
|
||||
channelID = ChannelID;
|
||||
noneString = NoneString;
|
||||
cChannel *channel = Channels.GetByChannelID(tChannelID::FromString(*ChannelID));
|
||||
dummyValue = channel ? channel->Number() : 0;
|
||||
Set();
|
||||
}
|
||||
|
||||
@ -744,6 +756,8 @@ eOSState cMenuEditChanItem::ProcessKey(eKeys Key)
|
||||
*value = channel->Number();
|
||||
else if (delta < 0 && noneString)
|
||||
*value = 0;
|
||||
if (channelID)
|
||||
*channelID = channel ? channel->GetChannelID().ToString() : "";
|
||||
Set();
|
||||
}
|
||||
break;
|
||||
|
@ -4,7 +4,7 @@
|
||||
* See the main source file 'vdr.c' for copyright information and
|
||||
* how to reach the author.
|
||||
*
|
||||
* $Id: menuitems.h 2.4 2010/06/06 10:32:38 kls Exp $
|
||||
* $Id: menuitems.h 2.5 2011/06/13 13:46:03 kls Exp $
|
||||
*/
|
||||
|
||||
#ifndef __MENUITEMS_H
|
||||
@ -133,9 +133,12 @@ public:
|
||||
class cMenuEditChanItem : public cMenuEditIntItem {
|
||||
protected:
|
||||
const char *noneString;
|
||||
int dummyValue;
|
||||
cString *channelID;
|
||||
virtual void Set(void);
|
||||
public:
|
||||
cMenuEditChanItem(const char *Name, int *Value, const char *NoneString = NULL);
|
||||
cMenuEditChanItem(const char *Name, cString *ChannelID, const char *NoneString = NULL);
|
||||
virtual eOSState ProcessKey(eKeys Key);
|
||||
};
|
||||
|
||||
|
10
vdr.c
10
vdr.c
@ -22,7 +22,7 @@
|
||||
*
|
||||
* The project's page is at http://www.tvdr.de
|
||||
*
|
||||
* $Id: vdr.c 2.20 2010/12/12 13:42:00 kls Exp $
|
||||
* $Id: vdr.c 2.21 2011/06/13 14:40:12 kls Exp $
|
||||
*/
|
||||
|
||||
#include <getopt.h>
|
||||
@ -704,8 +704,12 @@ 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 (isnumber(Setup.InitialChannel)) { // for compatibility with old setup.conf files
|
||||
if (cChannel *Channel = Channels.GetByNumber(atoi(Setup.InitialChannel)))
|
||||
Setup.InitialChannel = Channel->GetChannelID().ToString();
|
||||
}
|
||||
if (cChannel *Channel = Channels.GetByChannelID(tChannelID::FromString(Setup.InitialChannel)))
|
||||
Setup.CurrentChannel = Channel->Number();
|
||||
if (Setup.InitialVolume >= 0)
|
||||
Setup.CurrentVolume = Setup.InitialVolume;
|
||||
Channels.SwitchTo(Setup.CurrentChannel);
|
||||
|
Loading…
Reference in New Issue
Block a user