Commit 313e3353 authored by Klaus Schmidinger's avatar Klaus Schmidinger

Version 1.1.12

- Fixed a missing Flush() call in the remote control learning procedure (thanks
  to Oliver Endriss).
- Modified channel handling to cover all parameters necessary for DVB-C and DVB-T
  (see man vdr(5) for the meaning of the additional parameters stored in the field
  previously named 'polarisation'). Thanks to Uwe Scheffler and Andy Carter for testing.
  If you have a system with different kinds of DVB cards, like DVB-T and DVB-C,
  for instance, there is no more need to distinguish the channels through the
  'Ca' parameter in order to assign them to the various DVB cards. This is now
  taken care of by the "source" parameter. So a channel marked as "terrestrial",
  for example, will only be received on DVB-T cards.
  Note that the cChannel class has been moved into a separate file (channels.[ch]),
  and that all data members have been made private and are now only accessible
  through member functions. You may have to change any plugin code that accesses
  cChannel data accordingly.
- The new configuration file 'sources.conf' contains the various signal sources
  (satellites, cable and terrestrial) which are used in 'channels.conf' and
  'diseqc.conf' (thanks to Reinhard Walter Buchner for adding some satellites to
  'sources.conf' and Oliver Endriss and Lauri Tischler for testing and debugging).
- The 'diseqc' parameter in the channel definitions has been redefined to hold the
  "source" of the given channel (which can be either a satellite, cable or terrestrial).
  For compatibility with channels.conf files from older versions, numeric values in
  this parameter will be tolerated, but they have no meaning. If you want to use
  DiSEqC you will need to replace these old values with the proper source identifiers
  defined in the new configuration file 'sources.conf'. See how this is done in the
  'channels.conf' file that comes with the VDR package.
- The new configuration file 'diseqc.conf' can be used to set up the individual
  diseqc configuration (see man vdr(5) for a description of the file format).
- The "Edit channel" menu has a new entry "Source:" in which the source of this
  channel can be selected (either a satellite, cable or terrestrial). The set of
  parameters at the end of this menu will change according to the type of source.
- The "Use DiSEqC" parameter in the "Setup/LNB" menu has been moved to the beginning
  of the list and disables the rest of the parameters when set to "yes", since these
  are now only meaningful if DiSEqC is _not_ used.
- Removed some unnecessary #includes from eit.c and changed cMenuRecordings::Del()
  to cMenuRecordings::Delete() to avoid warnings in gcc-3.2 (thanks to Andreas
  Schultz for pointing this out).
- Improved skipping channels that are (currently) not available (thanks to Stefan
  Huelswitt).
- Updated channels.conf.terr and channels.conf.cable (thanks to Uwe Scheffler).
- Fixed a bug when pressing the "Blue" button in the main menu without having
  displayed it (thanks to Oliver Endriss for reporting this one).
