r1619 - in oipf/emulator: . css js js/contollers js/filters js/lib js/servicesRecipes js/utils remoteControl templates view
Author: ygrego Date: 2015-06-09 08:58:58 +0000 (Tue, 09 Jun 2015) New Revision: 1619 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1619 Log: Addition of new directories. Added: oipf/emulator/css/ oipf/emulator/css/emulator.css oipf/emulator/css/main.css oipf/emulator/js/ oipf/emulator/js/contollers/ oipf/emulator/js/contollers/RemoteControlControllers.js oipf/emulator/js/emulator.js oipf/emulator/js/filters/ oipf/emulator/js/filters/VolumeFilter.js oipf/emulator/js/lib/ oipf/emulator/js/lib/Class.js oipf/emulator/js/lib/oipf_lib.js oipf/emulator/js/servicesRecipes/ oipf/emulator/js/servicesRecipes/oipfServices.js oipf/emulator/js/utils/ oipf/emulator/js/utils/Calculation.js oipf/emulator/js/utils/ChannelService.js oipf/emulator/js/utils/ChannelUtils.js oipf/emulator/js/utils/DRMSystem.js oipf/emulator/js/utils/DateUtils.js oipf/emulator/js/utils/Displayer.js oipf/emulator/js/utils/EventManager.js oipf/emulator/js/utils/MetaData.js oipf/emulator/js/utils/MetadataManager.js oipf/emulator/js/utils/OrderingUtils.js oipf/emulator/js/utils/ProgrammeHelper.js oipf/emulator/js/utils/ProgrammeService.js oipf/emulator/js/utils/Timeout.js oipf/emulator/js/utils/TimerManager.js oipf/emulator/js/utils/TimerRecordingManager.js oipf/emulator/js/utils/Utils.js oipf/emulator/js/utils/XmlParser.js oipf/emulator/js/utils/XmlToJson.js oipf/emulator/js/utils/es6-promises.js oipf/emulator/js/utils/myTest.js oipf/emulator/package.json oipf/emulator/remoteControl/ oipf/emulator/remoteControl/remoteControl.json oipf/emulator/static-server.js oipf/emulator/templates/ oipf/emulator/templates/currentChannel.html oipf/emulator/test/ oipf/emulator/view/ oipf/emulator/view/index.html Added: oipf/emulator/css/emulator.css =================================================================== Added: oipf/emulator/css/main.css =================================================================== --- oipf/emulator/css/main.css (rev 0) +++ oipf/emulator/css/main.css 2015-06-09 08:58:58 UTC (rev 1619) @@ -0,0 +1,97 @@ +/* +To change this license header, choose License Headers in Project Properties. +To change this template file, choose Tools | Templates +and open the template in the editor. +*/ +/* + Created on : 3 juin 2015, 11:33:14 + Author : root +*/ + +* { + box-sizing: border-box; +} + +.row:after { + content: ""; + clear: both; + display: block; +} + +[class*="col-"] { + float: left; + padding: 15px; +} + +.col-1 {width: 8.33%;} +.col-2 {width: 16.66%;} +.col-3 {width: 25%;} +.col-4 {width: 33.33%;} +.col-5 {width: 41.66%;} +.col-6 {width: 50%;} +.col-7 {width: 58.33%;} +.col-8 {width: 66.66%;} +.col-9 {width: 75%; height: 100%} +.col-10 {width: 83.33%;} +.col-11 {width: 91.66%;} +.col-12 {width: 100%;} + +html { + font-family: "Lucida Sans", sans-serif; +} + +.header { + background-color: #9933cc; + color: #ffffff; + padding: 15px; +} + +.menu ul { + list-style-type: none; + margin: 0; + padding: 0; +} + +.menu li { + padding: 8px; + margin-bottom: 7px; + background-color: #33b5e5; + color: #ffffff; + box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); +} + +.menu li:hover { + background-color: #0099cc; +} + +#emulator { + height: 600px; + background-color: activecaption; +} + +#toto, #titi { + background-color: #00b3ee; +} + +#volumeView { + width: 15%; + height: 5%; + position: absolute; + right: 2em; + bottom: 6em; +} + +#channelNumberSwitchView { + width: 10%; + height: 5%; + position: absolute; + top: 2em; + left: 2em; +} + +#imgChannel { + background: #777; + position: absolute; + right: 50%; + bottom: 50%; +} \ No newline at end of file Added: oipf/emulator/js/contollers/RemoteControlControllers.js =================================================================== --- oipf/emulator/js/contollers/RemoteControlControllers.js (rev 0) +++ oipf/emulator/js/contollers/RemoteControlControllers.js 2015-06-09 08:58:58 UTC (rev 1619) @@ -0,0 +1,79 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +var RemoteControlControllers = angular.module('RemoteControlControllers', []); + +RemoteControlControllers.controller('RemoteControlController', + ['$scope', '$http', '$timeout', function ($scope, $http, $timeout) { + $http.get('remoteControl/remoteControl.json').success(function(data) { + $scope.remoteControl = data; + }); + + $scope.clickMapping = { + "POWER": "setEmulatorON", + "0": "setChannelByNumber", + "1": "setChannelByNumber", + "2": "setChannelByNumber", + "3": "setChannelByNumber", + "4": "setChannelByNumber", + "5": "setChannelByNumber", + "6": "setChannelByNumber", + "7": "setChannelByNumber", + "8": "setChannelByNumber", + "9": "setChannelByNumber", + "V+": "setVolume", + "V-": "setVolume", + }; + + $scope.state = 'OFF'; + $scope.channel = ""; + $scope.channelNumber = ""; + $scope.channelNumberActive = false; + $scope.volumeViewActive = false; + $scope.emulatorON = false; + $scope.currentVolume = 50; + + $scope.setSate = function() { + }; + + $scope.setEmulatorON = function() { + $scope.emulatorON = !$scope.emulatorON; + }; + + $scope.setChannelByNumber = function(buttonId) { + $scope.channelNumberActive = true; + + if ($scope.channel.length == 0) { + $timeout(function() { + $scope.channel = $scope.channelNumber.toString(); + $scope.channelNumber = ""; + $scope.channelNumberActive = false; + }, 3000); + } + $scope.channelNumber += buttonId; + + }; + + $scope.setVolume = function(buttonId) { + $scope.volumeViewActive = true; + if (buttonId == "V+" && $scope.currentVolume < 100) { + $scope.currentVolume++; + } else if (buttonId == "V-" && $scope.currentVolume > 0) { + $scope.currentVolume--; + } + $timeout(function() { + $scope.volumeViewActive = false; + }, 3000); + }; + + $scope.remoteControlClick = function(buttonId) { + var methodName = $scope.clickMapping[buttonId]; + console.log("methodName:", methodName, $scope[methodName]); + methodName && $scope[methodName].call($scope, buttonId); + }; + + }]); + + Added: oipf/emulator/js/emulator.js =================================================================== --- oipf/emulator/js/emulator.js (rev 0) +++ oipf/emulator/js/emulator.js 2015-06-09 08:58:58 UTC (rev 1619) @@ -0,0 +1,9 @@ +/* + * + */ +var emulatorApplication = angular.module('emulatorApplication', + [ + 'RemoteControlControllers', + 'VolumeFilter' + ]); + Added: oipf/emulator/js/filters/VolumeFilter.js =================================================================== --- oipf/emulator/js/filters/VolumeFilter.js (rev 0) +++ oipf/emulator/js/filters/VolumeFilter.js 2015-06-09 08:58:58 UTC (rev 1619) @@ -0,0 +1,14 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +angular.module('VolumeFilter', []).filter('checkVolume', function() { + return function(input) { + if (input == 0) { + return ''; + } + return ''; + } +}); + Added: oipf/emulator/js/lib/Class.js =================================================================== --- oipf/emulator/js/lib/Class.js (rev 0) +++ oipf/emulator/js/lib/Class.js 2015-06-09 08:58:58 UTC (rev 1619) @@ -0,0 +1,15 @@ +var Class = new Function(); + +Function.prototype.extend = function(proto) { + var parent = this; + + var child = function() { + this.init && this.init.apply(this, arguments); + }; + + child.prototype = proto; + child.prototype.__proto__ = parent.prototype; + child.prototype.super = parent.prototype; + + return child; +}; Added: oipf/emulator/js/lib/oipf_lib.js =================================================================== Added: oipf/emulator/js/servicesRecipes/oipfServices.js =================================================================== --- oipf/emulator/js/servicesRecipes/oipfServices.js (rev 0) +++ oipf/emulator/js/servicesRecipes/oipfServices.js 2015-06-09 08:58:58 UTC (rev 1619) @@ -0,0 +1,11 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ + +var OipfServices = angular.module('OipfServices'); + +OipfServices.factory('ChannelService', function() { + return oipfObjectFactory.createChannelConfig(); +}); \ No newline at end of file Added: oipf/emulator/js/utils/Calculation.js =================================================================== --- oipf/emulator/js/utils/Calculation.js (rev 0) +++ oipf/emulator/js/utils/Calculation.js 2015-06-09 08:58:58 UTC (rev 1619) @@ -0,0 +1,11 @@ +var Calculation = Class.extend({ + + init: function() { + }, + + genId: function(boundary, adjustment){ + + return Math.floor((Math.random() * boundary) + adjustment); + } + +}); \ No newline at end of file Added: oipf/emulator/js/utils/ChannelService.js =================================================================== --- oipf/emulator/js/utils/ChannelService.js (rev 0) +++ oipf/emulator/js/utils/ChannelService.js 2015-06-09 08:58:58 UTC (rev 1619) @@ -0,0 +1,75 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ + +var ChannelService = Class.extend({ + + channelObject: { + + }, + + init: function(currentChannel, channelNumber, channelOrigin, channelList) { + this.channelNumber = channelNumber; + this.channelOrigin = channelOrigin; + this.channelListArray = channelList; + + this.getNumber = oipf.utils.generateFourDigit.bind(null); + + this.channelList = new ChannelList(); + this.createChannelList(); + this.favouriteLists = new FavouriteListCollection(); + this.currentFavouriteList = new FavouriteList(); + this.setCurrentChannel(currentChannel); + }, + + createChannelList: function() { + if (this.channelNumber > 0) { + + for (var i = 0, li = this.channelListArray.length; i < li; i++) { + var channel = this.channelListArray[i]; + var newOipfChannel = new Channel(channel); + this.channelList && this.channelList.push(newOipfChannel); + + } + } + }, + + setCurrentChannel: function(name) { + this.currentChannel = this.getChannelByName(this.channelList, name); + + if (!this.currentChannel && this.channelList) { + var channel = this.channelList[0]; + + if (channel) { + this.currentChannel = channel; + } + } + }, + + getChannelByName: function(channelCollection, channelName) { + for (var i = 0, li = channelCollection.length; i < li; i++) { + if (channelCollection[i].name == channelName) { + return channelCollection[i]; + } + } + }, + + prevChannel: function(channelCollection, channel) { + return channelUtils.findChannel(channelCollection, channel, -1); + }, + + nextChannel: function(channelCollection, channel) { + return channelUtils.findChannel(channelCollection, channel, 1); + }, + + getADvbTChannel: function(name) { + return new Channel(ID_DVB_T, + this.getNumber(), + this.getNumber(), + this.getNumber(), + name); + } + +}); Added: oipf/emulator/js/utils/ChannelUtils.js =================================================================== --- oipf/emulator/js/utils/ChannelUtils.js (rev 0) +++ oipf/emulator/js/utils/ChannelUtils.js 2015-06-09 08:58:58 UTC (rev 1619) @@ -0,0 +1,103 @@ +var channelUtils = {}; + +channelUtils.findChannel = function(channelCollection, channel, step) { + for (var i = 0, l = channelCollection.length; i < l; i++ ) { + + if (channelCollection[i] == channel) { + + if ((i == 0) && (step == -1)) { + var index = channelCollection.length + step; + + } else { + + if((i == (channelCollection.length-1)) && (step == 1)) { + index = 0; + + } else { + index = i + step; + + } + } + return channelCollection[index]; + } + } + return null; +}; + +channelUtils.isAValidDVBTChannel = function (channel) { + return (channel.onid) && (channel.tsid) && (channel.sid); +}; + +/* + * Description: + * This method verify that a tuner is available to receive a channel with this "idType". + * And return the first tuner found which match the "idType". + * Actually all video broadcast will use the same tuner because there is only one and + * this choice would be directed by parameter. + * + * ToDo :Normally the method should check if the tuner don't locked by another object but + * no way to do that in the norm. + * + * Argument: + * - idType : the type of tuner researched. + * + * Return: Tuner + */ +channelUtils.verifyASuitableTunerAvailable = function(idType, object) { + var config = oipfObjectFactory.createConfigurationObject(); + var availableTuners = config.localSystem.tuners; + + for (var i = 0; i < availableTuners.length; i++) { + var tunerIdTypes = availableTuners[i].idTypes; + for (var j = 0; j < tunerIdTypes.length; j++) { + var tuner = availableTuners[i]; + if (tunerIdTypes[j] == idType) { + return tuner; + } + } + } + + return null; +}; + +channelUtils.getChannelByDsd = function(channelCollection, dsd) { + for (var i = 0, l = channelCollection.length; i < l; i++) { + if (channelCollection[i].dsd == dsd) { + return channelCollection[i]; + } + } +}; + +/* + * Description: + * This method verify the validity of the terrestrial delivery system descriptor. + * The argument will be compare to the dsd array byte defined either in + * the transport stream or directly in the terminal. + * + * Arguments + * - dsd: the delivery system descriptor string necessary to create a channel by intermediate of method + * createChannelObject. + */ +channelUtils.isAValidTerrestrialDsd = function(dsd) { + var dsdAttributes = dsd.split(","); + + if (TERRESTIAL_DELIVERY_SYSTEM_DESCRIPTOR.length == dsdAttributes.length) { + + for (var i = 0, l = TERRESTIAL_DELIVERY_SYSTEM_DESCRIPTOR.length; i < l; i++) { + + if (!(TERRESTIAL_DELIVERY_SYSTEM_DESCRIPTOR[i] == dsdAttributes[i])) { + return false; + } + } + + return true; + } +}; + +channelUtils.getChannelByIpBroadcastID = function(channelCollection, ipBroadcastID) { + for (var i = 0, l = channelCollection.length; i < l; i++) { + if (channelCollection[i].ipBroadcastID == ipBroadcastID) { + return channelCollection[i]; + } + } +}; Added: oipf/emulator/js/utils/DRMSystem.js =================================================================== --- oipf/emulator/js/utils/DRMSystem.js (rev 0) +++ oipf/emulator/js/utils/DRMSystem.js 2015-06-09 08:58:58 UTC (rev 1619) @@ -0,0 +1,16 @@ +/* + * + * + * + */ + +var DRMSytem = Class.extend({ + + init: function(name, id, status, contentId, privateData) { + this.name = name; + this.id = id; + this.status = status; + this.contentId = contentId; + this.privateData = privateData; + } +}); Added: oipf/emulator/js/utils/DateUtils.js =================================================================== --- oipf/emulator/js/utils/DateUtils.js (rev 0) +++ oipf/emulator/js/utils/DateUtils.js 2015-06-09 08:58:58 UTC (rev 1619) @@ -0,0 +1,36 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ + +var DateUtils = Class.extend({ + + init: function() { + this.date = new Date(); + this._yesterday = new Date(this.date.getFullYear(), + this.date.getUTCMonth(), + this.date.getUTCDate()-1); + }, + + millisecondsToSeconds: function(timeInMilliseconds) { + return timeInMilliseconds / 1000; + }, + + nowInSeconds: function() { + return this.millisecondsToSeconds(Date.now()); + }, + + secondsToMilliseconds: function(timeInSeconds) { + return timeInSeconds * 1000; + }, + + secondsToMinutes: function(timeInSeconds) { + return timeInSeconds / 60; + }, + + yesterday: function() { + return this._yesterday; + } + +}); Added: oipf/emulator/js/utils/Displayer.js =================================================================== --- oipf/emulator/js/utils/Displayer.js (rev 0) +++ oipf/emulator/js/utils/Displayer.js 2015-06-09 08:58:58 UTC (rev 1619) @@ -0,0 +1,53 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +var Displayer = Class.extend({ + + init : function() { + }, + + appendChildFromTab : function(id, tab) { + + for(var keys=Object.keys(tab) in tab){ + var p = document.createElement("P"); + var t = document.createTextNode(keys+": "+tab[keys]); + p.appendChild(t); + document.getElementById(id).appendChild(p); + } + + }, + + currentProgramInfo : function() { + + for (var i = 0; i< search.result.length; i++) { + var obj = search.result[i]; + console.log(obj); + var keys = Object.keys(obj); + console.log(keys); + //for (var j = 0; j< keys.length; j++) { + for (keys in obj){ + if (obj[keys] instanceof Object) { + + continue; + } + ////Test kind of obj + var h2 = document.createElement("H2"); + var t = document.createTextNode(keys); + h2.appendChild(t); + document.getElementById("prog").appendChild(h2); + var hr = document.createElement("HR"); + var p = document.createElement("P"); + t = document.createTextNode(obj[keys]); + p.appendChild(t); + document.getElementById("prog").appendChild(p); + document.getElementById("prog").appendChild(hr); + //break; + } + break; + } + document.getElementById("prog").style.visibility = "visible"; + } + +}); Added: oipf/emulator/js/utils/EventManager.js =================================================================== --- oipf/emulator/js/utils/EventManager.js (rev 0) +++ oipf/emulator/js/utils/EventManager.js 2015-06-09 08:58:58 UTC (rev 1619) @@ -0,0 +1,44 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ + +var EventManager = Class.extend({ + + addEventListener: function(type, listener, target) { + var listenersList = target._listeners[type]; + + if (listenersList) { + listenersList.push(listener); + } else { + target._listeners[type] = [listener]; + } + }, + + fireEvent: function(event, target) { + var listeners = target._listeners[event.type]; + + listeners && listeners.forEach(function(listener){ + console.log(">>fireEvent") + oipf.utils.timeout(0) + .then(listener.apply.bind(listener, target, event.detail)); + }); + + var callback = target._callbacks[event.type]; + + callback && callback.apply(target, event.detail); + }, + + removeEventListener: function(type, listener, target){ + var listeners = target._listeners[type]; + + if (listeners) { + target._listeners[type] = listeners.filter(function(currentListener){ + return currentListener != listener; + }); + } + } +}); + + Added: oipf/emulator/js/utils/MetaData.js =================================================================== --- oipf/emulator/js/utils/MetaData.js (rev 0) +++ oipf/emulator/js/utils/MetaData.js 2015-06-09 08:58:58 UTC (rev 1619) @@ -0,0 +1,9 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ + +var MetaData = Class.extend({ + +}); Added: oipf/emulator/js/utils/MetadataManager.js =================================================================== --- oipf/emulator/js/utils/MetadataManager.js (rev 0) +++ oipf/emulator/js/utils/MetadataManager.js 2015-06-09 08:58:58 UTC (rev 1619) @@ -0,0 +1,27 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +var MetadataManager = Class.extend({ + + metadata: {}, + + addMetadata: function(metadata) { + var type = metadata.type; + + if (type) { + this.metadata[type] = metadata; + return true; + } + return false; + }, + + getMetadata: function(type) { + if (type && this.metadata) { + return this.metadata[type]; + } + return null; + } +}); + Added: oipf/emulator/js/utils/OrderingUtils.js =================================================================== --- oipf/emulator/js/utils/OrderingUtils.js (rev 0) +++ oipf/emulator/js/utils/OrderingUtils.js 2015-06-09 08:58:58 UTC (rev 1619) @@ -0,0 +1,15 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ + +var orderingUtils = {}; + +orderingUtils.ascendingBy = function(field) { + +}; + +orderingUtils.ascending = function() { + +}; Added: oipf/emulator/js/utils/ProgrammeHelper.js =================================================================== --- oipf/emulator/js/utils/ProgrammeHelper.js (rev 0) +++ oipf/emulator/js/utils/ProgrammeHelper.js 2015-06-09 08:58:58 UTC (rev 1619) @@ -0,0 +1,121 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +var ProgrammeHelper = Class.extend({ + + map: { + "title": "name", + "start": "startTime", + "desc": "description", + "length#text": "duration", + "episode-num#text": "episode" + }, + + channelNameMap: { + "ART1.kazer.org" : "ARTE", + "EUR2.kazer.org" : "D17", + "FRA2.kazer.org" : "FRANCE_2", + "FRA3.kazer.org" : "FRANCE_3", + "FRA4.kazer.org" : "FRANCE_4", + "FRA5.kazer.org" : "FRANCE_5", + "M61.kazer.org" : "M6", + "NRJ1.kazer.org" : "NRJ_12", + "NT11.kazer.org" : "NT1", + "RTL2.kazer.org" : "RTL9", + "TF11.kazer.org" : "TF1", + "TMC1.kazer.org" : "TMC", + "W91.kazer.org" : "W9" + }, + + programmes: null, + + init: function(channelService) { + this.channelService = channelService; + this.programmes = []; + }, + + /* + * Description: + * Don't take in charge the "credits" property of a xmlTv programmes for the moment. + */ + initProgrammes: function(programmeList) { + for (var i = 0, l = programmeList.length; i < l; i++) { + var programme = {}; + var object = programmeList[i]; + var channelName; + var self = this; + var createProgramme = function(object, programme, parentKey) { + var keys = Object.keys(object); + for (var j = 0, l1 = keys.length; j < l1; j++) { + var key = keys[j]; + var element = object[key]; + if (element instanceof Object) { + createProgramme(element, programme, key); + } else { + if (key == "start") { + element = self.transformInSecondSince01011970(element); + } + if (key == "channel") { + channelName = self.channelNameMap[element]; + } + if (key == "#text") { + key = parentKey+key; + if (key == "length#text") { + element = self.minutesToSeconds(element); + } + } + var mapping = self.map[key]; + if (mapping) { + programme[mapping] = element; + } + } + } + }; + + createProgramme(object, programme); + programme.channel = this.initChannel(channelName); + programme.programmeID = createUUID(); + var programmeObject = new Programme(programme); + this.programmes.push(programmeObject); + } + + return this.programmes; + }, + + initChannel: function(name) { + return this.channelService.getADvbTChannel(name); + }, + + transformToActualDate: function(wrongDateFormat) { + pattern = /(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\s\+(\d{2})/; + + var tmpDate = wrongDateFormat; + tmpDate = pattern.exec(tmpDate); + var dateTmp = new Date(); + + /*year = parseInt(tmpSSTime[1]); + month = parseInt(tmpSSTime[2]); + day = parseInt(tmpSSTime[3]);*/ + var year = dateTmp.getFullYear(); + var month = dateTmp.getUTCMonth(); + var day = dateTmp.getUTCDate(); + var hs = parseInt(tmpDate[4]); + var mins = parseInt(tmpDate[5]); + var secs = parseInt(tmpDate[6]); + + var actualDate = new Date(year, month, day, hs, mins, secs); + return actualDate; + }, + + transformInSecondSince01011970: function(wrongDateFormat) { + return this.transformToActualDate(wrongDateFormat).getTime() / 1000; + }, + + minutesToSeconds: function(minutes) { + return minutes*60; + } + +}); + Added: oipf/emulator/js/utils/ProgrammeService.js =================================================================== --- oipf/emulator/js/utils/ProgrammeService.js (rev 0) +++ oipf/emulator/js/utils/ProgrammeService.js 2015-06-09 08:58:58 UTC (rev 1619) @@ -0,0 +1,12 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ + +var ProgrammeService = Class.extend({ + + init: function(programmes) { + this.programmes = programmes; + } +}); Added: oipf/emulator/js/utils/Timeout.js =================================================================== --- oipf/emulator/js/utils/Timeout.js (rev 0) +++ oipf/emulator/js/utils/Timeout.js 2015-06-09 08:58:58 UTC (rev 1619) @@ -0,0 +1,37 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +var Timeout = Class.extend({ + timerId: null, + + promise: null, + + init: function(time) { + var self = this; + this.promise = new Promise(function(resolve, reject) { + self.timerId = setTimeout(function() { + resolve(); + }, time || 0); + }); + }, + + then: function(callback) { + this.promise.then(callback); + return this; + }, + + catch: function(callback) { + this.promise.catch(callback); + return this; + }, + + cancel: function() { + clearTimeout(this.timerId); + this.timerId = null; + this.promise = null; + } + +}); + Added: oipf/emulator/js/utils/TimerManager.js =================================================================== --- oipf/emulator/js/utils/TimerManager.js (rev 0) +++ oipf/emulator/js/utils/TimerManager.js 2015-06-09 08:58:58 UTC (rev 1619) @@ -0,0 +1,25 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +var TimerManager = Class.extend({ + + timer: null, + + createTimer: function(time) { + this.clearTimer(); + this.timer = new Timeout(time); + console.log("createTimer", this.timer.timerId); + return this.timer; + }, + + clearTimer: function() { + if (this.timer) { + this.timer.cancel(); + console.log("cancelTimer", this.timer.timerId); + } + } + +}); + Added: oipf/emulator/js/utils/TimerRecordingManager.js =================================================================== --- oipf/emulator/js/utils/TimerRecordingManager.js (rev 0) +++ oipf/emulator/js/utils/TimerRecordingManager.js 2015-06-09 08:58:58 UTC (rev 1619) @@ -0,0 +1,29 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ + +var TimerRecordingManager = Class.extend({ + + init: function() { + this.recordingTimers = {}; + }, + + createTimer: function(time) { + var timer = new Timeout(time); + console.log("createTimer", timer.timerId); + return timer; + }, + + clearTimer: function(recordingID) { + console.log("Method clearTimer called."); + var timers = this.recordingTimers[recordingID]; + timers.start && timers.start.cancel() && + console.log("cancelTimer", "Start timer: ", timers.start.timerId); + timers.end && timers.end.cancel() && + console.log("cancelTimer", "End timer: ", timers.end.timerId); + } + +}); + Added: oipf/emulator/js/utils/Utils.js =================================================================== --- oipf/emulator/js/utils/Utils.js (rev 0) +++ oipf/emulator/js/utils/Utils.js 2015-06-09 08:58:58 UTC (rev 1619) @@ -0,0 +1,121 @@ +/* + * Some code based on RFC 4122, section 4.4 + * (Algorithms for Creating a UUID from Truly Random or Pseudo-Random Number). + */ +var oipf = { + utils: {} +}; + + +oipf.utils.initProperties = function(defaultProperties) { + var keys = Object.keys(defaultProperties); + for (var i = 0, l = keys.length; i < l; i++) { + this[keys[i]] = defaultProperties[keys[i]]; + } +}; + +oipf.utils.timeout = function(time) { + return new Timeout(time); +}; + +oipf.utils.equals = function(field1, field2) { + return field1 == field2; +}; + +oipf.utils.notEquals = function(field1, field2) { + return field1 != field2; +}; + +oipf.utils.superior = function(field1, field2) { + return field1 > field2; +}; + +oipf.utils.superiorOrEquals = function(field1, field2) { + return field1 >= field2; +}; + +oipf.utils.inferior = function(field1, field2) { + return field1 < field2; +}; + +oipf.utils.inferiorOrEquals = function(field1, field2) { + return field1 <= field2; +}; + +oipf.utils.contains = function(field1, field2) { + return field1 == field2; +}; + +oipf.utils.generateFourDigit = function() { + + return Math.floor(Math.random() * 9000) + 1000; +}; + +oipf.utils.getRandomNumberBetweenMinMax = function(min, max) { + return Math.floor(Math.random() * (max - min)) + min; +}; + +oipf.utils.isPresent = function(list, element) { + + for (var i = 0, l = list.length; i < l; i++) { + if (oipf.utils.equals(list[i].name, element)) { + return true; + } + } +}; + +function createUUID() { + // http://www.ietf.org/rfc/rfc4122.txt + var s = []; + var hexDigits = "0123456789abcdef"; + for (var i = 0; i < 36; i++) { + s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1); + } + s[14] = "4"; // bits 12-15 of the time_hi_and_version field to 0010 + s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01 + s[8] = s[13] = s[18] = s[23] = "-"; + + var uuid = s.join(""); + return uuid; +} + +/* + * Description: + * Should be use in each test method in anticipation of tests executed on a tv platform. + */ +function isMethodImplemented(object, methodName) { + return object[methodName]; +} + +/* + * Description: + * Encapsulation of function "setTimeout" in order to it be accessible for all object and also reusable. + */ +function timeout(time) { + return new Promise(function(resolve, reject) { + setTimeout(resolve, time); + }); +} + +function upperCaseFirstChar(string) { + return string.charAt(0).toUpperCase() + string.slice(1); +} + +function logTest() { + console.log.apply(console, arguments); +} + +function createCustomEvent(type, param) { + return new CustomEvent(type, {detail :param}); +} + +function updateProperty(id, property, value){ + var getElById = document.getElementById.bind(document); + + if (property == "backgroundColor") { + getElById(id)["style"][property] = value; + } else { + getElById(id)[property] = value; + } + +} Added: oipf/emulator/js/utils/XmlParser.js =================================================================== --- oipf/emulator/js/utils/XmlParser.js (rev 0) +++ oipf/emulator/js/utils/XmlParser.js 2015-06-09 08:58:58 UTC (rev 1619) @@ -0,0 +1,73 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ + +var XmlParser = Class.extend({ + + init: function() { + + this.initParser(); + this.xmlDocument; + }, + + initParser: function() { + if (window.DOMParser) { + this.parser=new DOMParser(); + } + }, + + createAXmlStringDocument: function(defaultPropertiesObject) { + console.log("Method createAXmlStringDocument called"); + var defaultProperties = defaultPropertiesObject.rearrangeDefaultProperties(); + var objectsNames = Object.keys(defaultProperties); + var xmlStringDocument = "<" + defaultPropertiesObject.roots + ">"; + for (var i = 0, l = objectsNames.length; i < l; i++) { + + var currentObjectName = objectsNames[i]; + xmlStringDocument += "<" + currentObjectName; + var currentObjectData = defaultProperties[currentObjectName]; + var currentAttributes = currentObjectData.attributes; + + if (currentAttributes) { + xmlStringDocument = this.createAttributes(currentAttributes, + xmlStringDocument); + } + + var currentObjectValue = currentObjectData.value; + xmlStringDocument += ">" + currentObjectValue; + xmlStringDocument += "</" + currentObjectName + ">"; + } + xmlStringDocument += "</" + defaultPropertiesObject.roots + ">"; + console.log("Method createAXmlStringDocument completed"); + return xmlStringDocument; + }, + + createAttributes: function(currentAttributes, xmlStringDocument) { + var currentAttributesNames = Object.keys(currentAttributes); + for (var i = 0, l = currentAttributesNames.length; i < l; i++) { + var currentAttributeName = currentAttributesNames[i]; + var currentAttributeValue = currentAttributes[currentAttributeName]; + xmlStringDocument += " " + currentAttributeName + + "='" + currentAttributeValue + "'"; + } + return xmlStringDocument; + }, + + getXmlDocument: function(defaultProperties) { + if (!this.parser) { + this.initParser(); + } + var xmlStringDocument = + this.createAXmlStringDocument(defaultProperties); + + this.xmlDocument = + this.parser.parseFromString(xmlStringDocument, "text/xml"); + + return this.xmlDocument; + } + +}); + + Added: oipf/emulator/js/utils/XmlToJson.js =================================================================== --- oipf/emulator/js/utils/XmlToJson.js (rev 0) +++ oipf/emulator/js/utils/XmlToJson.js 2015-06-09 08:58:58 UTC (rev 1619) @@ -0,0 +1,169 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ + +var XmlToJson = Class.extend({ + unwantedNodeName: { + "#text": true, + "#comment": true + }, + + mappingValue: { + "true": true, + "false": false + }, + + wantedNode: "channel", + + init: function(xmlDocument) { + xmlDocument && (this.xmlDocument = xmlDocument) && + (this.json = {}) && this.initJson(); + }, + + initJson: function() { + if (!this.xmlDocument) { + return null; + } + + this.rootsNode = this.xmlDocument.firstChild; + + //We already know that document contains at least one child. + var rootsName = this.rootsNode.nodeName; + this.rootsElementJson = this.json[rootsName] = {}; + + var rootsObject = this.json[rootsName]; + + this.convertAttributesToProperties(rootsObject, this.rootsNode); + }, + + convertAttributesToProperties: function(object, node) { + var attributesList = node.attributes; + + for (var i = 0, li = attributesList.length; i < li; i++) { + var currentAttributes = attributesList[i]; + var name = currentAttributes.name; + var value = currentAttributes.value; + object[name] = value; + } + return object; + }, + + getJson: function() { + if (!this.json) { + console.log("Your xml document is not valid or null."); + return null; + } + var data = this.rootsNode.childNodes; + var dataStoredByKind = {}; + + for (var i = 0, li = data.length; i < li; i++) { + var currentNode = data[i]; + this.setPropertiesFromDomNodeList(currentNode, this.rootsElementJson); + } + return this.json; + }, + + setPropertiesFromDomNodeList: function(currentNode, parentContainer) { + + if (this.unwantedNodeName[currentNode.nodeName]) { + return; + } + + var childNodes = currentNode.childNodes; + var childNodeName; + var currentChildNode; + var nodeDataMap = {}; + if (currentNode.hasAttributes()) { + nodeDataMap = + this.convertAttributesToProperties(nodeDataMap, currentNode); + } + + for (var i = 0, li = childNodes.length; i < li; i++) { + currentChildNode = childNodes[i]; + childNodeName = currentChildNode.nodeName; + + if (!this.unwantedNodeName[childNodeName]) { + nodeDataMap = this.setPropertiesFromDomNodeList + (currentChildNode, nodeDataMap); + } + + if (/\w+/.exec(currentChildNode.nodeValue) && + (currentChildNode.childNodes.length == 0)) { + + if (!this.isMapNotEmpty(nodeDataMap)) { + var currentNodeName = currentNode.nodeName; + var key = currentNodeName; + var value = currentChildNode.nodeValue; + this.addPropertiesToMap(parentContainer, key, value, + currentNode.parentNode); + } + + //This add concern only the nodes which have an atomic content + if (this.isMapNotEmpty(nodeDataMap) && childNodes.length == 1) { + var key = "#text"; + var value = currentChildNode.nodeValue; + this.addPropertiesToMap(nodeDataMap, key, value, + currentNode.parentNode); + } + } + } + + //Addition of node in parent container even if this one have not a value + if (!this.unwantedNodeName[currentNode.nodeName] && + !currentChildNode) { + + var currentNodeName = currentNode.nodeName; + var key = currentNodeName; + this.addPropertiesToMap(parentContainer, key, null, + currentNode.parentNode); + } + + var currentNodeName = currentNode.nodeName; + if (this.isMapNotEmpty(nodeDataMap)) { + var key = currentNodeName; +// parentContainer[key] = nodeDataMap; + this.addPropertiesToMap(parentContainer, key, nodeDataMap, + currentNode.parentNode); + } + + return parentContainer; + }, + + isMapNotEmpty: function(map) { + return Object.keys(map).length > 0; + }, + + /* + * + */ + addPropertiesToMap: function(map, key, value, parentNode) { +// map[key] = value; + + var childNodesWithSpecificName = parentNode.getElementsByTagName(key); + var specificNodesNumber = childNodesWithSpecificName.length; + + if ((specificNodesNumber > 1) && !map[key]) { + map[key] = []; + } + + var nodeValue = map[key]; + + var value = this.setValue(value); + + if (nodeValue && (nodeValue instanceof Array)) { + map[key].push(value); + } else { + map[key] = value; + } + }, + + setValue: function(value) { + var newValue = this.mappingValue[value]; + if ((typeof value) == "string" && newValue != undefined) { + return newValue; + } + return value; + } +}); Added: oipf/emulator/js/utils/es6-promises.js =================================================================== --- oipf/emulator/js/utils/es6-promises.js (rev 0) +++ oipf/emulator/js/utils/es6-promises.js 2015-06-09 08:58:58 UTC (rev 1619) @@ -0,0 +1,18 @@ +/*! + * @overview es6-promise - a tiny implementation of Promises/A+. + * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) + * @license Licensed under MIT license + * See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE + * @version 2.0.0 + */ + +(function(){function r(a,b){n[l]=a;n[l+1]=b;l+=2;2===l&&A()}function s(a){return"function"===typeof a}function F(){return function(){process.nextTick(t)}}function G(){var a=0,b=new B(t),c=document.createTextNode("");b.observe(c,{characterData:!0});return function(){c.data=a=++a%2}}function H(){var a=new MessageChannel;a.port1.onmessage=t;return function(){a.port2.postMessage(0)}}function I(){return function(){setTimeout(t,1)}}function t(){for(var a=0;a<l;a+=2)(0,n[a])(n[a+1]),n[a]=void 0,n[a+1]=void 0; +l=0}function p(){}function J(a,b,c,d){try{a.call(b,c,d)}catch(e){return e}}function K(a,b,c){r(function(a){var e=!1,f=J(c,b,function(c){e||(e=!0,b!==c?q(a,c):m(a,c))},function(b){e||(e=!0,g(a,b))});!e&&f&&(e=!0,g(a,f))},a)}function L(a,b){1===b.a?m(a,b.b):2===a.a?g(a,b.b):u(b,void 0,function(b){q(a,b)},function(b){g(a,b)})}function q(a,b){if(a===b)g(a,new TypeError("You cannot resolve a promise with itself"));else if("function"===typeof b||"object"===typeof b&&null!==b)if(b.constructor===a.constructor)L(a, +b);else{var c;try{c=b.then}catch(d){v.error=d,c=v}c===v?g(a,v.error):void 0===c?m(a,b):s(c)?K(a,b,c):m(a,b)}else m(a,b)}function M(a){a.f&&a.f(a.b);x(a)}function m(a,b){void 0===a.a&&(a.b=b,a.a=1,0!==a.e.length&&r(x,a))}function g(a,b){void 0===a.a&&(a.a=2,a.b=b,r(M,a))}function u(a,b,c,d){var e=a.e,f=e.length;a.f=null;e[f]=b;e[f+1]=c;e[f+2]=d;0===f&&a.a&&r(x,a)}function x(a){var b=a.e,c=a.a;if(0!==b.length){for(var d,e,f=a.b,g=0;g<b.length;g+=3)d=b[g],e=b[g+c],d?C(c,d,e,f):e(f);a.e.length=0}}function D(){this.error= +null}function C(a,b,c,d){var e=s(c),f,k,h,l;if(e){try{f=c(d)}catch(n){y.error=n,f=y}f===y?(l=!0,k=f.error,f=null):h=!0;if(b===f){g(b,new TypeError("A promises callback cannot return that same promise."));return}}else f=d,h=!0;void 0===b.a&&(e&&h?q(b,f):l?g(b,k):1===a?m(b,f):2===a&&g(b,f))}function N(a,b){try{b(function(b){q(a,b)},function(b){g(a,b)})}catch(c){g(a,c)}}function k(a,b,c,d){this.n=a;this.c=new a(p,d);this.i=c;this.o(b)?(this.m=b,this.d=this.length=b.length,this.l(),0===this.length?m(this.c, +this.b):(this.length=this.length||0,this.k(),0===this.d&&m(this.c,this.b))):g(this.c,this.p())}function h(a){O++;this.b=this.a=void 0;this.e=[];if(p!==a){if(!s(a))throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");if(!(this instanceof h))throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");N(this,a)}}var E=Array.isArray?Array.isArray:function(a){return"[object Array]"=== +Object.prototype.toString.call(a)},l=0,w="undefined"!==typeof window?window:{},B=w.MutationObserver||w.WebKitMutationObserver,w="undefined"!==typeof Uint8ClampedArray&&"undefined"!==typeof importScripts&&"undefined"!==typeof MessageChannel,n=Array(1E3),A;A="undefined"!==typeof process&&"[object process]"==={}.toString.call(process)?F():B?G():w?H():I();var v=new D,y=new D;k.prototype.o=function(a){return E(a)};k.prototype.p=function(){return Error("Array Methods must be provided an Array")};k.prototype.l= +function(){this.b=Array(this.length)};k.prototype.k=function(){for(var a=this.length,b=this.c,c=this.m,d=0;void 0===b.a&&d<a;d++)this.j(c[d],d)};k.prototype.j=function(a,b){var c=this.n;"object"===typeof a&&null!==a?a.constructor===c&&void 0!==a.a?(a.f=null,this.g(a.a,b,a.b)):this.q(c.resolve(a),b):(this.d--,this.b[b]=this.h(a))};k.prototype.g=function(a,b,c){var d=this.c;void 0===d.a&&(this.d--,this.i&&2===a?g(d,c):this.b[b]=this.h(c));0===this.d&&m(d,this.b)};k.prototype.h=function(a){return a}; +k.prototype.q=function(a,b){var c=this;u(a,void 0,function(a){c.g(1,b,a)},function(a){c.g(2,b,a)})};var O=0;h.all=function(a,b){return(new k(this,a,!0,b)).c};h.race=function(a,b){function c(a){q(e,a)}function d(a){g(e,a)}var e=new this(p,b);if(!E(a))return (g(e,new TypeError("You must pass an array to race.")), e);for(var f=a.length,h=0;void 0===e.a&&h<f;h++)u(this.resolve(a[h]),void 0,c,d);return e};h.resolve=function(a,b){if(a&&"object"===typeof a&&a.constructor===this)return a;var c=new this(p,b); +q(c,a);return c};h.reject=function(a,b){var c=new this(p,b);g(c,a);return c};h.prototype={constructor:h,then:function(a,b){var c=this.a;if(1===c&&!a||2===c&&!b)return this;var d=new this.constructor(p),e=this.b;if(c){var f=arguments[c-1];r(function(){C(c,d,f,e)})}else u(this,d,a,b);return d},"catch":function(a){return this.then(null,a)}};var z={Promise:h,polyfill:function(){var a;a="undefined"!==typeof global?global:"undefined"!==typeof window&&window.document?window:self;"Promise"in a&&"resolve"in +a.Promise&&"reject"in a.Promise&&"all"in a.Promise&&"race"in a.Promise&&function(){var b;new a.Promise(function(a){b=a});return s(b)}()||(a.Promise=h)}};"function"===typeof define&&define.amd?define(function(){return z}):"undefined"!==typeof module&&module.exports?module.exports=z:"undefined"!==typeof this&&(this.ES6Promise=z)}).call(this); \ No newline at end of file Added: oipf/emulator/js/utils/myTest.js =================================================================== --- oipf/emulator/js/utils/myTest.js (rev 0) +++ oipf/emulator/js/utils/myTest.js 2015-06-09 08:58:58 UTC (rev 1619) @@ -0,0 +1,34 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ + +var myTest = (function () { + + var b = 1; + var m1 =function() { + return this.c1; + }; + this.c1 = 99; + + return function() { + this.logB = function() { + console.log(m1()); + }; + + /* + * c2 vaudrait c1 car this correspond à window, ce n'est pas l'effet + * attendu. + */ + this.c2 = c1; + +// this.b = function() { +// return b; +// }; + + this.b = b; + }; + +})(); + Added: oipf/emulator/package.json =================================================================== --- oipf/emulator/package.json (rev 0) +++ oipf/emulator/package.json 2015-06-09 08:58:58 UTC (rev 1619) @@ -0,0 +1,15 @@ +{ + "name": "Emulator", + "version": "1.0.0", + "description": "", + "main": "static-server.js", + "dependencies": { + "express": "^4.12.3", + "angular": "1.2.x", + "angular-route": "1.2.x", + "bootstrap": "latest" + }, + "devDependencies": {}, + "author": "", + "license": "LGPL" +} Added: oipf/emulator/remoteControl/remoteControl.json =================================================================== --- oipf/emulator/remoteControl/remoteControl.json (rev 0) +++ oipf/emulator/remoteControl/remoteControl.json 2015-06-09 08:58:58 UTC (rev 1619) @@ -0,0 +1,30 @@ +{ + "row0" : { + "buttons" : ["POWER"] + }, + + "row1": { + "buttons": [1, 2, 3] + }, + + "row2": { + "buttons": [4, 5, 6] + }, + + "row3": { + "buttons": [7, 8, 9] + }, + + "row4": { + "buttons": ["-", 0, "*"] + }, + + "row5": { + "buttons": ["V+", "INFO", "P+"] + }, + + "row6": { + "buttons": ["V-", "MUTE", "P-"] + } + +} Added: oipf/emulator/static-server.js =================================================================== --- oipf/emulator/static-server.js (rev 0) +++ oipf/emulator/static-server.js 2015-06-09 08:58:58 UTC (rev 1619) @@ -0,0 +1,12 @@ +var express = require('express'); +var app = express(); + +app.use(express.static('.')); + +app.get('/', function(req, res){ + res.sendFile('view/index.html', {root: "."}); +}); +app.listen(4000); + +console.log('Server running at http://192.168.99.190:4000/'); + Added: oipf/emulator/templates/currentChannel.html =================================================================== --- oipf/emulator/templates/currentChannel.html (rev 0) +++ oipf/emulator/templates/currentChannel.html 2015-06-09 08:58:58 UTC (rev 1619) @@ -0,0 +1 @@ +<h3>{{currentChannelNumber}}</h3> Added: oipf/emulator/view/index.html =================================================================== --- oipf/emulator/view/index.html (rev 0) +++ oipf/emulator/view/index.html 2015-06-09 08:58:58 UTC (rev 1619) @@ -0,0 +1,248 @@ +<!DOCTYPE html> +<!-- +To change this license header, choose License Headers in Project Properties. +To change this template file, choose Tools | Templates +and open the template in the editor. +--> +<html ng-app="emulatorApplication"> + <head> + <title>TV Emulator</title> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <link rel="stylesheet" type="text/css" href="../css/main.css"/> + <link rel="stylesheet" type="text/css" href="../node_modules/bootstrap/dist/css/bootstrap.min.css"> + + <script src="../js/impl/model/constants/VideoBroadcastConstants.js" type="text/javascript"></script> + <script src="../js/impl/model/constants/ParentalControlManagerConstants.js" type="text/javascript"></script> + <script src="../js/impl/model/constants/RecordingSchedulerConstants.js" type="text/javascript"></script> + <script src="../js/impl/model/constants/ConfigurationConstants.js" type="text/javascript"></script> + <script src="../js/impl/model/constants/MetadataSearchConstants.js" type="text/javascript"></script> + <script src="../js/impl/model/constants/DaeMimeType.js" type="text/javascript"></script> + <script src="../js/impl/model/constants/IdType.js" type="text/javascript"></script> + + <script src="../js/lib/Class.js" type="text/javascript"></script> + <script src="../js/utils/Timeout.js" type="text/javascript"></script> + <script src="../js/utils/Calculation.js" type="text/javascript"></script> + <script src="../js/utils/ChannelUtils.js" type="text/javascript"></script> + <script src="../js/utils/Utils.js" type="text/javascript"></script> + <script src="../js/utils/EventManager.js" type="text/javascript"></script> + <script src="../js/utils/TimerManager.js" type="text/javascript"></script> + <script src="../js/utils/TimerRecordingManager.js" type="text/javascript"></script> + <script src="../js/utils/MetadataManager.js" type="text/javascript"></script> + <script src="../js/utils/DateUtils.js" type="text/javascript"></script> + <script src="../js/utils/XmlParser.js" type="text/javascript"></script> + <script src="../js/utils/ProgrammeService.js" type="text/javascript"></script> + <script src="../js/utils/XmlToJson.js" type="text/javascript"></script> + <script src="../js/utils/ProgrammeHelper.js" type="text/javascript"></script> + + <script src="../configuration/ConfigDefaultProperties.js" type="text/javascript"></script> + <script src="../configuration/CapabilitiesProperties.js" type="text/javascript"></script> + <script src="../configuration/OipfConfiguration.js" type="text/javascript"></script> + + <script src="../js/impl/model/Collection.js" type="text/javascript"></script> + <script src="../js/impl/model/SignalInfo.js" type="text/javascript"></script> + <script src="../js/impl/model/LNBInfo.js" type="text/javascript"></script> + <script src="../js/impl/model/NetworkInterface.js" type="text/javascript"></script> + <script src="../js/impl/model/FavouriteList.js" type="text/javascript"></script> + <script src="../js/impl/model/Programme.js" type="text/javascript"></script> + <script src="../js/impl/model/AVOutput.js" type="text/javascript"></script> + <script src="../js/impl/model/Tuner.js" type="text/javascript"></script> + <script src="../js/impl/model/IntegerCollection.js" type="text/javascript"></script> + <script src="../js/impl/model/AVOutputCollection.js" type="text/javascript"></script> + <script src="../js/impl/model/TunerCollection.js" type="text/javascript"></script> + <script src="../js/impl/model/NetworkInterfaceCollection.js" type="text/javascript"></script> + <script src="../js/impl/model/FavouriteListCollection.js" type="text/javascript"></script> + <script src="../js/impl/model/ScheduledRecordingCollection.js" type="text/javascript"></script> + <script src="../js/impl/model/Query.js" type="text/javascript"></script> + <script src="../js/impl/model/Configuration.js" type="text/javascript"></script> + <script src="../js/impl/model/LocalSystem.js" type="text/javascript"></script> + <script src="../js/impl/model/Channel.js" type="text/javascript"></script> + <script src="../js/impl/model/ChannelList.js" type="text/javascript"></script> + <script src="../js/impl/model/MetadataSearch.js" type="text/javascript"></script> + <script src="../js/impl/model/SearchResults.js" type="text/javascript"></script> + <script src="../js/impl/model/ScheduledRecording.js" type="text/javascript"></script> + <script src="../js/impl/model/Recording.js" type="text/javascript"></script> + <script src="../js/impl/model/Application.js" type="text/javascript"></script> + + <script src="../js/impl/OipfObjectFactory.js" type="text/javascript"></script> + <script src="../js/impl/ConfigurationObject.js" type="text/javascript"></script> + <script src="../js/impl/ChannelConfig.js" type="text/javascript"></script> + <script src="../js/impl/VideoBroadcastObject.js" type="text/javascript"></script> + <script src="../js/impl/SearchManagerObject.js" type="text/javascript"></script> + <script src="../js/impl/RecordingSchedulerObject.js" type="text/javascript"></script> + <script src="../js/impl/CapabilitiesObject.js" type="text/javascript"></script> + <script src="../js/impl/ParentalControlManagerObject.js" type="text/javascript"></script> + <script src="../js/impl/ApplicationManagerObject.js" type="text/javascript"></script> + + <script src="../js/utils/ChannelService.js" type="text/javascript"></script> + <script src="../js/impl/model/ModelFactory.js" type="text/javascript"></script> + <script src="../init/init.js" type="text/javascript"></script> + + <script src="../node_modules/angular/angular.js"></script> + <script src="../js/filters/VolumeFilter.js"></script> + <script src="../js/contollers/RemoteControlControllers.js"></script> + <script src="../js/emulator.js"></script> + + </head> + <body> + + <div class="container-fluid" ng-controller="RemoteControlController"> + <div class="row"> + <div id="emulator" class="col-md-9"> + + <div id="volumeView" class="text-center" ng-show="volumeViewActive"> + <div> + <h3> + <span class="label label-default"> + {{currentVolume}} + <span class="glyphicon glyphicon-volume-up"></span> + </span> + </h3> + <div class="progress"> + <div class="progress-bar" role="progressbar" aria-valuenow="0" + aria-valuemin="0" aria-valuemax="100" style="width:{{currentVolume}}%"> + </div> + </div> + </div> + </div> + + <div id="imgChannel" class="text-center" ng-show="emulatorON"> + <h1>{{channel}}</h1> + </div> + + <div id="channelNumberSwitchView" class="text-center" ng-show="channelNumberActive"> + <span class="badge">{{channelNumber}}</span> + </div> + + </div> + + <div class="col-sm-2 col-sm-offset-1"> + + <div class="panel panel-default"> + <div class="panel-body"> + <div class="row"> + <div class="col-md-2 col-md-offset-2"> + <button type="button" class="btn btn-default btn-sm" ng-click="remoteControlClick('POWER')"> + <span class="glyphicon glyphicon-off"></span> + </button> + </div> + </div> + <div class="row"> + <div class="col-md-2"> + <button type="button" class="btn btn-default btn-sm" ng-click="remoteControlClick('1')"> + <span>1</span> + </button> + </div> + <div class="col-md-2"> + <button type="button" class="btn btn-default btn-sm" ng-click="remoteControlClick('2')"> + <span>2</span> + </button> + </div> + <div class="col-md-2"> + <button type="button" class="btn btn-default btn-sm" ng-click="remoteControlClick('3')"> + <span>3</span> + </button> + </div> + </div> + <div class="row"> + <div class="col-md-2"> + <button type="button" class="btn btn-default btn-sm" ng-click="remoteControlClick('4')"> + <span>4</span> + </button> + </div> + <div class="col-md-2"> + <button type="button" class="btn btn-default btn-sm" ng-click="remoteControlClick('5')"> + <span>5</span> + </button> + </div> + <div class="col-md-2"> + <button type="button" class="btn btn-default btn-sm" ng-click="remoteControlClick('6')"> + <span>6</span> + </button> + </div> + </div> + <div class="row"> + <div class="col-md-2"> + <button type="button" class="btn btn-default btn-sm" ng-click="remoteControlClick('7')"> + <span>7</span> + </button> + </div> + <div class="col-md-2"> + <button type="button" class="btn btn-default btn-sm" ng-click="remoteControlClick('8')"> + <span>8</span> + </button> + </div> + <div class="col-md-2"> + <button type="button" class="btn btn-default btn-sm" ng-click="remoteControlClick('9')"> + <span>9</span> + </button> + </div> + </div> + <div class="row"> + <div class="col-md-2 col-md-offset-2"> + <button type="button" class="btn btn-default btn-sm" ng-click="remoteControlClick('0')"> + <span>0</span> + </button> + </div> + </div> + <div class="row"> + <div class="col-md-2"> + <button type="button" class="btn btn-default btn-sm" ng-click="remoteControlClick('V+')"> + V<span class="glyphicon glyphicon-plus"></span> + </button> + </div> + <div class="col-md-2 col-md-offset-2"> + <button type="button" class="btn btn-default btn-sm" ng-click="remoteControlClick('P+')"> + P<span class="glyphicon glyphicon-chevron-up"></span> + </button> + </div> + </div> + <div class="row"> + <div class="col-md-2 col-md-offset-2"> + <button type="button" class="btn btn-default btn-sm" ng-click="remoteControlClick('MUTE')"> + <span class="glyphicon glyphicon-volume-off"></span> + </button> + </div> + </div> + <div class="row"> + <div class="col-md-2"> + <button type="button" class="btn btn-default btn-sm" ng-click="remoteControlClick('V-')"> + V<span class="glyphicon glyphicon-minus"></span> + </button> + </div> + <div class="col-md-2 col-md-offset-2"> + <button type="button" class="btn btn-default btn-sm" ng-click="remoteControlClick('P-')"> + P<span class="glyphicon glyphicon-chevron-down"></span> + </button> + </div> + </div> + </div> + </div> + + </div> + + <!-- <div id="titi" class="col-xs-2 col-xs-offset-1"> + <div ng-repeat="row in remoteControl" style="text-align: center"> + <button ng-repeat="button in row.buttons" ng-click="remoteControlClick(button)">{{button}}</button> + </div> + </div>--> + + </div> + </div> + +<!-- <div class="row" ng-controller="RemoteControlController"> + + <div id="emulator" class="col-9"> + <div>{{state}}</div> + </div> + + <div> + <div ng-repeat="row in remoteControl" style="text-align: center"> + <button ng-repeat="button in row.buttons" ng-click="remoteControlClick(button)">{{button}}</button> + </div> + </div> + + </div>--> + + </body> +</html> \ No newline at end of file
participants (1)
-
ygrego@users.nuiton.org