From 313e33539cd22fd571fc9a0f9f841173e9faebc4 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 6 Oct 2002 18:00:00 +0200 Subject: 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). --- channels.h | 124 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 channels.h (limited to 'channels.h') diff --git a/channels.h b/channels.h new file mode 100644 index 0000000..8a784f7 --- /dev/null +++ b/channels.h @@ -0,0 +1,124 @@ +/* + * 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 { +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 -- cgit v1.2.3