From d2a03a79176fce81ebe87b2263fa988df1eb547c Mon Sep 17 00:00:00 2001 From: Dieter Hametner Date: Fri, 17 Apr 2009 00:02:58 +0200 Subject: 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/ ) --- pages/remote.ecpp | 28 +++++++++++++++++++++++++++- pages/schedule.ecpp | 9 ++++++++- pages/vlc.ecpp | 2 +- pages/whats_on.ecpp | 4 ++-- 4 files changed, 38 insertions(+), 5 deletions(-) (limited to 'pages') 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 #include #include +#include #include "grab.h" #include "setup.h" #include "tools.h" @@ -10,9 +11,15 @@ using namespace std; using namespace vdrlive; +<%args> + int channel = -1; + <%session scope="global"> bool logged_in(false); +<%request scope="page"> + cChannel* Channel; + <%include>page_init.eh <{ 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?") ); + <& pageelems.doc_type &> @@ -127,5 +153,5 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); <%include>page_exit.eh <%def remote_actions> -<$ tr("Interval") $>: +<$ tr("Snapshot interval") $>:           <& pageelems.vlc_stream_channel channelId=(Channel->GetChannelID()) &> diff --git a/pages/schedule.ecpp b/pages/schedule.ecpp index 544136b..8a77059 100644 --- a/pages/schedule.ecpp +++ b/pages/schedule.ecpp @@ -145,5 +145,12 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); <%include>page_exit.eh <%def channel_selection> -
<& channels_widget name=("channel") selected=(Channel ? *Channel->GetChannelID().ToString() : "") onchange=("document.forms.channels.submit()") &> <& pageelems.ajax_action_href action="switch_channel" tip=(tr("Switch to this channel.")) param=(Channel->GetChannelID()) image="zap.png" alt="" &><& pageelems.vlc_stream_channel channelId=(Channel->GetChannelID()) &>
+
+ + + <& channels_widget name=("channel") selected=(Channel ? *Channel->GetChannelID().ToString() : "") onchange=("document.forms.channels.submit()") &> + <& pageelems.ajax_action_href action="switch_channel" tip=(tr("Switch to this channel.")) param=(Channel->GetChannelID()) image="zap.png" alt="" &> + <& pageelems.vlc_stream_channel channelId=(Channel->GetChannelID()) &> + +
diff --git a/pages/vlc.ecpp b/pages/vlc.ecpp index d1afd67..050f716 100644 --- a/pages/vlc.ecpp +++ b/pages/vlc.ecpp @@ -145,7 +145,7 @@ using namespace vdrlive; <%cpp> } -

<$ tr("VLC media URL") $>: <$ videourl $>

+

<$ tr("VLC media URL") $>: <$ videourl $>

diff --git a/pages/whats_on.ecpp b/pages/whats_on.ecpp index 316c03b..8232875 100644 --- a/pages/whats_on.ecpp +++ b/pages/whats_on.ecpp @@ -195,7 +195,7 @@ if (type == "now") {