summaryrefslogtreecommitdiff
path: root/status.c
diff options
context:
space:
mode:
Diffstat (limited to 'status.c')
-rw-r--r--status.c50
1 files changed, 29 insertions, 21 deletions
diff --git a/status.c b/status.c
index 0a0ae22..80b107e 100644
--- a/status.c
+++ b/status.c
@@ -5,8 +5,6 @@
*
*/
-#include <vdr/channels.h>
-
#include "status.h"
#include "control.h"
#include "event.h"
@@ -20,22 +18,23 @@ cStatusBlock::cStatusBlock(void):
void cStatusBlock::ChannelSwitch(const cDevice *Device, int ChannelNumber)
{
int current_channel=cDevice::CurrentChannel();
- int device_number=Device->DeviceNumber();
-
- if (cSetupBlock::LastChannel==0)
+#ifdef LOGGING
+ int device_number=Device->DeviceNumber();
+#endif
+
+ if (cSetupBlock::LastAcceptableChannel==0)
{
#ifdef LOGGING
- dsyslog("plugin-block: ChannelSwitch returned because LastChannel=0");
+ dsyslog("plugin-block: ChannelSwitch returned because LastAcceptableChannel=0");
#endif
- cSetupBlock::LastChannel=current_channel;
+ cSetupBlock::LastAcceptableChannel=current_channel;
return;
}
if (ChannelNumber==0)
{
#ifdef LOGGING
- dsyslog("plugin-block: ChannelSwitch: device switching - setting LastChannel to %d",current_channel);
-#endif
- cSetupBlock::LastChannel=current_channel;
+ dsyslog("plugin-block: ChannelSwitch returned because ChannelNumber=0 (switch in progress).");
+#endif
return; //Switch in progress;
}
@@ -46,33 +45,37 @@ void cStatusBlock::ChannelSwitch(const cDevice *Device, int ChannelNumber)
for (int ii=0;ii<cDevice::NumDevices();ii++)
{
cDevice* tmpdev=cDevice::GetDevice(ii);
- dsyslog("plugin-block: cDevice %d replaying: %d, transferring %d",ii,tmpdev->Replaying(),tmpdev->Transferring());
+ dsyslog("plugin-block: cDevice %d replaying: %d, transferring %d, hasprogramme %d",ii,tmpdev->Replaying(),tmpdev->Transferring(),tmpdev->HasProgramme());
}
#endif
- if (cSetupBlock::DetectionMethod!=0)
+ if (Device->DeviceNumber()!=cDevice::PrimaryDevice()->DeviceNumber())
{
#ifdef LOGGING
- dsyslog("plugin-block: ChannelSwitch returned because other detection method active");
+ dsyslog("plugin-block: Did nothing cause ChannelSwitch not on active livedevice.");
#endif
return;
}
- if (Device->DeviceNumber()!=cDevice::PrimaryDevice()->DeviceNumber())
+
+ if (ChannelNumber!=current_channel)
{
#ifdef LOGGING
- dsyslog("plugin-block: Did nothing cause ChannelSwitch not on active livedevice.");
+ dsyslog("plugin-block: Did nothing because ChannelNumber!=CurrentChannel (switch still in progress)");
#endif
- return;
+
+ return;
}
- if (ChannelNumber!=current_channel)
+ if (cSetupBlock::DetectionMethod!=0)
{
#ifdef LOGGING
- dsyslog("plugin-block: Did nothing because ChannelNumber!=CurrentChannel (switch still in progress)");
+ dsyslog("plugin-block: ChannelSwitch returned because other detection method active");
#endif
return;
}
+
+
if (Device->Replaying())
{
@@ -117,6 +120,11 @@ void cStatusBlock::ChannelSwitch(const cDevice *Device, int ChannelNumber)
dsyslog("plugin-block: channel %d blocked", ChannelNumber);
cControl::Launch(new cControlBlock(channel, present, follow));
}
+ else
+ {
+ cSetupBlock::LastAcceptableChannel=cDevice::CurrentChannel();
+ cSetupBlock::user_direction=0;
+ }
}
}
@@ -129,9 +137,9 @@ void cStatusBlock::Replaying(const cControl *Control,
if (On) replaystate=(char*)"started";
else replaystate=(char*)"stopped";
cEventBlock::ReplayingRecording=(bool*)On;
+ if (Name!=NULL) strncpy(cSetupBlock::ReplayingName,Name,sizeof(cSetupBlock::ReplayingName));
#ifdef LOGGING
- dsyslog("plugin-block: cStatusBlock: Replay: '%s' from '%s'",Name,FileName);
-#endif
+ dsyslog("plugin-block: cStatusBlock: Replay: '%s' from '%s' %s",Name,FileName,replaystate);
+#endif
}
- \ No newline at end of file