diff options
author | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2002-10-06 18:00:00 +0200 |
---|---|---|
committer | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2002-10-06 18:00:00 +0200 |
commit | 313e33539cd22fd571fc9a0f9f841173e9faebc4 (patch) | |
tree | 29b3031574b45c44e21bcfea6128fbbcd4f959da /device.c | |
parent | d08073815d6d9132f7fb5cd9f82877967dc6b0e4 (diff) | |
download | vdr-patch-lnbsharing-313e33539cd22fd571fc9a0f9f841173e9faebc4.tar.gz vdr-patch-lnbsharing-313e33539cd22fd571fc9a0f9f841173e9faebc4.tar.bz2 |
Version 1.1.12vdr-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).
Diffstat (limited to 'device.c')
-rw-r--r-- | device.c | 58 |
1 files changed, 35 insertions, 23 deletions
@@ -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> +#include "channels.h" #include "eit.h" #include "i18n.h" #include "player.h" @@ -143,7 +144,7 @@ cDevice *cDevice::GetDevice(const cChannel *Channel, int Priority, bool *NeedsDe || !d->Receiving() // ...the one we have is not receiving... && (device[i]->Priority() < d->Priority() // ...this one has an even lower Priority, or... || device[i]->Priority() == d->Priority() // ...same Priority... - && device[i]->ProvidesCa(Channel->ca) < d->ProvidesCa(Channel->ca) // ...but this one provides fewer Ca values + && device[i]->ProvidesCa(Channel->Ca()) < d->ProvidesCa(Channel->Ca()) // ...but this one provides fewer Ca values ) ) ) { @@ -275,6 +276,11 @@ bool cDevice::SetPid(cPidHandle *Handle, int Type, bool On) return false; } +bool cDevice::ProvidesSource(int Source) const +{ + return false; +} + bool cDevice::ProvidesChannel(const cChannel *Channel, int Priority, bool *NeedsDetachReceivers) const { return false; @@ -283,11 +289,13 @@ bool cDevice::ProvidesChannel(const cChannel *Channel, int Priority, bool *Needs bool cDevice::SwitchChannel(const cChannel *Channel, bool LiveView) { if (LiveView) - isyslog("switching to channel %d", Channel->number); + isyslog("switching to channel %d", Channel->Number()); for (int i = 3; i--;) { switch (SetChannel(Channel, LiveView)) { case scrOk: return true; - case scrNotAvailable: return false; + case scrNotAvailable: if (Interface) + Interface->Error(tr("Channel not available!")); + return false; case scrNoTransfer: if (Interface) Interface->Error(tr("Can't start Transfer Mode!")); return false; @@ -305,21 +313,25 @@ bool cDevice::SwitchChannel(int Direction) if (Direction) { int n = CurrentChannel() + Direction; int first = n; - for (;;) { - cChannel *channel = Channels.GetByNumber(n); - if (!channel) - break; - if (PrimaryDevice()->SwitchChannel(channel, true)) { - result = true; - break; - } - n += Direction; - } - int d = n - first; - if (abs(d) == 1) - dsyslog("skipped channel %d", first); - else if (d) - dsyslog("skipped channels %d..%d", first, n - sgn(d)); + PrimaryDevice()->StopReplay(); // otherwise a running Transfer Mode would block channels + cChannel *channel; + while ((channel = Channels.GetByNumber(n)) != NULL) { + // try only channels which are currently available + if (PrimaryDevice()->ProvidesChannel(channel, Setup.PrimaryLimit) || GetDevice(channel, 0)) + break; + n += Direction; + } + if (channel) { + int d = n - first; + if (abs(d) == 1) + dsyslog("skipped channel %d", first); + else if (d) + dsyslog("skipped channels %d..%d", first, n - sgn(d)); + if (PrimaryDevice()->SwitchChannel(channel, true)) + result = true; + } + else if (n != first && Interface) + Interface->Error(tr("Channel not available!")); } return result; } @@ -344,7 +356,7 @@ eSetChannelResult cDevice::SetChannel(const cChannel *Channel, bool LiveView) if (CaDevice) { cStatus::MsgChannelSwitch(this, 0); // only report status if we are actually going to switch the channel if (CaDevice->SetChannel(Channel, false) == scrOk) // calling SetChannel() directly, not SwitchChannel()! - cControl::Launch(new cTransferControl(CaDevice, Channel->vpid, Channel->apid1, 0, 0, 0));//XXX+ + cControl::Launch(new cTransferControl(CaDevice, Channel->Vpid(), Channel->Apid1(), 0, 0, 0));//XXX+ else Result = scrNoTransfer; } @@ -359,10 +371,10 @@ eSetChannelResult cDevice::SetChannel(const cChannel *Channel, bool LiveView) if (Result == scrOk) { if (LiveView && IsPrimaryDevice()) { - cSIProcessor::SetCurrentServiceID(Channel->pnr); - currentChannel = Channel->number; + cSIProcessor::SetCurrentServiceID(Channel->Sid()); + currentChannel = Channel->Number(); } - cStatus::MsgChannelSwitch(this, Channel->number); // only report status if channel switch successfull + cStatus::MsgChannelSwitch(this, Channel->Number()); // only report status if channel switch successfull } return Result; |