summaryrefslogtreecommitdiff
path: root/pages
diff options
context:
space:
mode:
authorSascha Volkenandt <sascha (at) akv-soft (dot) de>2007-01-13 18:37:21 +0000
committerSascha Volkenandt <sascha (at) akv-soft (dot) de>2007-01-13 18:37:21 +0000
commit2072c668df9ad48586fd2750713da0be742dda6d (patch)
treeb6a8af74320fe0b4af845fdc7ec0fca40d88f02d /pages
parent872af377d5d207b0292c4deb3ebdff09c116ea3d (diff)
downloadvdr-plugin-live-2072c668df9ad48586fd2750713da0be742dda6d.tar.gz
vdr-plugin-live-2072c668df9ad48586fd2750713da0be742dda6d.tar.bz2
- added service to switch channels by channel-id
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>