1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Fixed daemon mode (RcIo and Interface no longer static)

This commit is contained in:
Klaus Schmidinger 2000-10-08 12:24:30 +02:00
parent 605d8df72a
commit 19f9f9cfce
9 changed files with 80 additions and 80 deletions

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: config.c 1.23 2000/09/17 09:11:59 kls Exp $ * $Id: config.c 1.24 2000/10/08 12:19:21 kls Exp $
*/ */
#include "config.h" #include "config.h"
@ -275,7 +275,7 @@ bool cChannel::Switch(cDvbApi *DvbApi)
} }
return false; return false;
} }
Interface.Info(DvbApi->Recording() ? "Channel locked (recording)!" : name); Interface->Info(DvbApi->Recording() ? "Channel locked (recording)!" : name);
return false; return false;
} }
@ -566,7 +566,7 @@ eKeys cChannels::ShowChannel(int Number, bool Switched, bool Group)
{ {
cChannel *channel = Group ? Get(Number) : GetByNumber(Number); cChannel *channel = Group ? Get(Number) : GetByNumber(Number);
if (channel) if (channel)
return Interface.DisplayChannel(channel->number, channel->name, !Switched || Setup.ShowInfoOnChSwitch); return Interface->DisplayChannel(channel->number, channel->name, !Switched || Setup.ShowInfoOnChSwitch);
return kNone; return kNone;
} }

View File

