diff options
Diffstat (limited to 'pages')
-rw-r--r-- | pages/Makefile | 6 | ||||
-rw-r--r-- | pages/ffw_recording.ecpp | 26 | ||||
-rw-r--r-- | pages/ibox.ecpp | 65 | ||||
-rw-r--r-- | pages/menu.ecpp | 4 | ||||
-rw-r--r-- | pages/pageelems.ecpp | 20 | ||||
-rw-r--r-- | pages/pause_recording.ecpp | 26 | ||||
-rw-r--r-- | pages/play_recording.ecpp | 13 | ||||
-rw-r--r-- | pages/recordings.ecpp | 15 | ||||
-rw-r--r-- | pages/rwd_recording.ecpp | 26 | ||||
-rw-r--r-- | pages/stop_recording.ecpp | 26 | ||||
-rw-r--r-- | pages/switch_channel.ecpp | 9 | ||||
-rw-r--r-- | pages/xmlresponse.ecpp | 62 |
12 files changed, 218 insertions, 80 deletions
diff --git a/pages/Makefile b/pages/Makefile index fadb1b9..92a4932 100644 --- a/pages/Makefile +++ b/pages/Makefile @@ -18,9 +18,11 @@ VDRDIR ?= ../../../.. OBJS = menu.o channels.o recordings.o schedule.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.o play_recording.o \ + error.o pageelems.o tooltip.o \ searchtimers.o edit_searchtimer.o searchresults.o \ - searchepg.o login.o ibox.o + searchepg.o login.o ibox.o xmlresponse.o \ + play_recording.o pause_recording.o stop_recording.o \ + ffw_recording.o rwd_recording.o ### Default rules: diff --git a/pages/ffw_recording.ecpp b/pages/ffw_recording.ecpp new file mode 100644 index 0000000..5b2d8bc --- /dev/null +++ b/pages/ffw_recording.ecpp @@ -0,0 +1,26 @@ +<%pre> +#include <string> +#include <vdr/recording.h> +#include "exception.h" +#include "setup.h" +#include "tasks.h" +#include "tools.h" + +using namespace std; +using namespace vdrlive; + +</%pre> +<%args> + string param; +</%args> +<%session scope="global"> + bool logged_in(false); +</%session> +<%cpp> + if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); + reply.setContentType( "application/xml" ); + + ForwardRecordingTask task( param ); + LiveTaskManager().Execute( task ); +</%cpp> +<& xmlresponse.ajax name=("ffw_recording") pname=("recording") value=(param) result=(task.Result()) error=(task.Error()) &> diff --git a/pages/ibox.ecpp b/pages/ibox.ecpp index e2b2fb8..0ed2f8c 100644 --- a/pages/ibox.ecpp +++ b/pages/ibox.ecpp @@ -10,6 +10,7 @@ #include "setup.h" #include "tools.h" #include "epg_events.h" +#include "recordings.h" using namespace vdrlive; using namespace std; @@ -30,18 +31,22 @@ bool logged_in(false); reply.setContentType( "application/xml" ); if (cReplayControl::NowReplaying()) { - cThreadLock RecordingsLock(&Recordings); - cRecording *Recording = Recordings.GetByName(cReplayControl::NowReplaying()); - if (Recording) { - const cRecordingInfo* info = Recording->Info(); + RecordingsManagerPtr recManager = LiveRecordingsManager(); + cRecording *recording = Recordings.GetByName(cReplayControl::NowReplaying()); + if (recording) { + string name(recording->Name()); + size_t index = name.find_last_of('~'); + if (index != string::npos) + name = name.substr(index, name.length()); + const cRecordingInfo* info = recording->Info(); if (info) { - EpgEventPtr epgEvent(new EpgEvent("recording", - Recording->Name(), - info->Title() ? info->Title() : Recording->Name(), + EpgEventPtr epgEvent(new EpgEvent(recManager->Md5Hash(recording), + tr("playing recording"), + info->Title() ? info->Title() : name, info->ShortText() ? info->ShortText() : "", info->Description() ? info->Description() : "", - Recording->start, - Recording->start)); + recording->start, + recording->start)); epgEvents.push_back(epgEvent); } } @@ -124,59 +129,25 @@ bool logged_in(false); if (prev_chan.Valid() && next_chan.Valid()) { </%cpp> -<& xmlresponse update=(update) type=(epg->Id()) caption=(epg->Caption()) currentTime=(epg->CurrentTime(tr("%I:%M:%S %p"))) duration=(epg->StartTime(tr("%I:%M %p")) + string(" - ") + epg->EndTime(tr("%I:%M %p"))) title=(epg->Title()) elapsed=(epg->Elapsed()) prev_chan=(prev_chan) next_chan=(next_chan) &> +<& xmlresponse.ibox update=(update) type=(epg->Id()) caption=(epg->Caption()) currentTime=(epg->CurrentTime(tr("%I:%M:%S %p"))) duration=(epg->StartTime(tr("%I:%M %p")) + string(" - ") + epg->EndTime(tr("%I:%M %p"))) title=(epg->Title()) elapsed=(epg->Elapsed()) prev_chan=(prev_chan) next_chan=(next_chan) &> <%cpp> } else if (prev_chan.Valid()) { </%cpp> -<& xmlresponse update=(update) type=(epg->Id()) caption=(epg->Caption()) currentTime=(epg->CurrentTime(tr("%I:%M:%S %p"))) duration=(epg->StartTime(tr("%I:%M %p")) + string(" - ") + epg->EndTime(tr("%I:%M %p"))) title=(epg->Title()) elapsed=(epg->Elapsed()) prev_chan=(prev_chan) &> +<& xmlresponse.ibox update=(update) type=(epg->Id()) caption=(epg->Caption()) currentTime=(epg->CurrentTime(tr("%I:%M:%S %p"))) duration=(epg->StartTime(tr("%I:%M %p")) + string(" - ") + epg->EndTime(tr("%I:%M %p"))) title=(epg->Title()) elapsed=(epg->Elapsed()) prev_chan=(prev_chan) &> <%cpp> } else if (next_chan.Valid()) { </%cpp> -<& xmlresponse update=(update) type=(epg->Id()) caption=(epg->Caption()) currentTime=(epg->CurrentTime(tr("%I:%M:%S %p"))) duration=(epg->StartTime(tr("%I:%M %p")) + string(" - ") + epg->EndTime(tr("%I:%M %p"))) title=(epg->Title()) elapsed=(epg->Elapsed()) next_chan=(next_chan) &> +<& xmlresponse.ibox update=(update) type=(epg->Id()) caption=(epg->Caption()) currentTime=(epg->CurrentTime(tr("%I:%M:%S %p"))) duration=(epg->StartTime(tr("%I:%M %p")) + string(" - ") + epg->EndTime(tr("%I:%M %p"))) title=(epg->Title()) elapsed=(epg->Elapsed()) next_chan=(next_chan) &> <%cpp> } else { </%cpp> -<& xmlresponse update=(update) type=(epg->Id()) caption=(epg->Caption()) currentTime=(epg->CurrentTime(tr("%I:%M:%S %p"))) duration=(epg->StartTime(tr("%I:%M %p")) + string(" - ") + epg->EndTime(tr("%I:%M %p"))) title=(epg->Title()) elapsed=(epg->Elapsed()) &> +<& xmlresponse.ibox update=(update) type=(epg->Id()) caption=(epg->Caption()) currentTime=(epg->CurrentTime(tr("%I:%M:%S %p"))) duration=(epg->StartTime(tr("%I:%M %p")) + string(" - ") + epg->EndTime(tr("%I:%M %p"))) title=(epg->Title()) elapsed=(epg->Elapsed()) &> <%cpp> } break; } </%cpp> -<%def xmlresponse> -<%args> - int update; - string type; - string currentTime; - string caption; - string title; - string duration; - int elapsed; - string prev_chan; - string next_chan; -</%args> -<?xml version="1.0" encoding="ISO-8859-1"?> -<service> - <request name="ibox"> - <param name="update"><$ update $></param> - </request> - <response>1</response> - <error></error> - <values> - <update><$ update $></update> - <epginfo> - <type><$ type $></type> - <caption><$ caption $></caption> - <timenow><$ currentTime $></timenow> - <name><$ title $></name> - <duration><$ duration $></duration> - <elapsed><$ elapsed $></elapsed> - <nextchan><$ next_chan $></nextchan> - <prevchan><$ prev_chan $></prevchan> - </epginfo> - </values> -</service> -</%def> diff --git a/pages/menu.ecpp b/pages/menu.ecpp index 5acbc13..ac31d79 100644 --- a/pages/menu.ecpp +++ b/pages/menu.ecpp @@ -39,9 +39,9 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); % } <a href="recordings.html" <& menu.setactive current=("recordings") &>><$ tr("Recordings") $></a> | <a href="remote.html" <& menu.setactive current=("remote") &>><$ tr("Remote Control") $></a> -<!-- Used by D.H. to test infobox (not part of the released version) +<# --- Used by D.H. to test infobox (not part of the released version) | <a href="ibox_status.html" <& menu.setactive current=("status") &>><$ tr("Status Test") $></a> ---> +--- #> % if (LiveSetup().UseAuth()) { | <a id="login" href="login.html?action=logout"><$ tr("Logout") $></a> % } diff --git a/pages/pageelems.ecpp b/pages/pageelems.ecpp index a7fcf33..e12f9dc 100644 --- a/pages/pageelems.ecpp +++ b/pages/pageelems.ecpp @@ -41,13 +41,19 @@ using namespace vdrlive; <div id="infobox_duration" class="duration">--:--</div> </div> <div class="st_controls"> - <div class="st_btns"> - <a href="javascript:LiveStatusToggleUpdate()" <& tooltip.hint text=(tr("Stop updates")) &>><img id="statusReloadBtn" src="stop.png" alt="" /></a> - <span id="infobox_recording_buttons" style="display: none"></span> - <span id="infobox_channel_buttons"> - <& ajax_action_href action=("switch_channel") id=("infobox_prevchan") image=("one_downarrow.png") tip=(tr("previous channel")) &> - <& ajax_action_href action=("switch_channel") id=("infobox_nextchan") image=("one_uparrow.png") tip=(tr("next channel")) &> - </span> + <div class="st_update"> + <a href="javascript:LiveStatusToggleUpdate()" <& tooltip.hint text=(tr("Stop updates")) &>><img id="statusReloadBtn" src="stop_update.png" alt="" /></a> + </div> + <div id="infobox_recording_buttons" style="display: none"> + <& ajax_action_href action=("stop_recording") id=("infobox_stop") image=("stop.png") tip=(tr("stop playback")) &> + <& ajax_action_href action=("play_recording") id=("infobox_play") image=("play.png") tip=(tr("resume playback")) &> + <& ajax_action_href action=("pause_recording") id=("infobox_pause") image=("pause.png") tip=(tr("pause playback")) &> + <& ajax_action_href action=("rwd_recording") id=("infobox_rwd") image=("rwd.png") tip=(tr("fast forward")) &> + <& ajax_action_href action=("ffw_recording") id=("infobox_ffw") image=("ffw.png") tip=(tr("fast rewind")) &> + </div> + <div id="infobox_channel_buttons"> + <& ajax_action_href action=("switch_channel") id=("infobox_prevchan") image=("one_downarrow.png") tip=(tr("previous channel")) &> + <& ajax_action_href action=("switch_channel") id=("infobox_nextchan") image=("one_uparrow.png") tip=(tr("next channel")) &> </div> <div class="st_pbar"> <& progressbar id=("infobox_elapsed") &> diff --git a/pages/pause_recording.ecpp b/pages/pause_recording.ecpp new file mode 100644 index 0000000..1208a42 --- /dev/null +++ b/pages/pause_recording.ecpp @@ -0,0 +1,26 @@ +<%pre> +#include <string> +#include <vdr/recording.h> +#include "exception.h" +#include "setup.h" +#include "tasks.h" +#include "tools.h" + +using namespace std; +using namespace vdrlive; + +</%pre> +<%args> + string param; +</%args> +<%session scope="global"> + bool logged_in(false); +</%session> +<%cpp> + if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); + reply.setContentType( "application/xml" ); + + PauseRecordingTask task( param ); + LiveTaskManager().Execute( task ); +</%cpp> +<& xmlresponse.ajax name=("pause_recording") pname=("recording") value=(param) result=(task.Result()) error=(task.Error()) &> diff --git a/pages/play_recording.ecpp b/pages/play_recording.ecpp index 3d95352..5a26b41 100644 --- a/pages/play_recording.ecpp +++ b/pages/play_recording.ecpp @@ -14,20 +14,13 @@ using namespace vdrlive; string param; </%args> <%session scope="global"> -bool logged_in(false); + bool logged_in(false); </%session> <%cpp> if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); reply.setContentType( "application/xml" ); - ReplayRecordingTask task( param ); + PlayRecordingTask task( param ); LiveTaskManager().Execute( task ); </%cpp> -<?xml version="1.0"?> -<service> -<request name="play_recording"> -<param name="recording"><$ param $></param> -</request> -<response><$ task.Result() $></response> -<error><$ task.Error() $></error> -</service> +<& xmlresponse.ajax name=("play_recording") pname=("recording") value=(param) result=(task.Result()) error=(task.Error()) &> diff --git a/pages/recordings.ecpp b/pages/recordings.ecpp index 4993284..ebc68e7 100644 --- a/pages/recordings.ecpp +++ b/pages/recordings.ecpp @@ -102,10 +102,10 @@ for (iter = recordingsTree.begin(path); iter != end; ++iter) { } string day(FormatDateTime("%a,", recItem->StartTime())); string dayLen(lexical_cast<string, int>(day.length() - 1) + ".25em;"); - string shortDescr(tr("Click to view details.")); if (epgEvent && !epgEvent->ShortDescr().empty()) shortDescr = (epgEvent->ShortDescr() + string("<br />") + shortDescr); + string hint(tr("Click to view details.")); if (epgEvent && !epgEvent->ShortDescr().empty()) hint = (epgEvent->ShortDescr() + "<br />" + hint); </%cpp> <li class="recording"> - <& rec_item_file name=(recItem->Name()) level=(level) id=(recItem->Id()) day=(day) dayLen=(dayLen) startTime=(recItem->StartTime()) shortDescr=(shortDescr) archived=(epgEvent ? epgEvent->Archived() : "") archiveId=(recItem->ArchiveId()) &> + <& rec_item_file name=(recItem->Name()) level=(level) id=(recItem->Id()) day=(day) dayLen=(dayLen) startTime=(recItem->StartTime()) hint=(hint) shortDescr=(epgEvent ? epgEvent->ShortDescr() : "") archived=(epgEvent ? epgEvent->Archived() : "") archiveId=(recItem->ArchiveId()) &> </li> <%cpp> } @@ -177,6 +177,7 @@ for (iter = recordingsTree.begin(path); iter != end; ++iter) { string day; string dayLen; time_t startTime; + string hint; string shortDescr; string archived; string archiveId; @@ -187,8 +188,7 @@ for (iter = recordingsTree.begin(path); iter != end; ++iter) { <div class="recording_day" style="width: <$ dayLen $>"><$ day $></div> <div class="recording_date"><$ FormatDateTime(tr("%b %d %y"), startTime) $></div> <div class="recording_time"><$ FormatDateTime(tr("%I:%M %p"), startTime) $></div> - <div class="recording_name" <& tooltip.hint text=(shortDescr) &><& tooltip.display domId=(id) &>><$ name $></div> - <%cpp> if (! archived.empty()) { </%cpp><div><$ archived $></div><%cpp> } </%cpp> + <div class="recording_name" <& tooltip.hint text=(hint) &><& tooltip.display domId=(id) &>><$ name $><br /><%cpp>if ((name != shortDescr) && (!shortDescr.empty())) {</%cpp><span><$ shortDescr $></span><%cpp> } else { </%cpp><span> </span><%cpp> } </%cpp></div> </div> <div class="recording_actions"> <%cpp> @@ -206,5 +206,12 @@ for (iter = recordingsTree.begin(path); iter != end; ++iter) { <img src="edit.png" alt="" /> <img src="del.png" alt="" /> </div> +<%cpp> + if (! archived.empty()) { +</%cpp> + <div class="recording_arch"><$ archived $></div> +<%cpp> + } +</%cpp> </div> </%def> diff --git a/pages/rwd_recording.ecpp b/pages/rwd_recording.ecpp new file mode 100644 index 0000000..a0ce569 --- /dev/null +++ b/pages/rwd_recording.ecpp @@ -0,0 +1,26 @@ +<%pre> +#include <string> +#include <vdr/recording.h> +#include "exception.h" +#include "setup.h" +#include "tasks.h" +#include "tools.h" + +using namespace std; +using namespace vdrlive; + +</%pre> +<%args> + string param; +</%args> +<%session scope="global"> + bool logged_in(false); +</%session> +<%cpp> + if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); + reply.setContentType( "application/xml" ); + + BackwardRecordingTask task( param ); + LiveTaskManager().Execute( task ); +</%cpp> +<& xmlresponse.ajax name=("rwd_recording") pname=("recording") value=(param) result=(task.Result()) error=(task.Error()) &> diff --git a/pages/stop_recording.ecpp b/pages/stop_recording.ecpp new file mode 100644 index 0000000..869beb0 --- /dev/null +++ b/pages/stop_recording.ecpp @@ -0,0 +1,26 @@ +<%pre> +#include <string> +#include <vdr/recording.h> +#include "exception.h" +#include "setup.h" +#include "tasks.h" +#include "tools.h" + +using namespace std; +using namespace vdrlive; + +</%pre> +<%args> + string param; +</%args> +<%session scope="global"> + bool logged_in(false); +</%session> +<%cpp> + if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); + reply.setContentType( "application/xml" ); + + StopRecordingTask task( param ); + LiveTaskManager().Execute( task ); +</%cpp> +<& xmlresponse.ajax name=("stop_recording") pname=("recording") value=(param) result=(task.Result()) error=(task.Error()) &> diff --git a/pages/switch_channel.ecpp b/pages/switch_channel.ecpp index 91f4f30..0031f4e 100644 --- a/pages/switch_channel.ecpp +++ b/pages/switch_channel.ecpp @@ -16,11 +16,4 @@ using namespace vdrlive; SwitchChannelTask task( param ); LiveTaskManager().Execute( task ); </%cpp> -<?xml version="1.0"?> -<service> -<request name="switch_channel"> -<param name="channel"><$ param $></param> -</request> -<response><$ task.Result() $></response> -<error><$ task.Error() $></error> -</service> +<& xmlresponse.ajax name=("switch_channel") pname=("channel") value=(param) result=(task.Result()) error=(task.Error()) &> diff --git a/pages/xmlresponse.ecpp b/pages/xmlresponse.ecpp new file mode 100644 index 0000000..1123368 --- /dev/null +++ b/pages/xmlresponse.ecpp @@ -0,0 +1,62 @@ +<%pre> +#include <string> + +using namespace std; +</%pre> + +<# ------------------------------------------------------------------------- #> + +<%def ajax> +<%args> + string name; + string pname; + string value; + bool result; + string error; +</%args> +<?xml version="1.0" encoding="ISO-8859-1"?> +<service> + <request name="<$ name $>"> + <param name="<$ pname $>"><$ value $></param> + </request> + <response><$ result $></response> + <error><$ error $></error> +</service> +</%def> + +<# ------------------------------------------------------------------------- #> + +<%def ibox> +<%args> + int update; + string type; + string currentTime; + string caption; + string title; + string duration; + int elapsed; + string prev_chan; + string next_chan; +</%args> +<?xml version="1.0" encoding="ISO-8859-1"?> +<service> + <request name="ibox"> + <param name="update"><$ update $></param> + </request> + <response>1</response> + <error></error> + <values> + <update><$ update $></update> + <epginfo> + <type><$ type $></type> + <caption><$ caption $></caption> + <timenow><$ currentTime $></timenow> + <name><$ title $></name> + <duration><$ duration $></duration> + <elapsed><$ elapsed $></elapsed> + <nextchan><$ next_chan $></nextchan> + <prevchan><$ prev_chan $></prevchan> + </epginfo> + </values> +</service> +</%def> |