parent d0807381
......@@ -152,6 +152,7 @@ Stefan Huelswitt <huels@iname.com>
for making cStatus::MsgChannelSwitch() only be called if a channel is actually going to
be switched or has actually been switched successfully
for adding a missing StripAudioPackets() to cDvbPlayer::Action()
for improving skipping channels that are (currently) not available
Ulrich Röder <roeder@efr-net.de>
for pointing out that there are channels that have a symbol rate higher than
......@@ -176,6 +177,8 @@ Andreas Schultz <aschultz@warp10.net>
for implementing an SPU decoder
for fixing opening /dev/video in cDvbDevice::GrabImage() in case of NEWSTRUCT driver
for reporting a problem with plugin Makefiles and the NEWSTRUCT driver
for pointing out some unnecessary #includes in eit.c and a problem with
cMenuRecordings::Del(), which caused warnings with gcc-3.2
Aaron Holtzman
for writing 'ac3dec'
......@@ -184,7 +187,8 @@ Wolfgang Henselmann-Weiss <Wolfgang_Henselmann@betaresearch.de>
for fixing calculating the timeout value in cFile::FileReady()
Uwe Scheffler <UweScheffler@t-online.de>
for his help in keeping 'channels.conf.cable' up to date
for his help in keeping 'channels.conf.cable' and 'channels.conf.terr' up to date
for helping to test new DVB-T handling
Matjaz Thaler <matjaz.thaler@guest.arnes.si>
for improving AC3 decoding when replaying DVDs
......@@ -400,7 +404,22 @@ J
for adding some missing #includes to files in libdtv for gcc 3.2
Helmut Auer <vdr@helmutauer.de>
for reporting a superfluous error message in cLockFile.
for reporting a superfluous error message in cLockFile
Jeremy Hall <jhall@UU.NET>
for fixing an incomplete initialization of the filter parameters in eit.c
Oliver Endriss <o.endriss@gmx.de>
for fixing a missing Flush() call in the remote control learning procedure
for helping to test and debug the new channel source and DiSEqC handling
for reporting a bug when pressing the "Blue" button in the main menu without
having displayed it
Reinhard Walter Buchner <rw.buchner@freenet.de>
for adding some satellites to 'sources.conf'
Lauri Tischler <lauri.tischler@efore.fi>
for helping to test and debug the new channel source and DiSEqC handling
Andy Carter <fruit@ukgateway.net>
for helping to test new DVB-T handling
......@@ -93,7 +93,7 @@ Video Disk Recorder Revision History
- The program can now run in full background mode by using the --daemon option.
- Added a "summary" field to the timers (thanks to Carsten Koch!).
This field can contain a descriptive text of the programme and will be
displayed when the "Blue" key is pressed on a recording that was created by
displayed when the "Blue" button is pressed on a recording that was created by
this timer. If the text contains the special character '|', a newline will
be inserted at that place. When pressing "Ok" on a timer that contains a
summary field, the summary will be displayed. To edit such a timer the "Red"
......@@ -1535,3 +1535,47 @@ Video Disk Recorder Revision History
- Fixed handling DVD subtitles in the SPU decoder (thanks to Andreas Schultz).
- Avoiding restarts due to 'panic level' when switching channels on the primary
device during EPG scan.
2002-10-06: Version 1.1.12
- Fixed a missing Flush() call in the remote control learning procedure (thanks
to Oliver Endriss).
- Modified channel handling to cover all parameters necessary for DVB-C and DVB-T
(see man vdr(5) for the meaning of the additional parameters stored in the field
previously named 'polarisation'). Thanks to Uwe Scheffler and Andy Carter for testing.
If you have a system with different kinds of DVB cards, like DVB-T and DVB-C,
for instance, there is no more need to distinguish the channels through the
'Ca' parameter in order to assign them to the various DVB cards. This is now
taken care of by the "source" parameter. So a channel marked as "terrestrial",
for example, will only be received on DVB-T cards.
Note that the cChannel class has been moved into a separate file (channels.[ch]),
and that all data members have been made private and are now only accessible
through member functions. You may have to change any plugin code that accesses
cChannel data accordingly.
- The new configuration file 'sources.conf' contains the various signal sources
(satellites, cable and terrestrial) which are used in 'channels.conf' and
'diseqc.conf' (thanks to Reinhard Walter Buchner for adding some satellites to
'sources.conf' and Oliver Endriss and Lauri Tischler for testing and debugging).
- The 'diseqc' parameter in the channel definitions has been redefined to hold the
"source" of the given channel (which can be either a satellite, cable or terrestrial).
For compatibility with channels.conf files from older versions, numeric values in
this parameter will be tolerated, but they have no meaning. If you want to use
DiSEqC you will need to replace these old values with the proper source identifiers
defined in the new configuration file 'sources.conf'. See how this is done in the
'channels.conf' file that comes with the VDR package.
- The new configuration file 'diseqc.conf' can be used to set up the individual
diseqc configuration (see man vdr(5) for a description of the file format).
- The "Edit channel" menu has a new entry "Source:" in which the source of this
channel can be selected (either a satellite, cable or terrestrial). The set of
parameters at the end of this menu will change according to the type of source.
- The "Use DiSEqC" parameter in the "Setup/LNB" menu has been moved to the beginning
of the list and disables the rest of the parameters when set to "yes", since these
are now only meaningful if DiSEqC is _not_ used.
- Removed some unnecessary #includes from eit.c and changed cMenuRecordings::Del()
to cMenuRecordings::Delete() to avoid warnings in gcc-3.2 (thanks to Andreas
Schultz for pointing this out).
- Improved skipping channels that are (currently) not available (thanks to Stefan
Huelswitt).
- Updated channels.conf.terr and channels.conf.cable (thanks to Uwe Scheffler).
- Fixed a bug when pressing the "Blue" button in the main menu without having
displayed it (thanks to Oliver Endriss for reporting this one).
......@@ -4,7 +4,7 @@
# See the main source file 'vdr.c' for copyright information and
# how to reach the author.
#
# $Id: Makefile 1.47 2002/09/28 14:12:43 kls Exp $
# $Id: Makefile 1.48 2002/10/04 14:29:14 kls Exp $
.DELETE_ON_ERROR:
......@@ -32,10 +32,11 @@ endif
DTVLIB = $(DTVDIR)/libdtv.a
OBJS = audio.o config.o cutter.o device.o dvbdevice.o dvbosd.o dvbplayer.o dvbspu.o eit.o eitscan.o font.o i18n.o\
interface.o keys.o lirc.o menu.o menuitems.o osdbase.o osd.o player.o plugin.o rcu.o receiver.o\
recorder.o recording.o remote.o remux.o ringbuffer.o spu.o status.o svdrp.o thread.o\
tools.o transfer.o vdr.o videodir.o
OBJS = audio.o channels.o config.o cutter.o device.o diseqc.o dvbdevice.o dvbosd.o\
dvbplayer.o dvbspu.o eit.o eitscan.o font.o i18n.o interface.o keys.o\
lirc.o menu.o menuitems.o osdbase.o osd.o player.o plugin.o rcu.o\
receiver.o recorder.o recording.o remote.o remux.o ringbuffer.o sources.o\
spu.o status.o svdrp.o thread.o tools.o transfer.o vdr.o videodir.o
OSDFONT = -adobe-helvetica-medium-r-normal--23-*-100-100-p-*-iso8859-1
FIXFONT = -adobe-courier-bold-r-normal--25-*-100-100-m-*-iso8859-1
......
......@@ -21,18 +21,18 @@ VDR program and present itself to the user.
The <i>inside</i> interface provides the plugin code access to VDR's internal data
structures and allows it to hook itself into specific areas to perform special actions.
<p>
<!--X1.1.7--><table width=100%><tr><td bgcolor=#0000AA>&nbsp;</td><td width=100%>
Important modifications introduced in version 1.1.7 are marked like this.
<!--X1.1.7--></td></tr></table>
<!--X1.1.8--><table width=100%><tr><td bgcolor=#00AA00>&nbsp;</td><td width=100%>
<!--X1.1.8--><table width=100%><tr><td bgcolor=#0000AA>&nbsp;</td><td width=100%>
Important modifications introduced in version 1.1.8 are marked like this.
<!--X1.1.8--></td></tr></table>
<!--X1.1.9--><table width=100%><tr><td bgcolor=#AA0000>&nbsp;</td><td width=100%>
<!--X1.1.9--><table width=100%><tr><td bgcolor=#00AA00>&nbsp;</td><td width=100%>
Important modifications introduced in version 1.1.9 are marked like this.
<!--X1.1.9--></td></tr></table>
<!--X1.1.11--><table width=100%><tr><td bgcolor=#FF0000>&nbsp;</td><td width=100%>
<!--X1.1.11--><table width=100%><tr><td bgcolor=#AA0000>&nbsp;</td><td width=100%>
Important modifications introduced in version 1.1.11 are marked like this.
<!--X1.1.11--></td></tr></table>
<!--X1.1.12--><table width=100%><tr><td bgcolor=#FF0000>&nbsp;</td><td width=100%>
Important modifications introduced in version 1.1.12 are marked like this.
<!--X1.1.12--></td></tr></table>
<a name="Part I - The Outside Interface"><hr><center><h1>Part I - The Outside Interface</h1></center>
......@@ -957,7 +957,6 @@ stream. There are no prerequisites regarding the length or alignment of an
individual block of data. The sum of all blocks must simply result in the
desired video data stream, and it must be delivered fast enough so that the
DVB device doesn't run out of data.
<!--X1.1.7--><table width=100%><tr><td bgcolor=#0000AA>&nbsp;</td><td width=100%>
To avoid busy loops the player should call its member function
<p><table><tr><td bgcolor=#F0F0F0><pre><br>
......@@ -965,7 +964,6 @@ bool DevicePoll(cPoller &amp;Poller, int TimeoutMs = 0);
</pre></td></tr></table><p>
to determine whether the device is ready for further data.
<!--X1.1.7--></td></tr></table>
<p>
TODO: PlayAudio()???
<p>
......@@ -1184,14 +1182,17 @@ the <tt>cDvbDevice</tt>, which is used to access the DVB PCI cards.
If the new device can receive, it most likely needs to provide a way of
selecting which channel it shall tune to:
<!--X1.1.9--><table width=100%><tr><td bgcolor=#AA0000>&nbsp;</td><td width=100%>
<!--X1.1.9--><table width=100%><tr><td bgcolor=#00AA00>&nbsp;</td><td width=100%>
<p><table><tr><td bgcolor=#F0F0F0><pre><br>
<!--X1.1.12--><table width=100%><tr><td bgcolor=#FF0000>&nbsp;</td><td width=100%>
virtual bool ProvidesSource(int Source) const;
<!--X1.1.12--></td></tr></table>
virtual bool ProvidesChannel(const cChannel *Channel, int Priority = -1, bool *NeedsDetachReceivers = NULL);
virtual bool SetChannelDevice(const cChannel *Channel, bool LiveView);
</pre></td></tr></table><p>
These functions will be called with the desired channel and shall return whether
this device can provide the requested channel and whether tuning to it was successful,
These functions will be called with the desired source or channel and shall return whether
this device can provide the requested source or channel and whether tuning to it was successful,
repectively.
<!--X1.1.9--></td></tr></table>
<p>
......@@ -1203,7 +1204,7 @@ A device that can be used for recording must implement the functions
virtual bool SetPid(cPidHandle *Handle, int Type, bool On);
virtual bool OpenDvr(void);
virtual void CloseDvr(void);
<!--X1.1.9--><table width=100%><tr><td bgcolor=#AA0000>&nbsp;</td><td width=100%>
<!--X1.1.9--><table width=100%><tr><td bgcolor=#00AA00>&nbsp;</td><td width=100%>
virtual bool GetTSPacket(uchar *&amp;Data);
<!--X1.1.9--></td></tr></table>
</pre></td></tr></table><p>
......@@ -1227,7 +1228,6 @@ to indicate this to VDR.
<p>
The functions to implement replaying capabilites are
<!--X1.1.7--><table width=100%><tr><td bgcolor=#0000AA>&nbsp;</td><td width=100%>
<p><table><tr><td bgcolor=#F0F0F0><pre><br>
virtual bool HasDecoder(void) const;
virtual bool SetPlayMode(ePlayMode PlayMode);
......@@ -1240,7 +1240,6 @@ virtual void StillPicture(const uchar *Data, int Length);
virtual bool Poll(cPoller &amp;Poller, int TimeoutMs = 0);
virtual int PlayVideo(const uchar *Data, int Length);
</pre></td></tr></table><p>
<!--X1.1.7--></td></tr></table>
In addition, the following functions may be implemented to provide further
functionality:
......@@ -1251,7 +1250,7 @@ virtual void SetVideoFormat(bool VideoFormat16_9);
virtual void SetVolumeDevice(int Volume);
</pre></td></tr></table><p>
<!--X1.1.8--><table width=100%><tr><td bgcolor=#00AA00>&nbsp;</td><td width=100%>
<!--X1.1.8--><table width=100%><tr><td bgcolor=#0000AA>&nbsp;</td><td width=100%>
<p>
<b>On Screen Display</b>
<p>
......@@ -1292,7 +1291,7 @@ shut down (delete) all devices when the program terminates. It is therefore
important that the devices are created on the heap, using the <tt>new</tt>
operator!
<!--X1.1.11--><table width=100%><tr><td bgcolor=#FF0000>&nbsp;</td><td width=100%>
<!--X1.1.11--><table width=100%><tr><td bgcolor=#AA0000>&nbsp;</td><td width=100%>
<hr><h2>Remote Control</h2>
<center><i><b>The joy of zapping!</b></i></center><p>
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -10,11 +10,22 @@ BBC NEWS 24:505833:0:0:0:640:641:0:0:4415
BBC Knowledge:505833:0:0:0:630:631:0:0:4607
Shop!:561833:0:0:0:6049:6050:0:0:13120
: DVB-T Berlin Germany
RTL 1:778000:V:0:27500:160:80:0:1:1
RTL 2:778000:V:0:27500:161:82:0:1:2
Super RTL:778000:V:0:27500:162:84:0:1:3
VOX:778000:V:0:27500:165:81:0:1:4
SAT 1:714000:V:0:27500:160:80:0:1:18
PRO 7:714000:V:0:27500:161:82:0:1:19
KABEL 1:714000:V:0:27500:162:84:0:1:20
N24:714000:V:0:27500:163:86:0:1:21
PRO 7:714000:I0C23D0M16B8T8G8Y0:T:27500:161:82:83:0:19
SAT 1:714000:I0C23D0M16B8T8G8Y0:T:27500:160:80:81:0:18
RTL:778000:I0C23D0M16B8T8G8Y0:T:27500:160:80:0:0:1
RTL 2:778000:I0C23D0M16B8T8G8Y0:T:27500:161:82:0:0:2
Super RTL:778000:I0C23D0M16B8T8G8Y0:T:27500:162:84:0:0:3
VOX:778000:I0C23D0M16B8T8G8Y0:T:27500:163:86:0:0:4
KABEL 1:714000:I0C23D0M16B8T8G8Y0:T:27500:162:84:0:0:20
MTV:674000:I0C23D0M16B8T2G8Y0:T:27500:161:82:83:0:27
VIVA/arte:674000:I0C23D0M16B8T2G8Y0:T:27500:163:86:87:0:29
N-TV:650000:I0C12D0M16B8T2G8Y0:T:27500:160:80:81:0:6
N24:714000:I0C23D0M16B8T8G8Y0:T:27500:163:86:0:0:21
Eurosport:674000:I0C23D0M16B8T2G8Y0:T:27500:160:80:81:0:26
FAB:674000:I0C23D0M16B8T2G8Y0:T:27500:162:84:84:0:28
ARD:602000:I0C23D0M16B8T8G8Y0:T:27500:208:209:667:0:4
ZDF:730000:I0C23D0M16B8T2G8Y0:T:27500:110:120:130:0:22
ZDF-docukanal:730000:I0C23D0M16B8T2G8Y0:T:27500:660:670:130:0:24
ZDF-info:730000:I0C23D0M16B8T2G8Y0:T:27500:610:620:130:0:23
EinsMuXx:650000:I0C12D0M16B8T2G8Y0:T:27500:161:82:0:0:7
EinsFestival:602000:I0C23D0M16B8T8G8Y0:T:27500:80:81:0:0:2
/*
* channels.h: Channel handling
*
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: channels.h 1.1 2002/10/05 13:53:15 kls Exp $
*/
#ifndef __CHANNELS_H
#define __CHANNELS_H
#include "config.h"
#include "sources.h"
#include "tools.h"
#define ISTRANSPONDER(f1, f2) (abs((f1) - (f2)) < 4) //XXX
struct tChannelParameterMap {
int userValue;
int driverValue;
};
//XXX into cChannel???
int MapToUser(int Value, const tChannelParameterMap *Map);
int MapToDriver(int Value, const tChannelParameterMap *Map);
int UserIndex(int Value, const tChannelParameterMap *Map);
int DriverIndex(int Value, const tChannelParameterMap *Map);
extern const tChannelParameterMap InversionValues[];
extern const tChannelParameterMap BandwidthValues[];
extern const tChannelParameterMap CoderateValues[];
extern const tChannelParameterMap ModulationValues[];
extern const tChannelParameterMap TransmissionValues[];
extern const tChannelParameterMap GuardValues[];
extern const tChannelParameterMap HierarchyValues[];
class cChannel : public cListObject {
friend class cMenuEditChannel;
private:
static char *buffer;
static const char *ToText(cChannel *Channel);
enum { MaxChannelName = 32 }; // 31 chars + terminating 0!
char name[MaxChannelName];
int frequency; // MHz
int source;
int srate;
int vpid;
int apid1, apid2;
int dpid1, dpid2;
int tpid;
int ca;
int sid;
int number; // Sequence number assigned on load
bool groupSep;
//XXX
char polarization;
int inversion;
int bandwidth;
int coderateH;
int coderateL;
int modulation;
int transmission;
int guard;
int hierarchy;
const char *ParametersToString(void);
bool StringToParameters(const char *s);
public:
cChannel(void);
cChannel(const cChannel *Channel);
const char *ToText(void);
bool Parse(const char *s);
bool Save(FILE *f);
const char *Name(void) const { return name; }
int Frequency(void) const { return frequency; }
int Source(void) const { return source; }
int Srate(void) const { return srate; }
int Vpid(void) const { return vpid; }
int Apid1(void) const { return apid1; }
int Apid2(void) const { return apid2; }
int Dpid1(void) const { return dpid1; }
int Dpid2(void) const { return dpid2; }
int Tpid(void) const { return tpid; }
int Ca(void) const { return ca; }
int Sid(void) const { return sid; }
int Number(void) const { return number; }
void SetNumber(int Number) { number = Number; }
bool GroupSep(void) const { return groupSep; }
//XXX
char Polarization(void) const { return polarization; }
int Inversion(void) const { return inversion; }
int Bandwidth(void) const { return bandwidth; }
int CoderateH(void) const { return coderateH; }
int CoderateL(void) const { return coderateL; }
int Modulation(void) const { return modulation; }
int Transmission(void) const { return transmission; }
int Guard(void) const { return guard; }
int Hierarchy(void) const { return hierarchy; }
//XXX
bool IsCable(void) { return (source & cSource::st_Mask) == cSource::stCable; }
bool IsSat(void) { return (source & cSource::st_Mask) == cSource::stSat; }
bool IsTerr(void) { return (source & cSource::st_Mask) == cSource::stTerr; }
};
class cChannels : public cConfig<cChannel> {
protected:
int maxNumber;
public:
cChannels(void) { maxNumber = 0; }
virtual bool Load(const char *FileName, bool AllowComments = false);
int GetNextGroup(int Idx); // Get next channel group
int GetPrevGroup(int Idx); // Get previous channel group
int GetNextNormal(int Idx); // Get next normal channel (not group)
void ReNumber(void); // Recalculate 'number' based on channel type
cChannel *GetByNumber(int Number);
cChannel *GetByServiceID(unsigned short ServiceId);
const char *GetChannelNameByNumber(int Number);
bool SwitchTo(int Number);
int MaxNumber(void) { return maxNumber; }
};
extern cChannels Channels;
#endif //__CHANNELS_H
......@@ -4,12 +4,13 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: config.c 1.106 2002/09/28 09:43:41 kls Exp $
* $Id: config.c 1.107 2002/10/03 10:06:55 kls Exp $
*/
#include "config.h"
#include <ctype.h>
#include <stdlib.h>
#include "channels.h" //XXX timers!
#include "i18n.h"
#include "interface.h"
#include "plugin.h"
......@@ -19,116 +20,6 @@
// format characters in order to allow any number of blanks after a numeric
// value!
// -- cChannel ---------------------------------------------------------------
char *cChannel::buffer = NULL;
cChannel::cChannel(void)
{
*name = 0;
}
cChannel::cChannel(const cChannel *Channel)
{
strcpy(name, Channel ? Channel->name : "Pro7");
frequency = Channel ? Channel->frequency : 12480;
polarization = Channel ? Channel->polarization : 'v';
diseqc = Channel ? Channel->diseqc : 0;
srate = Channel ? Channel->srate : 27500;
vpid = Channel ? Channel->vpid : 255;
apid1 = Channel ? Channel->apid1 : 256;
apid2 = Channel ? Channel->apid2 : 0;
dpid1 = Channel ? Channel->dpid1 : 257;
dpid2 = Channel ? Channel->dpid2 : 0;
tpid = Channel ? Channel->tpid : 32;
ca = Channel ? Channel->ca : 0;
pnr = Channel ? Channel->pnr : 0;
groupSep = Channel ? Channel->groupSep : false;
}
const char *cChannel::ToText(cChannel *Channel)
{
char buf[MaxChannelName * 2];
char *s = Channel->name;
if (strchr(s, ':')) {
s = strcpy(buf, s);
strreplace(s, ':', '|');
}
free(buffer);
if (Channel->groupSep)
asprintf(&buffer, ":%s\n", s);
else {
char apidbuf[32];
char *q = apidbuf;
q += snprintf(q, sizeof(apidbuf), "%d", Channel->apid1);
if (Channel->apid2)
q += snprintf(q, sizeof(apidbuf) - (q - apidbuf), ",%d", Channel->apid2);
if (Channel->dpid1 || Channel->dpid2)
q += snprintf(q, sizeof(apidbuf) - (q - apidbuf), ";%d", Channel->dpid1);
if (Channel->dpid2)
q += snprintf(q, sizeof(apidbuf) - (q - apidbuf), ",%d", Channel->dpid2);
*q = 0;
asprintf(&buffer, "%s:%d:%c:%d:%d:%d:%s:%d:%d:%d\n", s, Channel->frequency, Channel->polarization, Channel->diseqc, Channel->srate, Channel->vpid, apidbuf, Channel->tpid, Channel->ca, Channel->pnr);
}
return buffer;
}
const char *cChannel::ToText(void)
{
return ToText(this);
}
bool cChannel::Parse(const char *s)
{
char *buffer = NULL;
if (*s == ':') {
if (*++s) {
strn0cpy(name, s, MaxChannelName);
groupSep = true;
number = 0;
}
else
return false;
}
else {
groupSep = false;
char *apidbuf = NULL;
int fields = sscanf(s, "%a[^:]:%d :%c:%d :%d :%d :%a[^:]:%d :%d :%d ", &buffer, &frequency, &polarization, &diseqc, &srate, &vpid, &apidbuf, &tpid, &ca, &pnr);
apid1 = apid2 = 0;
dpid1 = dpid2 = 0;
if (apidbuf) {
char *p = strchr(apidbuf, ';');
if (p)
*p++ = 0;
sscanf(apidbuf, "%d ,%d ", &apid1, &apid2);
if (p)
sscanf(p, "%d ,%d ", &dpid1, &dpid2);
free(apidbuf);
}
else
return false;
if (fields >= 9) {
if (fields == 9) {
// allow reading of old format
pnr = ca;
ca = tpid;
tpid = 0;
}
strn0cpy(name, buffer, MaxChannelName);
free(buffer);
}
else
return false;
}
strreplace(name, '|', ':');
return true;
}
bool cChannel::Save(FILE *f)
{
return fprintf(f, ToText()) > 0;
}
// -- cTimer -----------------------------------------------------------------
char *cTimer::buffer = NULL;
......@@ -139,7 +30,7 @@ cTimer::cTimer(bool Instant)
recording = pending = false;
active = Instant ? taActInst : taInactive;
cChannel *ch = Channels.GetByNumber(cDevice::CurrentChannel());
channel = ch ? ch->number : 0;
channel = ch ? ch->Number() : 0;
time_t t = time(NULL);
struct tm tm_r;
struct tm *now = localtime_r(&t, &tm_r);
......@@ -156,7 +47,7 @@ cTimer::cTimer(bool Instant)
firstday = 0;
summary = NULL;
if (Instant && ch)
snprintf(file, sizeof(file), "%s%s", Setup.MarkInstantRecord ? "@" : "", *Setup.NameInstantRecord ? Setup.NameInstantRecord : ch->name);
snprintf(file, sizeof(file), "%s%s", Setup.MarkInstantRecord ? "@" : "", *Setup.NameInstantRecord ? Setup.NameInstantRecord : ch->Name());
}
cTimer::cTimer(const cEventInfo *EventInfo)
......@@ -165,7 +56,7 @@ cTimer::cTimer(const cEventInfo *EventInfo)
recording = pending = false;
active = true;
cChannel *ch = Channels.GetByServiceID(EventInfo->GetServiceID());
channel = ch ? ch->number : 0;
channel = ch ? ch->Number() : 0;
time_t tstart = EventInfo->GetTime();
time_t tstop = tstart + EventInfo->GetDuration() + Setup.MarginStop * 60;
tstart -= Setup.MarginStart * 60;
......@@ -573,89 +464,6 @@ bool cCaDefinition::Parse(const char *s)
cCommands Commands;
// -- cChannels --------------------------------------------------------------
cChannels Channels;
bool cChannels::Load(const char *FileName, bool AllowComments)
{
if (cConfig<cChannel>::Load(FileName, AllowComments)) {
ReNumber();
return true;
}
return false;
}
int cChannels::GetNextGroup(int Idx)
{
cChannel *channel = Get(++Idx);
while (channel && !channel->groupSep)
channel = Get(++Idx);
return channel ? Idx : -1;
}
int cChannels::GetPrevGroup(int Idx)
{
cChannel *channel = Get(--Idx);
while (channel && !channel->groupSep)
channel = Get(--Idx);
return channel ? Idx : -1;
}
int cChannels::GetNextNormal(int Idx)
{
cChannel *channel = Get(++Idx);
while (channel && channel->groupSep)
channel = Get(++Idx);
return channel ? Idx : -1;
}
void cChannels::ReNumber( void )
{
int Number = 0;
cChannel *ch = (cChannel *)First();
while (ch) {
if (!ch->groupSep)
ch->number = ++Number;
ch = (cChannel *)ch->Next();
}
maxNumber = Number;
}
cChannel *cChannels::GetByNumber(int Number)
{
cChannel *channel = (cChannel *)First();
while (channel) {
if (!channel->groupSep && channel->number == Number)
return channel;
channel = (cChannel *)channel->Next();
}
return NULL;
}
cChannel *cChannels::GetByServiceID(unsigned short ServiceId)
{
cChannel *channel = (cChannel *)First();
while (channel) {
if (!channel->groupSep && channel->pnr == ServiceId)
return channel;
channel = (cChannel *)channel->Next();
}
return NULL;
}
bool cChannels::SwitchTo(int Number)
{
cChannel *channel = GetByNumber(Number);
return channel && cDevice::PrimaryDevice()->SwitchChannel(channel, true);
}
const char *cChannels::GetChannelNameByNumber(int Number)
{
cChannel *channel = GetByNumber(Number);
return channel ? channel->name : NULL;
}
// -- cTimers ----------------------------------------------------------------
cTimers Timers;
......
......@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: config.h 1.129 2002/09/29 10:42:17 kls Exp $
* $Id: config.h 1.131 2002/10/05 09:58:58 kls Exp $
*/
#ifndef __CONFIG_H
......@@ -20,7 +20,7 @@
#include "eit.h"
#include "tools.h"
#define VDRVERSION "1.1.11"
#define VDRVERSION "1.1.12"
#define MAXPRIORITY 99
#define MAXLIFETIME 99
......@@ -32,34 +32,6 @@
#define MaxFileName 256
#define ISTRANSPONDER(f1, f2) (abs((f1) - (f2)) < 4)
class cChannel : public cListObject {
private:
static char *buffer;
static const char *ToText(cChannel *Channel);
public:
enum { MaxChannelName = 32 }; // 31 chars + terminating 0!
char name[MaxChannelName];
int frequency; // MHz
char polarization;
int diseqc;
int srate;
int vpid;
int apid1, apid2;
int dpid1, dpid2;
int tpid;
int ca;
int pnr;
int number; // Sequence number assigned on load
bool groupSep;
cChannel(void);
cChannel(const cChannel *Channel);
const char *ToText(void);
bool Parse(const char *s);
bool Save(FILE *f);
};
enum eTimerActive { taInactive = 0,
taActive = 1,
taInstant = 2,
......@@ -193,7 +165,7 @@ public:
if (l->Parse(buffer))
Add(l);
else {
esyslog("error in %s, line %d\n", fileName, line);
esyslog("ERROR: error in %s, line %d\n", fileName, line);
delete l;
result = false;
break;
......@@ -229,23 +201,6 @@ public:
}
};
class cChannels : public cConfig<cChannel> {
protected:
int maxNumber;
public:
cChannels(void) { maxNumber = 0; }
virtual bool Load(const char *FileName, bool AllowComments = false);
int GetNextGroup(int Idx); // Get next channel group
int GetPrevGroup(int Idx); // Get previous channel group
int GetNextNormal(int Idx); // Get next normal channel (not group)
void ReNumber(void); // Recalculate 'number' based on channel type
cChannel *GetByNumber(int Number);
cChannel *GetByServiceID(unsigned short ServiceId);
const char *GetChannelNameByNumber(int Number);
bool SwitchTo(int Number);
int MaxNumber(void) { return maxNumber; }
};
class cTimers : public cConfig<cTimer> {
public:
cTimer *GetTimer(cTimer *Timer);
......@@ -265,7 +220,6 @@ public:
const cCaDefinition *Get(int Number);
};
extern cChannels Channels;
extern cTimers Timers;
extern cCommands Commands;
extern cSVDRPhosts SVDRPhosts;
......
......@@ -4,13 +4,14 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: device.c 1.22 2002/09/28 12:20:22 kls Exp $
* $Id: device.c 1.25 2002/10/06 13:49:38 kls Exp $
*/
#include "device.h"
#include <errno.h>
#include <sys/ioctl.h>
#include <sys/mman.h>