#include "status.h"
#include "menu.h"


cStatusMonitor::cStatusMonitor()

{
  data.ActualSource=0;
  transfer=false;
}

void cStatusMonitor::ChannelSwitch(const cDevice *Device, int ChannelNumber)
{
  Aktiv=false;
  device=cDevice::GetDevice(data.DvbCard);
  if (ChannelNumber)
  {
    if ((Device!=cDevice::PrimaryDevice()) || (cDevice::ActualDevice()==cDevice::PrimaryDevice()) || (cDevice::PrimaryDevice()->cDevice::HasProgramme()) && transfer)
    {
      Channel = Channels.GetByNumber(ChannelNumber);
      if (data.card[Device->CardIndex()])      
        if ((*Channel).Source()!=data.ActualSource)  
        {
          if (data.UseGotoX)
          {
            data.ActualSource=(*Channel).Source();
            GotoX(data.ActualSource);
          }
        }
    }
    if ((cDevice::ActualDevice()!=cDevice::PrimaryDevice()) && (Device==cDevice::PrimaryDevice()) )
      transfer=true;
    if ((cDevice::ActualDevice()==cDevice::PrimaryDevice()) && (Device==cDevice::PrimaryDevice())) transfer=false;
  }
}
