diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2000-09-10 10:51:58 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2000-09-10 10:51:58 +0200 |
commit | a334a2df334ccd3c2a2756b374b675a15bdb3de8 (patch) | |
tree | 54f3208ff1d55f2f6dc01ff0afc3ffd68a10dde5 /dvbapi.c | |
parent | c00d4ea326e61d76d7ab5760a5c06646d6b88ab0 (diff) | |
download | vdr-a334a2df334ccd3c2a2756b374b675a15bdb3de8.tar.gz vdr-a334a2df334ccd3c2a2756b374b675a15bdb3de8.tar.bz2 |
Added a 'Setup' menu
Diffstat (limited to 'dvbapi.c')
-rw-r--r-- | dvbapi.c | 26 |
1 files changed, 22 insertions, 4 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: dvbapi.c 1.23 2000/09/09 12:13:55 kls Exp $ + * $Id: dvbapi.c 1.24 2000/09/10 10:25:09 kls Exp $ */ #include "dvbapi.h" @@ -1097,16 +1097,34 @@ cDvbApi::~cDvbApi() delete replayTitle; } +bool cDvbApi::SetPrimaryDvbApi(int n) +{ + n--; + if (0 <= n && n < NumDvbApis && dvbApi[n]) { + isyslog(LOG_INFO, "setting primary DVB to %d", n + 1); + PrimaryDvbApi = dvbApi[n]; + return true; + } + esyslog(LOG_ERR, "invalid DVB interface: %d", n + 1); + return false; +} + cDvbApi *cDvbApi::GetDvbApi(int Ca) { + cDvbApi *d = NULL; Ca--; for (int i = MAXDVBAPI; --i >= 0; ) { - if (dvbApi[i]) { - if ((i == Ca || Ca < 0) && !dvbApi[i]->Recording()) + if (dvbApi[i] && !dvbApi[i]->Recording()) { + if (i == Ca) return dvbApi[i]; + if (Ca < 0) { + d = dvbApi[i]; + if (d != PrimaryDvbApi) + break; + } } } - return NULL; + return d; } int cDvbApi::Index(void) |