summaryrefslogtreecommitdiff
path: root/pages/switch_channel.ecpp
blob: 501715e6ce8e424e9eeab392f364558750383e39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<%pre>
#include <vdr/channels.h>
#include "exception.h"
#include "tasks.h"
#include "tools.h"

using namespace vdrlive;

</%pre>
<%args>
	tChannelID channelid;
</%args>
<%cpp>
	bool result = false;

	reply.setContentType( "application/xml" );

	ReadLock channelsLock( Channels );
	if ( channelsLock ) {
		cChannel* channel = Channels.GetByChannelID( channelid );
		if ( channel != 0 )
			result = LiveTaskManager().SwitchChannel( channel->Number() );
	}
</%cpp>
<?xml version="1.0"?>
<service>
<request name="switch_channel">
<param name="channel"><$ *channelid.ToString() $></param>
</request>
<response><$ result ? "1" : "0" $></response>
</service>