summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorM. Voerman <rekordc@gmail.com>2013-01-11 00:47:47 +0100
committerM. Voerman <rekordc@gmail.com>2013-01-11 00:47:47 +0100
commit47a3062b8682dd4b9494b585f87761124308d0af (patch)
tree519f558a686ceb473b00e1106556ec07e4ee0b33
parentc07a11c527ce74de1a600e46c4edfcfe5d9bc78a (diff)
downloadvdr-vipclient-47a3062b8682dd4b9494b585f87761124308d0af.tar.gz
vdr-vipclient-47a3062b8682dd4b9494b585f87761124308d0af.tar.bz2
Fixed the switchtimer
Now the led isn't always blinking.
-rw-r--r--index.html70
-rw-r--r--settings.js2
2 files changed, 48 insertions, 24 deletions
diff --git a/index.html b/index.html
index 4e51144..416c6d3 100644
--- a/index.html
+++ b/index.html
@@ -35,6 +35,7 @@ for (var i = minChan[9]; i < (maxChan[9]+1); i++) { EPG[0][4][i] = "";EPG[1][4]
window.onkeydown = onKeyDown;
function onLoad() {
+
createPlayer();
createRecorder();
embedTeletextPlugin();
@@ -911,8 +912,7 @@ function updateOSDtime(timchan) {
function settimer() {
if(SwitchTimer) {
try {
- switchtimerID = toi.schedulerService.schedule("activity_1","record_hd_from_ip", EPG[NowNext][2][currChan] ,0);
- toi.schedulerService.setParameter(switchtimerID, "Type", "SwitchOnly");
+ switchtimerID = toi.schedulerService.schedule("SwitchOnly","notification", EPG[NowNext][2][currChan] , 0);
toi.schedulerService.setParameter(switchtimerID, "Channel", currChan.toString() );
}
catch (e) {
@@ -944,9 +944,10 @@ function settimer() {
function setOSDtimer() {
-
- tijd = toi.schedulerService.getNextStartTime("*");
- if (tijd !== 0) {
+ // Only for type "SwitchOnly"
+ var x = toi.schedulerService.getBookingIds("SwitchOnly", 0, 0)
+ if (x.length !== 0) {
+ tijd = toi.schedulerService.getNextStartTime("SwitchOnly");
date = new Date(tijd*1000);
tijd = date.toUTCString();
tijd = new Date(tijd);
@@ -1555,10 +1556,9 @@ function onKeyMenu(keyCode) {
break;
case KEY_3:
if (menu == 0) {
- isSetupMenu = 0;
- mediaList.style.opacity = 0.9;
- mainmenu.style.opacity = 0;
+ isTimerMenu = 1;
LoadTimers();
+ menu = 2;
} else if (menu == 1) {
is = toi.informationService;
if(subsmode == 0 ) {
@@ -1605,7 +1605,6 @@ function onKeyMenu(keyCode) {
mainmenu.style.opacity = 0;
getRecList2();
LoadMediaSettings();
-// setTimeout("getRecList2();LoadMediaSettings();",100);
}
break;
case KEY_0:
@@ -1635,23 +1634,45 @@ if(menu == 1) {
mainmenu.innerHTML = "<h1><center style='font-size:" + fsMenuMain + ";color:white;'> Settings </center></h1><pre style='color:black;font-size:" + fsMenu + ";'><font style='color:red;font-size:" + fsMenu + ";'> Frontdisplay Clock : " + Boolean(showClock) + "</font><font style='color:green;font-size:" + fsMenu + ";'>\n Prio audio track : " + (toi.informationService.getObject("cfg.media.audio.languagepriority")) + "</font><font style='color:blue;font-size:" + fsMenu + ";'>\n Preview guide : " + Boolean(SwitchGuide) + "</font>\n 1 - Show Subs : " + Boolean(ShowSubs) + "\n 2 - Subs Type Prio : " + (toi.informationService.getObject("cfg.media.subtitling.typepriority")) + "\n 3 - Subs Mode Prio : " + (toi.informationService.getObject("cfg.media.subtitling.modepriority")) + "\n 4 - Audio Type Prio : " + (toi.informationService.getObject("cfg.media.audio.typepriority")) + "\n 5 - Protection : " + Boolean(ShowProtectedChannels) + "\n\n\n\n 0 - MainMenu </pre>";
}
+if(menu == 2) {
+// Timers menu
+ mainmenu.innerHTML = "<h1><center style='font-size:" + fsMenuMain + ";color:white;'> Timers </center></h1><pre style='color:black;font-size:" + fsMenu + ";'>\n Press OK to remove a timer \n" + booking + "\n\n\n\n 0 - MainMenu </pre>";
}
-// End of Menu section
-// Timer Menu Section
+}
function LoadTimers() {
+ booking = "";
+ var x = toi.schedulerService.getBookingIds("*", 0, 0);
+ for (var i=0;i<x.length;i++) {
+ var y = toi.schedulerService.getBooking(x[i]);
+ booking = booking + "ID " + x[i];
+ booking = booking + " Type " + y.category;
+ //booking = booking + toi.schedulerService.getParameter(x[i], "Channel");
+ tijd = y.start;
+ date = new Date(tijd*1000);
+ tijd = date.toUTCString();
+ tijd = new Date(tijd);
+ var tm = tijd.getMinutes();
+ var th = tijd.getHours();
+ if(tm<10) {
+ tm = "0"+tm;
+ }
+ if(th<10) {
+ th = "0"+th;
+ }
+ booking = booking + " Start " + th + ":" + tm;
+
+ if (y.category !== "SwitchOnly") {
+ booking = booking + " Duration " + y.duration;
+ }
-// Timers menu
- mainmenu.innerHTML = "<h1><center style='font-size:" + fsMenuMain + ";color:white;'> Timers </center></h1><pre style='color:black;font-size:" + fsMenu + ";'>\n Press OK to remove a timer" + "\n\n\n\n 0 - MainMenu </pre>";
-
-
-
- InitMenu(menu);
+ booking = booking + "\n" ;
+ }
}
-// End of Timers Menu
+// End of Menu section
// Media Player Section
@@ -2015,7 +2036,7 @@ function ShowMediaOSD() {
function onScheduledStart(event) {
// event is of type ToiSchedulerServiceBooking, see docs
- var timertype = toi.schedulerService.getParameter(event.booking.id, "Type");
+ var timertype = event.booking.category;
if ( timertype == "SwitchOnly") {
isVisible = 0;
@@ -2052,17 +2073,18 @@ function onScheduledStart(event) {
function onScheduledStop(event) {
- var timertype = toi.schedulerService.getParameter(event.booking.id, "Type");
-
- if ( timertype == !"SwitchOnly") {
+ var timertype = event.booking.category;
+ if ( timertype == "SwitchOnly") {
+ toi.schedulerService.remove(event.booking.id);
+ } else {
try {
mediaRecorder.close();
-
}
catch (e) {
alert(e);
}
- }
+ }
+
}
diff --git a/settings.js b/settings.js
index 5cc6d68..7af3388 100644
--- a/settings.js
+++ b/settings.js
@@ -213,4 +213,6 @@ var recLink = new Array();
var recDesc = new Array();
var recDura = new Array();
+var isTimerMenu = 0;
+var booking = ""; // used in TimerMenu
var nrMedia = 0;