From ea570e05e4f15d99fd185afc0b0079747e837c18 Mon Sep 17 00:00:00 2001 From: "M. Voerman" Date: Sun, 13 Jan 2013 12:43:19 +0100 Subject: Info menu added Standby now closes stream --- index.html | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++-------- settings.js | 19 +++++++++-------- 2 files changed, 72 insertions(+), 18 deletions(-) diff --git a/index.html b/index.html index 9fdc59c..3ad9d1c 100644 --- a/index.html +++ b/index.html @@ -48,7 +48,12 @@ function onLoad() { // eitCache.setFilterMode(eitCache.FILTER_MODE_PF_ONLY); eitCache.addEventListener(eitCache.ON_CACHE_UPDATED, onCacheUpdated); mediaPlayer.addEventListener(mediaPlayer.ON_DATA_AVAILABLE,onDataAvailableEvent); + if (mediaRecorder) { mediaRecorder.addEventListener(mediaRecorder.ON_STATE_CHANGED, onRecorderStateChanged); + } + + toi.informationService.addEventListener(toi.informationService.ON_OBJECTS_CHANGED, onEvent); + toi.informationService.subscribeObject(onEvent, "var.io.state", true); var ss = toi.schedulerService; ss.addEventListener(ss.ON_SCHEDULED_START, onScheduledStart); @@ -78,7 +83,22 @@ function onLoad() { mediaList.innerHTML = "

Please WAIT

"; } - +function onEvent(event) { +var numObjs = event.objectNames.length; + for (var i=0; i 100) { Volume = 100; } @@ -680,7 +702,7 @@ function onKeyDown(event) { showVolume(); break; case "VolumeDown": - Volume = Volume - 10; + Volume = Volume - VolumeStep; if (Volume < 0) { Volume = 0; } @@ -1645,7 +1667,11 @@ function onKeyMenu(keyCode) { menu = 3; playMPD(MPDAddress); InitMenu(menu); + } else if (menu == 1) { + menu = 4; // INFO menu + InitMenu(menu); } + break; case KEY_0: if (menu !== 0) { @@ -1661,14 +1687,14 @@ function onKeyMenu(keyCode) { osdmute.style.opacity = mute; break; case "VolumeUp": - Volume = Volume + 10; + Volume = Volume + VolumeStep; if (Volume > 100) { Volume = 100; } toi.audioOutputService.setVolume(AudioOut, Volume); break; case "VolumeDown": - Volume = Volume - 10; + Volume = Volume - VolumeStep; if (Volume < 0) { Volume = 0; } @@ -1700,7 +1726,7 @@ function playMPD(uri) { function InitMenu(menu) { if(menu == 0) { // Main Menu - mainmenu.innerHTML = "

MainMenu \n ( " + Version + " )

   1 - SettingsMenu \n   2 - Recordings \n   3 - TimersMenu\n   4 -\n   5 -\n   6 -\n   7 -\n   8 -\n   9 - MPD Server Connection\n\n   BLUE - Restart Portal 
"; + mainmenu.innerHTML = "

MainMenu \n ( " + Version + " )

   1 - SettingsMenu \n   2 - Recordings \n   3 - TimersMenu\n\n\n\n\n\n   9 - MPD Server Connection\n\n   BLUE - Restart Portal 
"; } if(menu == 1) { // settings menu @@ -1712,7 +1738,7 @@ if(menu == 1) { // settings menu if (ShowProtectedChannels) { htmltext = htmltext + "\uE017"; } else { htmltext = htmltext + "\uE016"; } htmltext = htmltext + " Protection\n 8 - "; if (SwitchGuide) { htmltext = htmltext + "\uE017"; } else { htmltext = htmltext + "\uE016"; } - htmltext = htmltext + " Preview guide\n\n\n 0 - MainMenu "; + htmltext = htmltext + " Preview guide\n 9 - Show INFO\n 0 - MainMenu "; mainmenu.innerHTML = htmltext; } @@ -1746,6 +1772,33 @@ if(menu == 3) { // MPD Menu mainmenu.innerHTML = "

MPD Connection

 MENU to exit \n 0 - back to MainMenu 
"; } +if(menu == 4) { // INFO Menu + var htmltext = "

INFO

";
+	try {
+		is = toi.informationService;
+	
+		htmltext = htmltext + "\n   Product name: " + is.getObject("config.productdisplayname");
+		htmltext = htmltext + "\n   Build date : " + is.getObject("config.build.date");
+//		htmltext = htmltext + "\n   IO State: " + is.getObject("var.io.state");
+
+		htmltext = htmltext + "\n\n   IP address:" + is.getObject("config.ipaddress");
+		var x = is.getObject("cfg.ip.eth0.mode");
+		if (x == "DHCP") { htmltext = htmltext + "\n \uE017 "; } else { htmltext = htmltext + "\n \uE016 "; }
+		htmltext = htmltext + "DHCP";
+		var x = is.getObject("var.capabilities.dvr");
+		if (x !== "FALSE") { htmltext = htmltext + "\n \uE017 "; } else { htmltext = htmltext + "\n \uE016 "; }
+		htmltext = htmltext + "DVR ";
+
+
+	} catch(e) {
+		alert("Error : " + e);
+	}
+	htmltext = htmltext + "\n\n\n\n\n   0 - back to MainMenu 
"; + mainmenu.innerHTML = htmltext; + +} + + } // end of initmenu function LoadTimers() { @@ -1943,7 +1996,7 @@ function onKeyMedia(keyCode) { osdmute.style.opacity = mute; break; case "VolumeUp": - Volume = Volume + 10; + Volume = Volume + VolumeStep; if (Volume > 100) { Volume = 100; } @@ -1951,7 +2004,7 @@ function onKeyMedia(keyCode) { showVolume(); break; case "VolumeDown": - Volume = Volume - 10; + Volume = Volume - VolumeStep; if (Volume < 0) { Volume = 0; } diff --git a/settings.js b/settings.js index 8ef6a6c..2c69afc 100644 --- a/settings.js +++ b/settings.js @@ -6,8 +6,8 @@ // 1280x720 // 1920x1080 -var Xfactor = 1280 / 720; -var Yfactor = 720 / 576; +var Xfactor = 1920 / 720; +var Yfactor = 1080 / 576; var showClock = 0; // 0 = no, 1 = yes @@ -26,15 +26,16 @@ NN[3] = "TIMER"; NN[4] = "-----"; var ShowProtectedChannels = 1; // Default don't show protected channels. -var StartVolume = 50; // Volume on (re)start of the portal. +var StartVolume = 30; // Volume on (re)start of the portal. +var VolumeStep = 5; // Steps the volume buttons make var currChan = 10; // default channel var ChanGroup = 0; // default TV group var minChan = new Array(); var maxChan = new Array(); var defChan = new Array(); var baseChn = new Array(); var protChn = new Array(); var ServerAdres = new Array(); // Define settings for Channels. // Server for Recordings -var recServ = "http://192.168.3.15:8000"; -var MPDAddress = "http://192.168.3.15:8888/mpd.mp3"; +var recServ = "http://192.168.1.15:8000"; +var MPDAddress = "http://192.168.1.15:8888/mpd.mp3"; // Radio channels.js Settings minChan[9] = 9001; @@ -42,7 +43,7 @@ maxChan[9] = 9099; // set not too far from max rd channel to speed up zapping defChan[9] = 9051; baseChn[9] = 9000; protChn[9] = 0; -ServerAdres[9] = "http://192.168.3.15:3000/"; +ServerAdres[9] = "http://192.168.1.15:3000/"; // Protected channels.js Settings minChan[6] = 6001; @@ -50,7 +51,7 @@ maxChan[6] = 6040; // set not too far from max prt channel to speed up zapping defChan[6] = 6001; baseChn[6] = 6000; protChn[6] = 1; -ServerAdres[6] = "http://192.168.3.15:3000/"; +ServerAdres[6] = "http://192.168.1.15:3000/"; // TV channels.js Settings minChan[0] = 1; @@ -58,7 +59,7 @@ maxChan[0] = 999; // set not too far from max TV channel to speed up zapping defChan[0] = currChan; baseChn[0] = 0; protChn[0] = 0; -ServerAdres[0] = "http://192.168.3.15:3000/"; +ServerAdres[0] = "http://192.168.1.15:3000/"; //HD list minChan[1] = 1001; @@ -66,7 +67,7 @@ maxChan[1] = 1999; // set not too far from max HD channel to speed up zapping defChan[1] = 1001; baseChn[1] = 1000; protChn[1] = 0; -ServerAdres[1] = "http://192.168.3.15:3000/"; +ServerAdres[1] = "http://192.168.1.15:3000/"; // MultiCast minChan[5] = 5001; -- cgit v1.2.3