summaryrefslogtreecommitdiff
path: root/vdr.c
diff options
context:
space:
mode:
Diffstat (limited to 'vdr.c')
-rw-r--r--vdr.c51
1 files changed, 28 insertions, 23 deletions
diff --git a/vdr.c b/vdr.c
index afad5ffa..bef3919f 100644
--- a/vdr.c
+++ b/vdr.c
@@ -22,7 +22,7 @@
*
* The project's page is at http://www.cadsoft.de/people/kls/vdr
*
- * $Id: vdr.c 1.113 2002/05/20 11:02:10 kls Exp $
+ * $Id: vdr.c 1.114 2002/06/16 11:30:28 kls Exp $
*/
#include <getopt.h>
@@ -31,7 +31,7 @@
#include <stdlib.h>
#include <unistd.h>
#include "config.h"
-#include "dvbapi.h"
+#include "device.h"
#include "eitscan.h"
#include "i18n.h"
#include "interface.h"
@@ -118,15 +118,17 @@ int main(int argc, char *argv[])
int c;
while ((c = getopt_long(argc, argv, "a:c:dD:E:hl:L:mp:P:r:s:t:v:Vw:", long_options, NULL)) != -1) {
switch (c) {
- case 'a': cDvbApi::SetAudioCommand(optarg);
+ /*XXX+
+ case 'a': cDevice::SetAudioCommand(optarg);
break;
+ XXX*/
case 'c': ConfigDirectory = optarg;
break;
case 'd': DaemonMode = true; break;
case 'D': if (isnumber(optarg)) {
int n = atoi(optarg);
- if (0 <= n && n < MAXDVBAPI) {
- cDvbApi::SetUseDvbApi(n);
+ if (0 <= n && n < MAXDEVICES) {
+ cDevice::SetUseDevice(n);
break;
}
}
@@ -323,10 +325,10 @@ int main(int argc, char *argv[])
// DVB interfaces:
- if (!cDvbApi::Initialize())
+ if (!cDevice::Initialize())
return 2;
- cDvbApi::SetPrimaryDvbApi(Setup.PrimaryDVB);
+ cDevice::SetPrimaryDevice(Setup.PrimaryDVB);
cSIProcessor::Read();
@@ -343,9 +345,9 @@ int main(int argc, char *argv[])
Channels.SwitchTo(Setup.CurrentChannel);
if (MuteAudio)
- cDvbApi::PrimaryDvbApi->ToggleMute();
+ cDevice::PrimaryDevice()->ToggleMute();
else
- cDvbApi::PrimaryDvbApi->SetVolume(Setup.CurrentVolume, true);
+ cDevice::PrimaryDevice()->SetVolume(Setup.CurrentVolume, true);
cEITScanner EITScanner;
@@ -371,7 +373,7 @@ int main(int argc, char *argv[])
cOsdObject *Menu = NULL;
cReplayControl *ReplayControl = NULL;
int LastChannel = -1;
- int PreviousChannel = cDvbApi::CurrentChannel();
+ int PreviousChannel = cDevice::CurrentChannel();
time_t LastActivity = 0;
int MaxLatencyTime = 0;
bool ForceShutdown = false;
@@ -396,12 +398,12 @@ int main(int argc, char *argv[])
}
}
// Channel display:
- if (!EITScanner.Active() && cDvbApi::CurrentChannel() != LastChannel) {
+ if (!EITScanner.Active() && cDevice::CurrentChannel() != LastChannel) {
if (!Menu)
- Menu = new cDisplayChannel(cDvbApi::CurrentChannel(), LastChannel > 0);
+ Menu = new cDisplayChannel(cDevice::CurrentChannel(), LastChannel > 0);
if (LastChannel > 0)
PreviousChannel = LastChannel;
- LastChannel = cDvbApi::CurrentChannel();
+ LastChannel = cDevice::CurrentChannel();
}
// Timers and Recordings:
if (!Menu) {
@@ -429,11 +431,11 @@ int main(int argc, char *argv[])
case kVolDn:
case kMute:
if (key == kMute) {
- if (!cDvbApi::PrimaryDvbApi->ToggleMute() && !Menu)
+ if (!cDevice::PrimaryDevice()->ToggleMute() && !Menu)
break; // no need to display "mute off"
}
else
- cDvbApi::PrimaryDvbApi->SetVolume(NORMALKEY(key) == kVolDn ? -VOLUMEDELTA : VOLUMEDELTA);
+ cDevice::PrimaryDevice()->SetVolume(NORMALKEY(key) == kVolDn ? -VOLUMEDELTA : VOLUMEDELTA);
if (!Menu && (!ReplayControl || !ReplayControl->Visible()))
Menu = cDisplayVolume::Create();
cDisplayVolume::Process(key);
@@ -477,7 +479,7 @@ int main(int argc, char *argv[])
case osSwitchDvb:
DELETENULL(*Interact);
Interface->Info(tr("Switching primary DVB..."));
- cDvbApi::SetPrimaryDvbApi(Setup.PrimaryDVB);
+ cDevice::SetPrimaryDevice(Setup.PrimaryDVB);
break;
case osBack:
case osEnd: DELETENULL(*Interact);
@@ -490,7 +492,7 @@ int main(int argc, char *argv[])
switch (key) {
// Toggle channels:
case k0: {
- int CurrentChannel = cDvbApi::CurrentChannel();
+ int CurrentChannel = cDevice::CurrentChannel();
Channels.SwitchTo(PreviousChannel);
PreviousChannel = CurrentChannel;
break;
@@ -511,7 +513,7 @@ int main(int argc, char *argv[])
case kUp:
case kDown|k_Repeat:
case kDown: {
- int n = cDvbApi::CurrentChannel() + (NORMALKEY(key) == kUp ? 1 : -1);
+ int n = cDevice::CurrentChannel() + (NORMALKEY(key) == kUp ? 1 : -1);
cChannel *channel = Channels.GetByNumber(n);
if (channel)
channel->Switch();
@@ -527,14 +529,16 @@ int main(int argc, char *argv[])
}
if (!Menu) {
EITScanner.Process();
+ /*XXX+
if (!cVideoCutter::Active() && cVideoCutter::Ended()) {
if (cVideoCutter::Error())
Interface->Error(tr("Editing process failed!"));
else
Interface->Info(tr("Editing process finished"));
}
+ XXX*/
}
- if (!*Interact && ((!cRecordControls::Active() && !cVideoCutter::Active()) || ForceShutdown)) {
+ if (!*Interact && ((!cRecordControls::Active() /*XXX+&& !cVideoCutter::Active()XXX*/) || ForceShutdown)) {
time_t Now = time(NULL);
if (Now - LastActivity > ACTIVITYTIMEOUT) {
// Shutdown:
@@ -593,16 +597,17 @@ int main(int argc, char *argv[])
}
if (Interrupted)
isyslog("caught signal %d", Interrupted);
- cVideoCutter::Stop();
+ cRecordControls::Shutdown();
+ //XXX+cVideoCutter::Stop();
delete Menu;
delete ReplayControl;
delete Interface;
cOsd::Shutdown();
PluginManager.Shutdown(true);
- Setup.CurrentChannel = cDvbApi::CurrentChannel();
- Setup.CurrentVolume = cDvbApi::CurrentVolume();
+ Setup.CurrentChannel = cDevice::CurrentChannel();
+ Setup.CurrentVolume = cDevice::CurrentVolume();
Setup.Save();
- cDvbApi::Shutdown();
+ cDevice::Shutdown();
if (WatchdogTimeout > 0)
dsyslog("max. latency time %d seconds", MaxLatencyTime);
isyslog("exiting");