@ -4,43 +4,39 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: interface.c 1.23 2000/10/08 11:17:11 kls Exp $ * $Id: interface.c 1.24 2000/10/08 12:15:36 kls Exp $
*/ */
#include "interface.h" #include "interface.h"
#include <unistd.h> #include <unistd.h>
#include "eit.h" #include "eit.h"
#include "remote.h"
cEIT EIT; cEIT EIT;
#if defined(REMOTE_RCU) cInterface *Interface = NULL;
cRcIoRCU RcIo("/dev/ttyS1");
#elif defined(REMOTE_LIRC)
cRcIoLIRC RcIo("/dev/lircd");
#else
cRcIoKBD RcIo;
#endif
cInterface Interface; cInterface::cInterface(int SVDRPport)
cInterface::cInterface(void)
{ {
open = 0; open = 0;
cols[0] = 0; cols[0] = 0;
keyFromWait = kNone; keyFromWait = kNone;
rcIo = NULL;
SVDRP = NULL; SVDRP = NULL;
} #if defined(REMOTE_RCU)
rcIo = new cRcIoRCU("/dev/ttyS1");
void cInterface::Init(int SVDRPport) #elif defined(REMOTE_LIRC)
{ rcIo = new cRcIoLIRC("/dev/lircd");
RcIo.SetCode(Keys.code, Keys.address); #else
rcIo = new cRcIoKBD;
#endif
rcIo->SetCode(Keys.code, Keys.address);
if (SVDRPport) if (SVDRPport)
SVDRP = new cSVDRP(SVDRPport); SVDRP = new cSVDRP(SVDRPport);
} }
void cInterface::Cleanup(void) cInterface::~cInterface()
{ {
delete rcIo;
delete SVDRP; delete SVDRP;
} }
@ -62,10 +58,10 @@ unsigned int cInterface::GetCh(bool Wait, bool *Repeat, bool *Release)
{ {
if (open) if (open)
cDvbApi::PrimaryDvbApi->Flush(); cDvbApi::PrimaryDvbApi->Flush();
if (!RcIo.InputAvailable()) if (!rcIo->InputAvailable())
cFile::AnyFileReady(-1, Wait ? 1000 : 0); cFile::AnyFileReady(-1, Wait ? 1000 : 0);
unsigned int Command; unsigned int Command;
return RcIo.GetCommand(&Command, Repeat, Release) ? Command : 0; return rcIo->GetCommand(&Command, Repeat, Release) ? Command : 0;
} }
eKeys cInterface::GetKey(bool Wait) eKeys cInterface::GetKey(bool Wait)
@ -245,13 +241,13 @@ void cInterface::QueryKeys(void)
break; break;
#else #else
//TODO on screen display... //TODO on screen display...
if (RcIo.DetectCode(&Code, &Address)) { if (rcIo->DetectCode(&Code, &Address)) {
Keys.code = Code; Keys.code = Code;
Keys.address = Address; Keys.address = Address;
WriteText(1, 5, "RC code detected!"); WriteText(1, 5, "RC code detected!");
WriteText(1, 6, "Do not press any key..."); WriteText(1, 6, "Do not press any key...");
cDvbApi::PrimaryDvbApi->Flush(); cDvbApi::PrimaryDvbApi->Flush();
RcIo.Flush(3000); rcIo->Flush(3000);
ClearEol(0, 5); ClearEol(0, 5);
ClearEol(0, 6); ClearEol(0, 6);
cDvbApi::PrimaryDvbApi->Flush(); cDvbApi::PrimaryDvbApi->Flush();
@ -342,7 +338,7 @@ eKeys cInterface::DisplayChannel(int Number, const char *Name, bool WithInfo)
{ {
// Number = 0 is used for channel group display and no EIT // Number = 0 is used for channel group display and no EIT
if (Number) if (Number)
RcIo.Number(Number); rcIo->Number(Number);
if (Name && !Recording()) { if (Name && !Recording()) {
Open(MenuColumns, 5); Open(MenuColumns, 5);
cDvbApi::PrimaryDvbApi->Fill(0, 0, MenuColumns, 1, clrBackground); cDvbApi::PrimaryDvbApi->Fill(0, 0, MenuColumns, 1, clrBackground);
@ -401,7 +397,7 @@ eKeys cInterface::DisplayChannel(int Number, const char *Name, bool WithInfo)
void cInterface::DisplayRecording(int Index, bool On) void cInterface::DisplayRecording(int Index, bool On)
{ {
RcIo.SetPoints(1 << Index, On); rcIo->SetPoints(1 << Index, On);
} }
bool cInterface::Recording(void) bool cInterface::Recording(void)

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: interface.h 1.15 2000/10/08 09:51:42 kls Exp $ * $Id: interface.h 1.16 2000/10/08 12:15:49 kls Exp $
*/ */
#ifndef __INTERFACE_H #ifndef __INTERFACE_H
@ -12,6 +12,7 @@
#include "config.h" #include "config.h"
#include "dvbapi.h" #include "dvbapi.h"
#include "remote.h"
#include "svdrp.h" #include "svdrp.h"
class cInterface { class cInterface {
@ -22,14 +23,14 @@ private:
int cols[MaxCols]; int cols[MaxCols];
eKeys keyFromWait; eKeys keyFromWait;
cSVDRP *SVDRP; cSVDRP *SVDRP;
cRcIoBase *rcIo;
unsigned int GetCh(bool Wait = true, bool *Repeat = NULL, bool *Release = NULL); unsigned int GetCh(bool Wait = true, bool *Repeat = NULL, bool *Release = NULL);
void QueryKeys(void); void QueryKeys(void);
void HelpButton(int Index, const char *Text, eDvbColor FgColor, eDvbColor BgColor); void HelpButton(int Index, const char *Text, eDvbColor FgColor, eDvbColor BgColor);
eKeys Wait(int Seconds = 1, bool KeepChar = false); eKeys Wait(int Seconds = 1, bool KeepChar = false);
public: public:
cInterface(void); cInterface(int SVDRPport = 0);
void Init(int SVDRPport = 0); ~cInterface();
void Cleanup(void);
void Open(int NumCols = MenuColumns, int NumLines = MenuLines); void Open(int NumCols = MenuColumns, int NumLines = MenuLines);
void Close(void); void Close(void);
eKeys GetKey(bool Wait = true); eKeys GetKey(bool Wait = true);
@ -51,6 +52,6 @@ public:
bool Recording(void); bool Recording(void);
}; };
extern cInterface Interface; extern cInterface *Interface;
#endif //__INTERFACE_H #endif //__INTERFACE_H

38
menu.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: menu.c 1.31 2000/10/08 10:47:17 kls Exp $ * $Id: menu.c 1.32 2000/10/08 12:20:03 kls Exp $
*/ */
#include "menu.h" #include "menu.h"
@ -641,11 +641,11 @@ eOSState cMenuChannels::Del(void)
// Check if there is a timer using this channel: // Check if there is a timer using this channel:
for (cTimer *ti = Timers.First(); ti; ti = (cTimer *)ti->Next()) { for (cTimer *ti = Timers.First(); ti; ti = (cTimer *)ti->Next()) {
if (ti->channel == DeletedChannel) { if (ti->channel == DeletedChannel) {
Interface.Error("Channel is being used by a timer!"); Interface->Error("Channel is being used by a timer!");
return osContinue; return osContinue;
} }
} }
if (Interface.Confirm("Delete Channel?")) { if (Interface->Confirm("Delete Channel?")) {
// Move and renumber the channels: // Move and renumber the channels:
Channels.Del(channel); Channels.Del(channel);
Channels.ReNumber(); Channels.ReNumber();
@ -922,7 +922,7 @@ eOSState cMenuTimers::Del(void)
cTimer *ti = Timers.Get(Index); cTimer *ti = Timers.Get(Index);
if (ti) { if (ti) {
if (!ti->recording) { if (!ti->recording) {
if (Interface.Confirm("Delete Timer?")) { if (Interface->Confirm("Delete Timer?")) {
Timers.Del(Timers.Get(Index)); Timers.Del(Timers.Get(Index));
cOsdMenu::Del(Index); cOsdMenu::Del(Index);
Timers.Save(); Timers.Save();
@ -931,7 +931,7 @@ eOSState cMenuTimers::Del(void)
} }
} }
else else
Interface.Error("Timer is recording!"); Interface->Error("Timer is recording!");
} }
return osContinue; return osContinue;
} }
@ -1036,17 +1036,17 @@ eOSState cMenuRecordings::Del(void)
if (ri) { if (ri) {
//XXX what if this recording's file is currently in use??? //XXX what if this recording's file is currently in use???
//XXX if (!ti->recording) { //XXX if (!ti->recording) {
if (Interface.Confirm("Delete Recording?")) { if (Interface->Confirm("Delete Recording?")) {
if (ri->recording->Delete()) { if (ri->recording->Delete()) {
cOsdMenu::Del(Current()); cOsdMenu::Del(Current());
Display(); Display();
} }
else else
Interface.Error("Error while deleting recording!"); Interface->Error("Error while deleting recording!");
} }
//XXX } //XXX }
//XXX else //XXX else
//XXX Interface.Error("Timer is recording!"); //XXX Interface->Error("Timer is recording!");
} }
return osContinue; return osContinue;
} }
@ -1146,7 +1146,7 @@ eOSState cMenuMain::ProcessKey(eKeys Key)
case osTimer: return AddSubMenu(new cMenuTimers); case osTimer: return AddSubMenu(new cMenuTimers);
case osRecordings: return AddSubMenu(new cMenuRecordings); case osRecordings: return AddSubMenu(new cMenuRecordings);
case osSetup: return AddSubMenu(new cMenuSetup); case osSetup: return AddSubMenu(new cMenuSetup);
case osStopRecord: if (Interface.Confirm("Stop Recording?")) { case osStopRecord: if (Interface->Confirm("Stop Recording?")) {
cOsdItem *item = Get(Current()); cOsdItem *item = Get(Current());
if (item) { if (item) {
cRecordControls::Stop(item->Text() + strlen(STOP_RECORDING)); cRecordControls::Stop(item->Text() + strlen(STOP_RECORDING));
@ -1178,15 +1178,15 @@ cDirectChannelSelect::cDirectChannelSelect(eKeys FirstKey)
oldNumber = CurrentChannel; oldNumber = CurrentChannel;
number = 0; number = 0;
lastTime = time_ms(); lastTime = time_ms();
Interface.Open(MenuColumns, 1); Interface->Open(MenuColumns, 1);
ProcessKey(FirstKey); ProcessKey(FirstKey);
} }
cDirectChannelSelect::~cDirectChannelSelect() cDirectChannelSelect::~cDirectChannelSelect()
{ {
if (number < 0) if (number < 0)
Interface.DisplayChannel(oldNumber); Interface->DisplayChannel(oldNumber);
Interface.Close(); Interface->Close();
} }
eOSState cDirectChannelSelect::ProcessKey(eKeys Key) eOSState cDirectChannelSelect::ProcessKey(eKeys Key)
@ -1200,9 +1200,9 @@ eOSState cDirectChannelSelect::ProcessKey(eKeys Key)
int BufSize = MenuColumns + 1; int BufSize = MenuColumns + 1;
char buffer[BufSize]; char buffer[BufSize];
snprintf(buffer, BufSize, "%d %s", number, Name); snprintf(buffer, BufSize, "%d %s", number, Name);
Interface.DisplayChannel(number); Interface->DisplayChannel(number);
Interface.Clear(); Interface->Clear();
Interface.Write(0, 0, buffer); Interface->Write(0, 0, buffer);
lastTime = time_ms(); lastTime = time_ms();
if (!channel) { if (!channel) {
number = -1; number = -1;
@ -1241,14 +1241,14 @@ cRecordControl::cRecordControl(cDvbApi *DvbApi, cTimer *Timer)
cRecording Recording(timer); cRecording Recording(timer);
if (dvbApi->StartRecord(Recording.FileName())) if (dvbApi->StartRecord(Recording.FileName()))
Recording.WriteSummary(); Recording.WriteSummary();
Interface.DisplayRecording(dvbApi->Index(), true); Interface->DisplayRecording(dvbApi->Index(), true);
} }
cRecordControl::~cRecordControl() cRecordControl::~cRecordControl()
{ {
Stop(true); Stop(true);
delete instantId; delete instantId;
Interface.DisplayRecording(dvbApi->Index(), false); Interface->DisplayRecording(dvbApi->Index(), false);
} }
void cRecordControl::Stop(bool KeepInstant) void cRecordControl::Stop(bool KeepInstant)
@ -1366,7 +1366,7 @@ void cReplayControl::SetRecording(const char *FileName, const char *Title)
void cReplayControl::Show(void) void cReplayControl::Show(void)
{ {
if (!visible) { if (!visible) {
Interface.Open(MenuColumns, -3); Interface->Open(MenuColumns, -3);
needsFastResponse = visible = true; needsFastResponse = visible = true;
shown = dvbApi->ShowProgress(true); shown = dvbApi->ShowProgress(true);
} }
@ -1375,7 +1375,7 @@ void cReplayControl::Show(void)
void cReplayControl::Hide(void) void cReplayControl::Hide(void)
{ {
if (visible) { if (visible) {
Interface.Close(); Interface->Close();
needsFastResponse = visible = false; needsFastResponse = visible = false;
} }
} }

24
osd.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: osd.c 1.8 2000/10/08 10:27:04 kls Exp $ * $Id: osd.c 1.9 2000/10/08 12:20:34 kls Exp $
*/ */
#include "osd.h" #include "osd.h"
@ -64,7 +64,7 @@ void cOsdItem::Display(int Offset, eDvbColor FgColor, eDvbColor BgColor)
if (Offset >= 0) if (Offset >= 0)
offset = Offset; offset = Offset;
if (offset >= 0) if (offset >= 0)
Interface.WriteText(0, offset + 2, text, userColor ? fgColor : FgColor, userColor ? bgColor : BgColor); Interface->WriteText(0, offset + 2, text, userColor ? fgColor : FgColor, userColor ? bgColor : BgColor);
} }
eOSState cOsdItem::ProcessKey(eKeys Key) eOSState cOsdItem::ProcessKey(eKeys Key)
@ -88,7 +88,7 @@ cOsdMenu::cOsdMenu(char *Title, int c0, int c1, int c2, int c3, int c4)
subMenu = NULL; subMenu = NULL;
helpRed = helpGreen = helpYellow = helpBlue = NULL; helpRed = helpGreen = helpYellow = helpBlue = NULL;
status = NULL; status = NULL;
Interface.Open(); Interface->Open();
} }
cOsdMenu::~cOsdMenu() cOsdMenu::~cOsdMenu()
@ -96,8 +96,8 @@ cOsdMenu::~cOsdMenu()
delete title; delete title;
delete subMenu; delete subMenu;
delete status; delete status;
Interface.Clear(); Interface->Clear();
Interface.Close(); Interface->Close();
} }
void cOsdMenu::SetStatus(const char *s) void cOsdMenu::SetStatus(const char *s)
@ -105,7 +105,7 @@ void cOsdMenu::SetStatus(const char *s)
delete status; delete status;
status = s ? strdup(s) : NULL; status = s ? strdup(s) : NULL;
if (visible) if (visible)
Interface.Status(status); Interface->Status(status);
} }
void cOsdMenu::SetHelp(const char *Red, const char *Green, const char *Yellow, const char *Blue) void cOsdMenu::SetHelp(const char *Red, const char *Green, const char *Yellow, const char *Blue)
@ -117,7 +117,7 @@ void cOsdMenu::SetHelp(const char *Red, const char *Green, const char *Yellow, c
helpBlue = Blue; helpBlue = Blue;
if (visible) if (visible)
Display(); Display();
//XXX Interface.Help(helpRed, helpGreen, helpYellow, helpBlue); //XXX Interface->Help(helpRed, helpGreen, helpYellow, helpBlue);
//XXX must clear unused button areas! //XXX must clear unused button areas!
} }
@ -140,10 +140,10 @@ void cOsdMenu::Add(cOsdItem *Item, bool Current)
void cOsdMenu::Display(void) void cOsdMenu::Display(void)
{ {
visible = true; visible = true;
Interface.Clear(); Interface->Clear();
Interface.SetCols(cols); Interface->SetCols(cols);
Interface.Title(title); Interface->Title(title);
Interface.Help(helpRed, helpGreen, helpYellow, helpBlue); Interface->Help(helpRed, helpGreen, helpYellow, helpBlue);
int count = Count(); int count = Count();
if (count > 0) { if (count > 0) {
if (current < 0) if (current < 0)
@ -164,7 +164,7 @@ void cOsdMenu::Display(void)
break; break;
} }
} }
Interface.Status(status); Interface->Status(status);
} }
void cOsdMenu::RefreshCurrent(void) void cOsdMenu::RefreshCurrent(void)

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: recording.c 1.18 2000/10/03 12:39:28 kls Exp $ * $Id: recording.c 1.19 2000/10/08 12:20:53 kls Exp $
*/ */
#define _GNU_SOURCE #define _GNU_SOURCE
@ -254,7 +254,7 @@ bool cRecordings::Load(bool Deleted)
result = Count() > 0; result = Count() > 0;
} }
else else
Interface.Error("Error while opening pipe!"); Interface->Error("Error while opening pipe!");
delete cmd; delete cmd;
return result; return result;
} }

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: remote.h 1.12 2000/10/08 11:19:17 kls Exp $ * $Id: remote.h 1.13 2000/10/08 12:11:34 kls Exp $
*/ */
#ifndef __REMOTE_H #ifndef __REMOTE_H
@ -19,9 +19,9 @@ class cRcIoBase {
protected: protected:
time_t t; time_t t;
cRcIoBase(void); cRcIoBase(void);
virtual ~cRcIoBase();
public: public:
enum { modeH = 'h', modeB = 'b', modeS = 's' }; enum { modeH = 'h', modeB = 'b', modeS = 's' };
virtual ~cRcIoBase();
virtual bool SetCode(unsigned char Code, unsigned short Address) { return true; } virtual bool SetCode(unsigned char Code, unsigned short Address) { return true; }
virtual bool SetMode(unsigned char Mode) { return true; } virtual bool SetMode(unsigned char Mode) { return true; }
virtual bool Number(int n, bool Hex = false) { return true; } virtual bool Number(int n, bool Hex = false) { return true; }

View File

@ -10,7 +10,7 @@
* and interact with the Video Disk Recorder - or write a full featured * and interact with the Video Disk Recorder - or write a full featured
* graphical interface that sits on top of an SVDRP connection. * graphical interface that sits on top of an SVDRP connection.
* *
* $Id: svdrp.c 1.10 2000/09/17 13:39:37 kls Exp $ * $Id: svdrp.c 1.11 2000/10/08 12:21:14 kls Exp $
*/ */
#define _GNU_SOURCE #define _GNU_SOURCE
@ -326,7 +326,7 @@ void cSVDRP::CmdCHAN(const char *Option)
Reply(501, "Undefined channel \"%s\"", Option); Reply(501, "Undefined channel \"%s\"", Option);
return; return;
} }
if (Interface.Recording()) { if (Interface->Recording()) {
Reply(550, "Can't switch channel, interface is recording"); Reply(550, "Can't switch channel, interface is recording");
return; return;
} }
@ -474,7 +474,7 @@ void cSVDRP::CmdHITK(const char *Option)
if (*Option) { if (*Option) {
eKeys k = Keys.Translate(Option); eKeys k = Keys.Translate(Option);
if (k != kNone) { if (k != kNone) {
Interface.PutKey(k); Interface->PutKey(k);
Reply(250, "Key \"%s\" accepted", Option); Reply(250, "Key \"%s\" accepted", Option);
} }
else else

23
vdr.c
View File

@ -22,7 +22,7 @@
* *
* The project's page is at http://www.cadsoft.de/people/kls/vdr * The project's page is at http://www.cadsoft.de/people/kls/vdr
* *
* $Id: vdr.c 1.37 2000/10/08 10:32:44 kls Exp $ * $Id: vdr.c 1.38 2000/10/08 12:24:30 kls Exp $
*/ */
#include <getopt.h> #include <getopt.h>
@ -161,6 +161,10 @@ int main(int argc, char *argv[])
if (!cDvbApi::Init()) if (!cDvbApi::Init())
abort(); abort();
// User interface:
Interface = new cInterface(SVDRPport);
// Configuration data: // Configuration data:
if (!ConfigDirectory) if (!ConfigDirectory)
@ -173,9 +177,8 @@ int main(int argc, char *argv[])
Keys.SetDummyValues(); Keys.SetDummyValues();
#else #else
if (!Keys.Load(AddDirectory(ConfigDirectory, KEYS_CONF))) if (!Keys.Load(AddDirectory(ConfigDirectory, KEYS_CONF)))
Interface.LearnKeys(); Interface->LearnKeys();
#endif #endif
Interface.Init(SVDRPport);
cDvbApi::SetPrimaryDvbApi(Setup.PrimaryDVB); cDvbApi::SetPrimaryDvbApi(Setup.PrimaryDVB);
@ -215,7 +218,7 @@ int main(int argc, char *argv[])
} }
// User Input: // User Input:
cOsdBase **Interact = Menu ? &Menu : (cOsdBase **)&ReplayControl; cOsdBase **Interact = Menu ? &Menu : (cOsdBase **)&ReplayControl;
eKeys key = Interface.GetKey(!*Interact || !(*Interact)->NeedsFastResponse()); eKeys key = Interface->GetKey(!*Interact || !(*Interact)->NeedsFastResponse());
if (*Interact) { if (*Interact) {
switch ((*Interact)->ProcessKey(key)) { switch ((*Interact)->ProcessKey(key)) {
case osMenu: DELETENULL(Menu); case osMenu: DELETENULL(Menu);
@ -223,7 +226,7 @@ int main(int argc, char *argv[])
break; break;
case osRecord: DELETENULL(Menu); case osRecord: DELETENULL(Menu);
if (!cRecordControls::Start()) if (!cRecordControls::Start())
Interface.Error("No free DVB device to record!"); Interface->Error("No free DVB device to record!");
break; break;
case osReplay: DELETENULL(Menu); case osReplay: DELETENULL(Menu);
DELETENULL(ReplayControl); DELETENULL(ReplayControl);
@ -235,7 +238,7 @@ int main(int argc, char *argv[])
break; break;
case osSwitchDvb: case osSwitchDvb:
DELETENULL(*Interact); DELETENULL(*Interact);
Interface.Info("Switching primary DVB..."); Interface->Info("Switching primary DVB...");
cDvbApi::SetPrimaryDvbApi(Setup.PrimaryDVB); cDvbApi::SetPrimaryDvbApi(Setup.PrimaryDVB);
break; break;
case osBack: case osBack:
@ -253,14 +256,14 @@ int main(int argc, char *argv[])
break; break;
// Direct Channel Select: // Direct Channel Select:
case k1 ... k9: case k1 ... k9:
if (!Interface.Recording()) if (!Interface->Recording())
Menu = new cDirectChannelSelect(key); Menu = new cDirectChannelSelect(key);
break; break;
// Left/Right rotates trough channel groups: // Left/Right rotates trough channel groups:
case kLeft|k_Repeat: case kLeft|k_Repeat:
case kLeft: case kLeft:
case kRight|k_Repeat: case kRight|k_Repeat:
case kRight: if (!Interface.Recording()) { case kRight: if (!Interface->Recording()) {
int SaveGroup = CurrentGroup; int SaveGroup = CurrentGroup;
if (NORMALKEY(key) == kRight) if (NORMALKEY(key) == kRight)
CurrentGroup = Channels.GetNextGroup(CurrentGroup) ; CurrentGroup = Channels.GetNextGroup(CurrentGroup) ;
@ -276,7 +279,7 @@ int main(int argc, char *argv[])
case kUp|k_Repeat: case kUp|k_Repeat:
case kUp: case kUp:
case kDown|k_Repeat: case kDown|k_Repeat:
case kDown: if (!Interface.Recording()) { case kDown: if (!Interface->Recording()) {
int n = CurrentChannel + (NORMALKEY(key) == kUp ? 1 : -1); int n = CurrentChannel + (NORMALKEY(key) == kUp ? 1 : -1);
cChannel *channel = Channels.GetByNumber(n); cChannel *channel = Channels.GetByNumber(n);
if (channel) if (channel)
@ -294,7 +297,7 @@ int main(int argc, char *argv[])
isyslog(LOG_INFO, "caught signal %d", Interrupted); isyslog(LOG_INFO, "caught signal %d", Interrupted);
delete Menu; delete Menu;
delete ReplayControl; delete ReplayControl;
Interface.Cleanup(); delete Interface;
cDvbApi::Cleanup(); cDvbApi::Cleanup();
isyslog(LOG_INFO, "exiting"); isyslog(LOG_INFO, "exiting");
if (SysLogLevel > 0) if (SysLogLevel > 0)