diff options
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 42 |
1 files changed, 22 insertions, 20 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: config.c 1.5 2000/04/24 09:44:15 kls Exp $ + * $Id: config.c 1.7 2000/05/27 14:44:15 kls Exp $ */ #include "config.h" @@ -23,6 +23,10 @@ tKey keyTable[] = { // "Up" and "Down" must be the first two keys! { kBack, "Back", 0 }, { kLeft, "Left", 0 }, { kRight, "Right", 0 }, + { kRed, "Red", 0 }, + { kGreen, "Green", 0 }, + { kYellow, "Yellow", 0 }, + { kBlue, "Blue", 0 }, { k0, "0", 0 }, { k1, "1", 0 }, { k2, "2", 0 }, @@ -33,18 +37,6 @@ tKey keyTable[] = { // "Up" and "Down" must be the first two keys! { k7, "7", 0 }, { k8, "8", 0 }, { k9, "9", 0 }, - { kRed, "Red", 0 }, - { kGreen, "Green", 0 }, - { kYellow, "Yellow", 0 }, - { kBlue, "Blue", 0 }, - { kRecord, "Record", 0 }, - { kPause, "Pause", 0 }, - { kStop, "Stop", 0 }, - { kBegin, "Begin", 0 }, - { kSearchForward, "SearchForward", 0 }, - { kSearchBack, "SearchBack", 0 }, - { kSkipForward, "SkipForward", 0 }, - { kSkipBack, "SkipBack", 0 }, { kNone, "", 0 }, }; @@ -201,13 +193,15 @@ bool cChannel::Save(FILE *f) return fprintf(f, "%s:%d:%c:%d:%d:%d:%d:%d:%d\n", name, frequency, polarization, diseqc, srate, vpid, apid, ca, pnr) > 0; } -bool cChannel::Switch(void) +bool cChannel::Switch(cDvbApi *DvbApi) { - if (!DvbApi.Recording()) { + if (!DvbApi) + DvbApi = cDvbApi::PrimaryDvbApi; + if (!DvbApi->Recording()) { isyslog(LOG_INFO, "switching to channel %d", Index() + 1); CurrentChannel = Index(); for (int i = 3; --i;) { - if (DvbApi.SetChannel(frequency, polarization, diseqc, srate, vpid, apid, ca, pnr)) + if (DvbApi->SetChannel(frequency, polarization, diseqc, srate, vpid, apid, ca, pnr)) return true; esyslog(LOG_ERR, "retrying"); } @@ -217,10 +211,16 @@ bool cChannel::Switch(void) return false; } -bool cChannel::SwitchTo(int i) +bool cChannel::SwitchTo(int i, cDvbApi *DvbApi) +{ + cChannel *channel = Channels.Get(i); + return channel && channel->Switch(DvbApi); +} + +const char *cChannel::GetChannelName(int i) { cChannel *channel = Channels.Get(i); - return channel && channel->Switch(); + return channel ? channel->name : NULL; } // -- cTimer ----------------------------------------------------------------- @@ -241,7 +241,9 @@ cTimer::cTimer(bool Instant) //TODO VPS??? priority = 99; lifetime = 99; - strcpy(file, Instant ? "instant" : ""); + *file = 0; + if (Instant) + snprintf(file, sizeof(file), "@%s", cChannel::GetChannelName(CurrentChannel)); } int cTimer::TimeToInt(int t) @@ -382,7 +384,7 @@ cTimer *cTimer::GetMatch(void) { cTimer *t = (cTimer *)Timers.First(); while (t) { - if (t->Matches()) + if (!t->recording && t->Matches()) return t; t = (cTimer *)t->Next(); } |