Adds function to stop PIP.

This commit is contained in:
Johns 2013-01-04 18:50:14 +01:00
parent 1a744a8eb8
commit 59d1a6b1f2

View File

@ -1476,6 +1476,8 @@ void cSoftReceiver::Receive(uchar * data, int size)
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
static cSoftReceiver * PipReceiver; ///< PIP receiver
/** /**
** Prepare new PIP. ** Prepare new PIP.
*/ */
@ -1490,13 +1492,28 @@ static void NewPip(void)
&& (channel = Channels.GetByNumber(cDevice::CurrentChannel())) && (channel = Channels.GetByNumber(cDevice::CurrentChannel()))
&& (device = cDevice::GetDevice(channel, 1, false))) { && (device = cDevice::GetDevice(channel, 1, false))) {
fprintf(stderr, "pip: %d %p %p\n", channel_nr, channel, device); fprintf(stderr, "pip: %d %p %p\n", channel_nr, channel, device);
delete PipReceiver;
PipReceiver = NULL;
device->SwitchChannel(channel, false); device->SwitchChannel(channel, false);
receiver = new cSoftReceiver(channel); receiver = new cSoftReceiver(channel);
device->AttachReceiver(receiver); device->AttachReceiver(receiver);
fprintf(stderr, "pip: attached\n"); fprintf(stderr, "pip: attached\n");
PipReceiver = receiver;
} }
} }
/**
** Stop PIP.
*/
static void DelPip(void)
{
fprintf(stderr, "pip: stopped\n");
delete PipReceiver;
PipReceiver = NULL;
}
#endif #endif
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
@ -1743,6 +1760,9 @@ eOSState cSoftHdMenu::ProcessKey(eKeys key)
case osUser2: case osUser2:
NewPip(); NewPip();
return osEnd; return osEnd;
case osUser8:
DelPip();
return osEnd;
#endif #endif
default: default:
Create(); Create();