[vdr] receive data with low prio, so user-action can detach the receiver

Patrick Fischer patrick_fischer at gmx.de
Wed Nov 23 12:48:12 CET 2005


Hello Klaus,

>
> Wouldn't it be enough to simply give your receiver a priority
> of -2 (anything less than -1 would do)? That way any recording
> and even a Transfer Mode (which uses priority -1) could detach your
> receiver.
>  
> Klaus

now I have rewritten all my code. It seems to work.

this function finds a device which can provide a receiver without detach 
any receiver. (independent of the prio)

bool needdetach = false;
bool found = false;
for (int i=0; (i < (cDevice::NumDevices()-1) && !found);i++){
   device = cDevice::GetDevice(i);
   if(device->ProvidesChannel(channel,PRIOCHANGECHANNEL,&needdetach) && 
!needdetach){ 	
     //device can Provide Channel and no receiver has to detach			
     found = true;
   }else{
     device = NULL;	
   }		
}
if(device){
   device->SwitchChannel(channel,false);
   device->AttachReceiver(receiver);
}

on the found device i can add myreceiver with Prio -2

additional I observe all myreceiver. If I want to add a new myreceiver 
to a device I will look at my local List, if I have already added a 
receiver to the transponder. If I found one I will add my receiver to 
the same device.

But now I need to recognize if vdr has detached my receiver.
So I have used void cMyReciver::Activate(bool On) to recognize if it 
will detach. The Problem is, that it will only be detached if vdr will
shutdown.


Patrick




More information about the vdr mailing list