summaryrefslogtreecommitdiff
path: root/pages
diff options
context:
space:
mode:
Diffstat (limited to 'pages')
-rw-r--r--pages/Makefile2
-rw-r--r--pages/switch_channel.ecpp31
2 files changed, 32 insertions, 1 deletions
diff --git a/pages/Makefile b/pages/Makefile
index 8da6bb1..6bf3286 100644
--- a/pages/Makefile
+++ b/pages/Makefile
@@ -16,7 +16,7 @@ VDRDIR ?= ../../../..
### The object files (add further files here):
OBJS = menu.o channels.o recordings.o schedule.o \
- screenshot.o timers.o whats_on.o \
+ screenshot.o timers.o whats_on.o switch_channel.o \
keypress.o remote.o channels_widget.o edit_timer.o \
error.o pageelems.o tooltip_widget.o
diff --git a/pages/switch_channel.ecpp b/pages/switch_channel.ecpp
new file mode 100644
index 0000000..501715e
--- /dev/null
+++ b/pages/switch_channel.ecpp
@@ -0,0 +1,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>