summaryrefslogtreecommitdiff
path: root/pages/remote.ecpp
diff options
context:
space:
mode:
authorDieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de>2009-04-17 00:02:58 +0200
committerDieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de>2009-04-17 00:02:58 +0200
commitd2a03a79176fce81ebe87b2263fa988df1eb547c (patch)
tree0a8d050cbcd44d371d1b5fc959ce4fd1c3610038 /pages/remote.ecpp
parente3343f602dfe288afa1f027563d307d049d95c1e (diff)
downloadvdr-plugin-live-d2a03a79176fce81ebe87b2263fa988df1eb547c.tar.gz
vdr-plugin-live-d2a03a79176fce81ebe87b2263fa988df1eb547c.tar.bz2
Integrated a patch against LIVE 0.2.0 which adds channel numbers.
The patch was contributed by John Germs, Chavonbravo from CaptiveWorks (see http://captiveworks.org/open-source/vdr-live/ )
Diffstat (limited to 'pages/remote.ecpp')
-rw-r--r--pages/remote.ecpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/pages/remote.ecpp b/pages/remote.ecpp
index 4805728..dd45cd0 100644
--- a/pages/remote.ecpp
+++ b/pages/remote.ecpp
@@ -2,6 +2,7 @@
#include <locale>
#include <vdr/i18n.h>
#include <vdr/keys.h>
+#include <vdr/device.h>
#include "grab.h"
#include "setup.h"
#include "tools.h"
@@ -10,9 +11,15 @@ using namespace std;
using namespace vdrlive;
</%pre>
+<%args>
+ int channel = -1;
+</%args>
<%session scope="global">
bool logged_in(false);
</%session>
+<%request scope="page">
+ cChannel* Channel;
+</%request>
<%include>page_init.eh</%include>
<{
if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
@@ -20,6 +27,25 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
<%cpp>
pageTitle = tr("Remote Control");
+ ReadLock channelsLock( Channels );
+ if ( !channelsLock )
+ throw HtmlError( tr("Couldn't aquire access to channels, please try again later.") );
+
+ // cChannel* Channel; (see %request above)
+ if ( channel > 0 ) {
+ Channel = Channels.GetByNumber( channel );
+ }
+ else {
+ if (cDevice::CurrentChannel()) {
+ Channel = Channels.GetByNumber(cDevice::CurrentChannel());
+ }
+ else {
+ Channel = Channels.Get( Channels.GetNextNormal( -1 ) );
+ }
+ }
+ if ( Channel == 0 )
+ throw HtmlError( tr("Couldn't find channel or no channels available. Maybe you mistyped your request?") );
+
</%cpp>
<& pageelems.doc_type &>
<html>
@@ -127,5 +153,5 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
<%include>page_exit.eh</%include>
<%def remote_actions>
-<$ tr("Interval") $>: <select name="interval" onchange="ChangeInterval()"></select>
+<$ tr("Snapshot interval") $>: <select name="interval" onchange="ChangeInterval()"></select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<& pageelems.vlc_stream_channel channelId=(Channel->GetChannelID()) &>
</%def>