summaryrefslogtreecommitdiff
path: root/pages/remote.ecpp
diff options
context:
space:
mode:
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>