Author: jruchaud Date: 2015-06-09 15:07:19 +0000 (Tue, 09 Jun 2015) New Revision: 1655 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1655 Log: Use class Modified: oipf/lib/js/impl/model/AVOutput.js oipf/lib/js/impl/model/AVOutputCollection.js oipf/lib/js/impl/model/ApplicationCollection.js oipf/lib/js/impl/model/Bookmark.js oipf/lib/js/impl/model/BookmarkCollection.js oipf/lib/js/impl/model/Channel.js oipf/lib/js/impl/model/ChannelList.js oipf/lib/js/impl/model/Collection.js oipf/lib/js/impl/model/Configuration.js oipf/lib/js/impl/model/FavouriteList.js oipf/lib/js/impl/model/FavouriteListCollection.js oipf/lib/js/impl/model/IntegerCollection.js oipf/lib/js/impl/model/LNBInfo.js oipf/lib/js/impl/model/LocalSystem.js Modified: oipf/lib/js/impl/model/AVOutput.js =================================================================== --- oipf/lib/js/impl/model/AVOutput.js 2015-06-09 14:37:23 UTC (rev 1654) +++ oipf/lib/js/impl/model/AVOutput.js 2015-06-09 15:07:19 UTC (rev 1655) @@ -1,199 +1,195 @@ -/* +/* * The AVOutput class represents an audio or video output on the local platform. */ -var AVOutput = Class.extend({ - - /* - * Description: - * The name of the output. Each output SHALL have a name that is unique on the local system. At least one - * of the outputs SHALL have the name " all " and SHALL represent all available outputs on the platform. The - * results of reading properties from the " all " AVOutput are implementation specific.constructor - * - * Visibility Type : readonly String - */ - name: null, +class AVOutput { - /* - * Description: - * The type of the output. Valid values are “ audio ”, “ video ”, or “ both ”. - * - * Visibility Type : readonly String - */ - type: null, - - /* - * Description: - * Flag indicating whether the output is enabled. Setting this property SHALL enable or disable the output. - * - * Type : Boolean - */ - enabled: null, - - /* - * Description: - * Flag indicating whether the subtitles are enabled. The language of - * the displayed subtitles is determined by a combination of the value of - * the Configuration.preferredSubtitleLanguage property (see section 7.3.2) - * and the subtitles available in the stream. - * For audio outputs, setting this property will have no effect. - * - * Type : Boolean - */ - subtitleEnabled: null, - - videoMode: null, - - /* - * Description: - * Read or set the output mode for digital audio outputs for which hardware - * support MAY be available on the device. Valid values are shown below. - * ------------------------------------------------------------------------ - * Value | Behaviour - * ------------- ---------------------------------------------------------- - * ac3 | Output AC-3 audio. - * ------------- ---------------------------------------------------------- - * uncompressed | Output uncompressed PCM audio. - * ------------- ---------------------------------------------------------- - * For video-only outputs, setting this property SHALL have no effect. - * - * Type: String - * - */ - digitalAudioMode: null, - - /* - * Description: - * Read or set the range for digital audio outputs for which hardware - * support MAY be available on the device. - * Valid values are shown below - * ------------------------------------------------------------------------ - * Value | Behaviour - * --------- -------------------------------------------------------------- - * normal | Output AC-3 audio. - * --------- -------------------------------------------------------------- - * narrow | Output uncompressed PCM audio. - * --------- -------------------------------------------------------------- - * wide | Output uncompressed PCM audio. - * ------------------------------------------------------------------------ - * For video-only outputs, setting this property SHALL have no effect. - * - * Type: String - * - */ - audioRange: null, - - /* - * Description: - * Read or set the video format for HD and 3D video outputs for which - * hardware support MAY be available on the device. Valid values are: - * 480i - * 480p - * 576i - * 576p - * 720i - * 720p - * 1080i - * 1080p - * 720p_TaB - * 720p_SbS - * 1080i_SbS - * 1080p_TaB - * 1080p_SbS - * For audio-only or standard-definition outputs, setting this property - * SHALL have no effect. - * - * Type: String - * - */ - hdVideoFormat: null, - - /* - * Description: - * Indicates the output display aspect ratio of the display device connected - * to this output for which hardware support MAY be available on the device. - * Valid values are: - * 4:3 - * 16:9 - * For audio-only outputs, setting this property SHALL have no effect. - * - * Type: String - * - */ - tvAspectRatio: null, - - /* - * Description: - * Read the video format conversion modes that may be used when - * displaying a 4:3 input video on a 16:9 output display or 16:9 input video - * on a 4:3 output display. The assumption is that the hardware supports - * conversion from either format and there is no distinction between the - * two. See the definition of the 'videoMode' property for valid values. - * For audio outputs, this property will have the value null . - * - * Visibility Type: readonly StringCollection - */ - supportedVideoModes: null, - - /* - * Description: - * Read the supported output modes for digital audio outputs. - * See the definition of the 'digitalAudioMode' property for valid values. - * For video outputs, this property will have the value null. - * - * Visibility Type: readonly StringCollection - */ - supportedDigitalAudioModes: null, - - /* - * Description: - * Read the supported ranges for digital audio outputs. - * See the definition of the 'audioRange' property for valid values. - * For video outputs, this property will have the value null. - * - * Visibility Type: readonly StringCollection - */ - supportedAudioRanges: null, - - /* - * Description: - * Read the supported HD and 3D video formats. - * See the definition of the 'hdVideoFormat' property for valid values. - * For audio outputs, this property will have the value null. - * - * Visibility Type: readonly StringCollection - */ - supportedHdVideoFormats: null, - - /* - * Description: - * Read the supported TV aspect ratios. See the definition of the - * 'tvAspectRatio' property for valid values. - * For audio outputs, this property will have the value null . - * - * Visibility Type: readonly StringCollection - */ - supportedAspectRatios: null, - - /* - * Description: - * Read whether the display is currently in a 2D or 3D mode. - * Return values are: - * ------------------------------------------------------------------------ - * Value | Behaviour - * ------------- ---------------------------------------------------------- - * 0 | The display is in a 2D video mode - * ------------- ---------------------------------------------------------- - * 1 | The display is in a 3D video mode - * ------------- ---------------------------------------------------------- - * - * Type: Integer - */ - current3DMode: null, - - init: function(name, type, enabled) { + constructor(name, type, enabled) { + /* + * Description: + * The name of the output. Each output SHALL have a name that is unique on the local system. At least one + * of the outputs SHALL have the name " all " and SHALL represent all available outputs on the platform. The + * results of reading properties from the " all " AVOutput are implementation specific.constructor + * + * Visibility Type : readonly String + */ this.name = name; + + /* + * Description: + * The type of the output. Valid values are “ audio ”, “ video ”, or “ both ”. + * + * Visibility Type : readonly String + */ this.type = type; + + /* + * Description: + * Flag indicating whether the output is enabled. Setting this property SHALL enable or disable the output. + * + * Type : Boolean + */ this.enabled = enabled; + + /* + * Description: + * Flag indicating whether the subtitles are enabled. The language of + * the displayed subtitles is determined by a combination of the value of + * the Configuration.preferredSubtitleLanguage property (see section 7.3.2) + * and the subtitles available in the stream. + * For audio outputs, setting this property will have no effect. + * + * Type : Boolean + */ + this.subtitleEnabled = null; + + this.videoMode = null; + + /* + * Description: + * Read or set the output mode for digital audio outputs for which hardware + * support MAY be available on the device. Valid values are shown below. + * ------------------------------------------------------------------------ + * Value | Behaviour + * ------------- ---------------------------------------------------------- + * ac3 | Output AC-3 audio. + * ------------- ---------------------------------------------------------- + * uncompressed | Output uncompressed PCM audio. + * ------------- ---------------------------------------------------------- + * For video-only outputs, setting this property SHALL have no effect. + * + * Type: String + * + */ + this.digitalAudioMode = null; + + /* + * Description: + * Read or set the range for digital audio outputs for which hardware + * support MAY be available on the device. + * Valid values are shown below + * ------------------------------------------------------------------------ + * Value | Behaviour + * --------- -------------------------------------------------------------- + * normal | Output AC-3 audio. + * --------- -------------------------------------------------------------- + * narrow | Output uncompressed PCM audio. + * --------- -------------------------------------------------------------- + * wide | Output uncompressed PCM audio. + * ------------------------------------------------------------------------ + * For video-only outputs, setting this property SHALL have no effect. + * + * Type: String + * + */ + this.audioRange = null; + + /* + * Description: + * Read or set the video format for HD and 3D video outputs for which + * hardware support MAY be available on the device. Valid values are: + * 480i + * 480p + * 576i + * 576p + * 720i + * 720p + * 1080i + * 1080p + * 720p_TaB + * 720p_SbS + * 1080i_SbS + * 1080p_TaB + * 1080p_SbS + * For audio-only or standard-definition outputs, setting this property + * SHALL have no effect. + * + * Type: String + * + */ + this.hdVideoFormat = null; + + /* + * Description: + * Indicates the output display aspect ratio of the display device connected + * to this output for which hardware support MAY be available on the device. + * Valid values are: + * 4:3 + * 16:9 + * For audio-only outputs, setting this property SHALL have no effect. + * + * Type: String + * + */ + this.tvAspectRatio = null; + + /* + * Description: + * Read the video format conversion modes that may be used when + * displaying a 4:3 input video on a 16:9 output display or 16:9 input video + * on a 4:3 output display. The assumption is that the hardware supports + * conversion from either format and there is no distinction between the + * two. See the definition of the 'videoMode' property for valid values. + * For audio outputs, this property will have the value null . + * + * Visibility Type: readonly StringCollection + */ + this.supportedVideoModes = null; + + /* + * Description: + * Read the supported output modes for digital audio outputs. + * See the definition of the 'digitalAudioMode' property for valid values. + * For video outputs, this property will have the value null. + * + * Visibility Type: readonly StringCollection + */ + this.supportedDigitalAudioModes = null; + + /* + * Description: + * Read the supported ranges for digital audio outputs. + * See the definition of the 'audioRange' property for valid values. + * For video outputs, this property will have the value null. + * + * Visibility Type: readonly StringCollection + */ + this.supportedAudioRanges = null; + + /* + * Description: + * Read the supported HD and 3D video formats. + * See the definition of the 'hdVideoFormat' property for valid values. + * For audio outputs, this property will have the value null. + * + * Visibility Type: readonly StringCollection + */ + this.supportedHdVideoFormats = null; + + /* + * Description: + * Read the supported TV aspect ratios. See the definition of the + * 'tvAspectRatio' property for valid values. + * For audio outputs, this property will have the value null . + * + * Visibility Type: readonly StringCollection + */ + this.supportedAspectRatios = null; + + /* + * Description: + * Read whether the display is currently in a 2D or 3D mode. + * Return values are: + * ------------------------------------------------------------------------ + * Value | Behaviour + * ------------- ---------------------------------------------------------- + * 0 | The display is in a 2D video mode + * ------------- ---------------------------------------------------------- + * 1 | The display is in a 3D video mode + * ------------- ---------------------------------------------------------- + * + * Type: Integer + */ + this.current3DMode = null; } -}); +} Modified: oipf/lib/js/impl/model/AVOutputCollection.js =================================================================== --- oipf/lib/js/impl/model/AVOutputCollection.js 2015-06-09 14:37:23 UTC (rev 1654) +++ oipf/lib/js/impl/model/AVOutputCollection.js 2015-06-09 15:07:19 UTC (rev 1655) @@ -1,14 +1,14 @@ -/* +/* * typedef Collection<AVOutput> AVOutputCollection - * + * * The AVOutputCollection class represents a collection of AVOutput objects. See Annex K for the definition of the * collection template. - * + * */ -var AVOutputCollection = Collection.extend({ - - init: function() { - this.super.init.apply(this, arguments); +class AVOutputCollection extends Collection { + + constructor(...args) { + super(...args); } -}); +} Modified: oipf/lib/js/impl/model/ApplicationCollection.js =================================================================== --- oipf/lib/js/impl/model/ApplicationCollection.js 2015-06-09 14:37:23 UTC (rev 1654) +++ oipf/lib/js/impl/model/ApplicationCollection.js 2015-06-09 15:07:19 UTC (rev 1655) @@ -7,6 +7,6 @@ class ApplicationCollection extends Collection { constructor(...args) { - super(args); + super(...args); } } Modified: oipf/lib/js/impl/model/Bookmark.js =================================================================== --- oipf/lib/js/impl/model/Bookmark.js 2015-06-09 14:37:23 UTC (rev 1654) +++ oipf/lib/js/impl/model/Bookmark.js 2015-06-09 15:07:19 UTC (rev 1655) @@ -1,30 +1,17 @@ -/* - * 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. - */ +class Bookmark { -var Bookmark = Class.extend({ - - /* - * Description: - * The time at which the bookmark is set, in seconds from - * the start of the content item. - */ - time: null, - - /* - * Description: - * The name of the bookmark. - * - */ - name: null, - - init: function(time, name) { + constructor(time, name) { + /* + * Description: + * The time at which the bookmark is set, in seconds from + * the start of the content item. + */ this.time = time; + + /* + * Description: + * The name of the bookmark. + */ this.name = name; } - -}); - - +} Modified: oipf/lib/js/impl/model/BookmarkCollection.js =================================================================== --- oipf/lib/js/impl/model/BookmarkCollection.js 2015-06-09 14:37:23 UTC (rev 1654) +++ oipf/lib/js/impl/model/BookmarkCollection.js 2015-06-09 15:07:19 UTC (rev 1655) @@ -1,48 +1,41 @@ -/* - * 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. - */ +class BookmarkCollection extends Collection{ -var BookmarkCollection = Collection.extend({ - - init: function() { - this.super.init.apply(this, arguments); - }, - + constructor(...args) { + super(...args); + } + /* * Description: - * Add a new bookmark to the collection. If the bookmark cannot be added - * (e.g. because the value given for time lies outside + * Add a new bookmark to the collection. If the bookmark cannot be added + * (e.g. because the value given for time lies outside * the length of the recording), this method SHALL return null. - * + * * Argument: - * - time: The time at which the bookmark is set, in seconds since + * - time: The time at which the bookmark is set, in seconds since * the start of the recording. - * + * * - name: The name of the bookmark. */ - addBookmark: function(time, name) { + addBookmark(time, name) { var newBookmark = new Bookmark(time, name); this.push(newBookmark); - - }, - + } + /* * Description: * Remove a bookmark from the collection. - * + * * Argument: * - bookmark: The bookmark to be removed. */ - removeBookmark: function(bookmark) { + removeBookmark(bookmark) { var indexOfBookmark = this.indexOf(bookmark); var lastBookmark = this[this.length-1]; - + if (indexOfBookmark) { this[indexOfBookmark] = lastBookmark; this.pop(); } } - -}); + +} Modified: oipf/lib/js/impl/model/Channel.js =================================================================== --- oipf/lib/js/impl/model/Channel.js 2015-06-09 14:37:23 UTC (rev 1654) +++ oipf/lib/js/impl/model/Channel.js 2015-06-09 15:07:19 UTC (rev 1655) @@ -12,167 +12,168 @@ * properties of a locally defined channel before the Channel object is referenced by another object or passed to an API * call as an input parameter. The effects of writing to these properties at any other time is implementation dependent. * The LocalSystem object allows hardware settings related to the local device to be read and modified. - * + * * Note: The standbyState property has been removed from this class. */ -var Channel = Class.extend({ - /* - * Description: - * The type of channel. The value MAY be indicated by one of the TYPE_* constants defined above. If the - * type of the channel is unknown then the value SHALL be “ undefined ”. - * NOTE: Values of this type between 256 and 511 are reserved for use by related specifications on request by - * liaison. - * - * Visibility Type: readonly Integer - */ - channelType: null, - /* - * Description: - * The type of identification for the channel, as indicated by one of the ID_* constants defined above. - * - * Visibility Type: readonly Integer - */ - idType: null, - /* - * Description: - * Unique identifier of a channel within the scope of the OITF. The ccid is defined by the OITF and SHALL have - * prefix ‘ ccid ’ : e.g. ‘ccid:{tunerID.}majorChannel{.minorChannel}’. - * - * Note: the format of this string is platform-dependent. - * - * Visibility Type: readonly String - */ - ccid: null, - /* - * Description: - * The name of the channel. Can be used for linking analog channels without CNI. Typically, it will contain the - * call sign of the station (e.g. 'HBO'). - * - * Type: String - */ - name: null, - /* - * Description: - * Optional unique identifier of the tuner within the scope of the OITF that is able to receive the given channel. - * - * Visibility Type: readonly String - */ - tunerID: null, - - /* - * Description: - * DVB or ISDB original network ID. - * - * Visibility Type: readonly Integer - */ - onid: null, +class Channel { - /* - * Description: - * DVB or ISDB transport stream ID. - * - * Visibility Type: readonly Integer - */ - tsid: null, + constructor() { + /* + * Description: + * The type of channel. The value MAY be indicated by one of the TYPE_* constants defined above. If the + * type of the channel is unknown then the value SHALL be “ undefined ”. + * NOTE: Values of this type between 256 and 511 are reserved for use by related specifications on request by + * liaison. + * + * Visibility Type: readonly Integer + */ + this.channelType = null; + /* + * Description: + * The type of identification for the channel, as indicated by one of the ID_* constants defined above. + * + * Visibility Type: readonly Integer + */ + this.idType = null; + /* + * Description: + * Unique identifier of a channel within the scope of the OITF. The ccid is defined by the OITF and SHALL have + * prefix ‘ ccid ’ : e.g. ‘ccid:{tunerID.}majorChannel{.minorChannel}’. + * + * Note: the format of this string is platform-dependent. + * + * Visibility Type: readonly String + */ + this.ccid = null; + /* + * Description: + * The name of the channel. Can be used for linking analog channels without CNI. Typically, it will contain the + * call sign of the station (e.g. 'HBO'). + * + * Type: String + */ + this.name = null; + /* + * Description: + * Optional unique identifier of the tuner within the scope of the OITF that is able to receive the given channel. + * + * Visibility Type: readonly String + */ + this.tunerID = null; - /* - * Description: - * DVB or ISDB service ID. - * - * Visibility Type: readonly Integer - */ - sid: null, - - /* - * Description: - * For channels of type ID_DVB_SI_DIRECT created through createChannelObject() , this property defines - * the delivery system descriptor (tuning parameters) as defined by DVB-SI [EN 300 468] section 6.2.13. - * - * The dsd property provides a string whose characters shall be restricted to the ISO Latin-1 character set. - * Each character in the dsd represents a byte of a delivery system descriptor as defined by DVB-SI [EN 300 - * 468] section 6.2.13, such that a byte at position "i" in the delivery system descriptor is equal the Latin-1 - * character code of the character at position "i" in the dsd. - * - * Described in the syntax of JavaScript: let sdd[] be the byte array of a system delivery descriptor, in which - * sdd[0] is the descriptor_tag, then, dsd is its equivalent string, if : - * dsd.length==sdd.length and - * for each integer i : 0<=i<dsd.length holds: sdd[i] == dsd.charCodeAt(i). - */ - dsd: null, - - /* - * Description: - * ATSC source_ID value. - * - * Visibility Type: readonly Integer - */ - sourceId: null, - - /* - * Description: - * If the channel has an idType of ID_IPTV_SDS, this property denotes the DVB textual service identifier of the - * IP broadcast service, specified in the format “ServiceName.DomainName” with the ServiceName and - * DomainName as defined in [DVB-IPTV]. - * If the Channel has an idType of ID_IPTV_URI, this element denotes a URI of the IP broadcast service. - * - * Visibility Type: readonly String - */ - ipBroadcastID: null, - - locked: null, + /* + * Description: + * DVB or ISDB original network ID. + * + * Visibility Type: readonly Integer + */ + this.onid = null; - init: function () { - var dispatcher = { + /* + * Description: + * DVB or ISDB transport stream ID. + * + * Visibility Type: readonly Integer + */ + this.tsid = null; + + /* + * Description: + * DVB or ISDB service ID. + * + * Visibility Type: readonly Integer + */ + this.sid = null; + + /* + * Description: + * For channels of type ID_DVB_SI_DIRECT created through createChannelObject() , this property defines + * the delivery system descriptor (tuning parameters) as defined by DVB-SI [EN 300 468] section 6.2.13. + * + * The dsd property provides a string whose characters shall be restricted to the ISO Latin-1 character set. + * Each character in the dsd represents a byte of a delivery system descriptor as defined by DVB-SI [EN 300 + * 468] section 6.2.13, such that a byte at position "i" in the delivery system descriptor is equal the Latin-1 + * character code of the character at position "i" in the dsd. + * + * Described in the syntax of JavaScript: let sdd[] be the byte array of a system delivery descriptor, in which + * sdd[0] is the descriptor_tag, then, dsd is its equivalent string, if : + * dsd.length==sdd.length and + * for each integer i : 0<=i<dsd.length holds: sdd[i] == dsd.charCodeAt(i). + */ + this.dsd = null; + + /* + * Description: + * ATSC source_ID value. + * + * Visibility Type: readonly Integer + */ + this.sourceId = null; + + /* + * Description: + * If the channel has an idType of ID_IPTV_SDS, this property denotes the DVB textual service identifier of the + * IP broadcast service, specified in the format “ServiceName.DomainName” with the ServiceName and + * DomainName as defined in [DVB-IPTV]. + * If the Channel has an idType of ID_IPTV_URI, this element denotes a URI of the IP broadcast service. + * + * Visibility Type: readonly String + */ + this.ipBroadcastID = null; + + this.locked = null; + + var dispatcher = { 1: "_createChannelFromConf", - 3: "_createChannelATSC_T", - 4: "_createChannelDVB_SI_DIRECT", - 5: "_createChannelDVBOrISDB", + 3: "_createChannelATSC_T", + 4: "_createChannelDVB_SI_DIRECT", + 5: "_createChannelDVBOrISDB", 6: "_createChannelIPTV" }; - - (arguments.length != 6) && this._setCcid(createUUID()); + + (arguments.length !== 6) && this._setCcid(createUUID()); this[dispatcher[arguments.length]].apply(this, arguments); - }, - - _createChannelATSC_T: function(idType, sourceID, name) { + } + + _createChannelATSC_T(idType, sourceID, name) { this.idType = idType; this.sourceID = sourceID; this.name = name; - }, - - _createChannelIPTV: function(idType, onid, tsid, sid, ipBroadcastID, name) { + } + + _createChannelIPTV(idType, onid, tsid, sid, ipBroadcastID, name) { this.idType = idType; this.ipBroadcastID = ipBroadcastID; this.name = name; - if (idType == 41) { + if (idType === 41) { this.onid = onid; this.tsid = tsid; this.sid = sid; } - }, - - _createChannelDVBOrISDB: function(idType, onid, tsid, sid, name){ + } + + _createChannelDVBOrISDB(idType, onid, tsid, sid, name) { this.idType = idType; this.onid = onid; this.tsid = tsid; this.sid = sid; this.name = name; - }, - - _createChannelDVB_SI_DIRECT: function(idType, dsd, sid, name){ + } + + _createChannelDVB_SI_DIRECT(idType, dsd, sid, name) { this.idType = idType; this.dsd = dsd; this.sid = sid; this.name = name; - }, - - _setCcid: function(ccid) { + } + + _setCcid(ccid) { this.ccid = ccid.toString(); - }, - - _createChannelFromConf: function(channelConf) { + } + + _createChannelFromConf(channelConf) { oipf.utils.initProperties.call(this, channelConf); } - -}); \ No newline at end of file + +} Modified: oipf/lib/js/impl/model/ChannelList.js =================================================================== --- oipf/lib/js/impl/model/ChannelList.js 2015-06-09 14:37:23 UTC (rev 1654) +++ oipf/lib/js/impl/model/ChannelList.js 2015-06-09 15:07:19 UTC (rev 1655) @@ -1,16 +1,15 @@ /* -* Description: +* Description: * A ChannelList represents a collection of Channel objects. See Annex K for the definition of the collection template. * In addition to the methods and properties defined for generic collections, the ChannelList class supports the additional * properties and methods defined below. -* */ -var ChannelList = Collection.extend({ +class ChannelList extends Collection{ - init: function() { - this.super.init.apply(this, arguments); - }, - + constructor(...args) { + super(...args); + } + /* * Description: * Return the first channel in the list with the specified channel identifier. Returns null if no @@ -23,9 +22,9 @@ * * Return: Channel */ - getChannel: function(channelID) { + getChannel(channelID) { for (var i = 0; i < this.length; i++) { - var channel = (this)[i]; + var channel = this[i]; console.log("channelId:38" == "channelId:38" , channel.channelId, channelID, "----------------OUT", channel); console.log(channel.channelId, channelID, "-----------------"); if (channel.channelId == channelID) { @@ -34,8 +33,8 @@ } } return null; - }, - + } + /* * Description: * Return the first (IPTV or non-IPTV) channel in the list that matches the specified DVB or @@ -59,7 +58,7 @@ * * Return: Channel */ - getChannelByTriplet: function(onid, tsid, sid, nid) { + getChannelByTriplet(onid, tsid, sid, nid) { var self = this; if (nid) { @@ -80,12 +79,12 @@ for (var i = 0, l = this.length; i < l; i++) { test(i); } - + return null; - }, - + } + /* - * Description: + * Description: * Return the first (IPTV or non-IPTV) channel in the list with the specified ATSC source ID. * Where no channels of type ID_ATSC_* are available, or no channel with the specified @@ -96,8 +95,8 @@ * * Return: Channel */ - getChannelBySourceID: function(sourceID) { - + getChannelBySourceID(sourceID) { + for (var i = 0, l = this.length; i < l; i++) { if (this[i].sourceID == sourceID) { return this[i]; @@ -105,4 +104,4 @@ } } -}); \ No newline at end of file +} Modified: oipf/lib/js/impl/model/Collection.js =================================================================== --- oipf/lib/js/impl/model/Collection.js 2015-06-09 14:37:23 UTC (rev 1654) +++ oipf/lib/js/impl/model/Collection.js 2015-06-09 15:07:19 UTC (rev 1655) @@ -1,20 +1,10 @@ -/* - * 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. - */ +class Collection extends Array{ -var Collection = Array.extend({ - - init: function() { - this.push.apply(this, arguments); - }, - - item: function(index) { - return this[index]; + constructor(...args) { + super(...args); } -}); - - - + item(index) { + return this[index]; + } +} Modified: oipf/lib/js/impl/model/Configuration.js =================================================================== --- oipf/lib/js/impl/model/Configuration.js 2015-06-09 14:37:23 UTC (rev 1654) +++ oipf/lib/js/impl/model/Configuration.js 2015-06-09 15:07:19 UTC (rev 1655) @@ -1,154 +1,155 @@ -var Configuration = Class.extend({ - - /* - * Description: - * A comma-separated set of languages to be used for audio playback, in order of preference. Each language SHALL be indicated by its ISO 639-2 language code as * defined in [ISO 639-2]. - * - * Type: String - */ - preferredAudioLanguage: null, +class Configuration { - /* - * Description: - * A comma-separated set of languages to be used for subtitle playback, in order of preference. The subtitle - * component (see section 7.16.5.5) that matches the highest ordered language SHALL be activated - * (equivelant to the selectComponent method) and all other subtitle components SHALL be deactivated - * (equivelant to the unselectComponent method). - * Each language SHALL be indicated by its ISO 639-2 language code as defined in [ISO 639-2] or as a - * wildcard specifier " *** ". - * If the wildcard is included it SHALL be the last item in the set. If no subtitle component in the content - * matches a language in this property and the wildcard is included then the first (lowest) subtitle component - * SHALL be selected. - * - * Type: String - */ - preferredSubtitleLanguage: null, + constructor(defaultProperties) { + /* + * Description: + * A comma-separated set of languages to be used for audio playback, in order of preference. Each language SHALL be + * indicated by its ISO 639-2 language code as defined in [ISO 639-2]. + * + * Type: String + */ + this.preferredAudioLanguage = null; - /* - * Description: - * A comma-separated set of languages to be used for the user interface of a service, in order of preference. - * Each language SHALL be indicated by its ISO 639-2 language code as defined in [ISO 639-2]. - * If present, the HTTP Accept-language header shall contain the same languages as the - * preferredUILanguage property with the same order of preference. NOTE: The order of preference in the - * Accept-language header is indicated using the quality factor. - * - * Type: String - */ - preferredUILanguage: null, + /* + * Description: + * A comma-separated set of languages to be used for subtitle playback, in order of preference. The subtitle + * component (see section 7.16.5.5) that matches the highest ordered language SHALL be activated + * (equivelant to the selectComponent method) and all other subtitle components SHALL be deactivated + * (equivelant to the unselectComponent method). + * Each language SHALL be indicated by its ISO 639-2 language code as defined in [ISO 639-2] or as a + * wildcard specifier " *** ". + * If the wildcard is included it SHALL be the last item in the set. If no subtitle component in the content + * matches a language in this property and the wildcard is included then the first (lowest) subtitle component + * SHALL be selected. + * + * Type: String + */ + this.preferredSubtitleLanguage = null; - /* - * Description: - * An ISO-3166 three character country code identifying the country in which the receiver is deployed. - * - * Type: String - */ - countryId: null, - - /* - * Description: - * An integer indicating the time zone within a country in which the receiver is deployed. A value of 0 SHALL - * represent the eastern-most time zone in the country, a value of 1 SHALL represent the next time zone to - * the west, and so on. Valid values are in the range 0 – 60. - * - * Type: Integer - */ - regionId: null, - - /* - * Description: - * The policy dictates what mechanism the system should use when storage space is exceeded. - * Valid values are shown in the table below. - * ------------------------------------------------------------------------------------------------ - * Value | Description - * ------ ----------------------------------------------------------------------------------------- - * 0 | Indicates a recording management policy where no recordings are to be deleted. - * ------ ----------------------------------------------------------------------------------------- - * 1 | Indicates a recording management policy where only watched recordings MAY be deleted. - * ------ ----------------------------------------------------------------------------------------- - * 2 | Indicates a recording management policy where only recordings older than the specified - * | threshold (given by the pvrSaveDays and pvrSaveEpisodes properties) MAY be deleted. - * ------------------------------------------------------------------------------------------------ - * - * Type: Integer - */ - pvrPolicy: null, + /* + * Description: + * A comma-separated set of languages to be used for the user interface of a service, in order of preference. + * Each language SHALL be indicated by its ISO 639-2 language code as defined in [ISO 639-2]. + * If present, the HTTP Accept-language header shall contain the same languages as the + * preferredUILanguage property with the same order of preference. NOTE: The order of preference in the + * Accept-language header is indicated using the quality factor. + * + * Type: String + */ + this.preferredUILanguage = null; + /* + * Description: + * An ISO-3166 three character country code identifying the country in which the receiver is deployed. + * + * Type: String + */ + this.countryId = null; - /* - * Description: - * When the pvrPolicy property is set to the value 2, this property indicates the minimum number of - * episodes that SHALL be saved for series-link recordings. - * - * Type: Integer - */ - pvrSaveEpisodes: null, + /* + * Description: + * An integer indicating the time zone within a country in which the receiver is deployed. A value of 0 SHALL + * represent the eastern-most time zone in the country, a value of 1 SHALL represent the next time zone to + * the west, and so on. Valid values are in the range 0 – 60. + * + * Type: Integer + */ + this.regionId = null; - - /* - * Description: - * When the pvrPolicy property is set to the value 2, this property indicates the minimum save time (in - * days) for individual recordings. Only recordings older than the save time MAY be deleted. - * - * Type: Integer - */ - pvrSaveDays: null, + /* + * Description: + * The policy dictates what mechanism the system should use when storage space is exceeded. + * Valid values are shown in the table below. + * ------------------------------------------------------------------------------------------------ + * Value | Description + * ------ ----------------------------------------------------------------------------------------- + * 0 | Indicates a recording management policy where no recordings are to be deleted. + * ------ ----------------------------------------------------------------------------------------- + * 1 | Indicates a recording management policy where only watched recordings MAY be deleted. + * ------ ----------------------------------------------------------------------------------------- + * 2 | Indicates a recording management policy where only recordings older than the specified + * | threshold (given by the pvrSaveDays and pvrSaveEpisodes properties) MAY be deleted. + * ------------------------------------------------------------------------------------------------ + * + * Type: Integer + */ + this.pvrPolicy = null; - - /* - * Description: - * The default padding (measured in seconds) to be added at the start of a recording. - * - * Type: Integer - */ - pvrStartPadding: null, - /* - * Description: - * The default padding (measured in seconds) to be added at the end of a recording. - * - * Type: Integer - */ - pvrEndPadding: null, - - - /* - * Description: - * The time shift mode indicates the preferred mode of operation for support of timeshift playback in the - * video/broadcast object. Valid values are defined in the timeShiftMode property in section 7.13.2.2. The - * default value is 0, timeshift is turned off. - * - * Type: Integer - */ - preferredTimeShiftMode: null, - - init: function(defaultProperties) { + /* + * Description: + * When the pvrPolicy property is set to the value 2, this property indicates the minimum number of + * episodes that SHALL be saved for series-link recordings. + * + * Type: Integer + */ + this.pvrSaveEpisodes = null; + + + /* + * Description: + * When the pvrPolicy property is set to the value 2, this property indicates the minimum save time (in + * days) for individual recordings. Only recordings older than the save time MAY be deleted. + * + * Type: Integer + */ + this.pvrSaveDays = null; + + + /* + * Description: + * The default padding (measured in seconds) to be added at the start of a recording. + * + * Type: Integer + */ + this.pvrStartPadding = null; + + /* + * Description: + * The default padding (measured in seconds) to be added at the end of a recording. + * + * Type: Integer + */ + this.pvrEndPadding = null; + + + /* + * Description: + * The time shift mode indicates the preferred mode of operation for support of timeshift playback in the + * video/broadcast object. Valid values are defined in the timeShiftMode property in section 7.13.2.2. The + * default value is 0, timeshift is turned off. + * + * Type: Integer + */ + this.preferredTimeShiftMode = null; + oipf.utils.initProperties.call(this, defaultProperties); this._keys = {}; - }, - + } + /* - * Description: + * Description: * Get the system text string that has been set for the specified key. * - * Argument: + * Argument: * -key: A key identifying the system text string to be retrieved. * - * Return: String + * Return: String */ - getText: function(key) { + getText(key) { return this._keys[key]; - }, - + } + /* - * Description: + * Description: * Set the system text string that has been set for the specified key. System text strings are * used for automatically-generated messages in certain cases, e.g. parental control messages. * - * Arguments: + * Arguments: * -key: The key for the text string to be set. Valid keys are: * ----------------------------------------------------------------------------------------------------------------------------------------------------- * Key | Description - * ------------------ ---------------------------------------------------------------------------------------------------------------------------------- + * ------------------ ---------------------------------------------------------------------------------------------------------------------------------- * no_title | Text string used as the title for programmes and channels where no guide information is available. Defaults to “No information” * ------------------ ---------------------------------------------------------------------------------------------------------------------------------- * no_synopsis | Text string used as the synopsis for programmes where no guide information is available. Defaults to “No further information @@ -158,10 +159,10 @@ * ----------------------------------------------------------------------------------------------------------------------------------------------------- * * -value: The new value for the system text string. - * + * */ - setText: function(key, value) { + setText(key, value) { this._keys[key] = value; } -}); \ No newline at end of file +} Modified: oipf/lib/js/impl/model/FavouriteList.js =================================================================== --- oipf/lib/js/impl/model/FavouriteList.js 2015-06-09 14:37:23 UTC (rev 1654) +++ oipf/lib/js/impl/model/FavouriteList.js 2015-06-09 15:07:19 UTC (rev 1655) @@ -1,15 +1,13 @@ -/* +/* * The FavouriteList class represents a list of favourite channels. See Annex K for the definition of the collection * template. In addition to the methods and properties defined for generic collections, the FavouriteList class supports * the additional properties and methods defined below. * In order to preserve backwards compatibility with already existing DAE content the JavaScript toString() method * SHALL return the FavouriteList.id for FavouriteList objects. */ -var FavouriteList = Array.extend({ - - init: function() { - this.push.apply(this, arguments); - } -}); +class FavouriteList extends Array { - + constructor(...args) { + super(...args); + } +} Modified: oipf/lib/js/impl/model/FavouriteListCollection.js =================================================================== --- oipf/lib/js/impl/model/FavouriteListCollection.js 2015-06-09 14:37:23 UTC (rev 1654) +++ oipf/lib/js/impl/model/FavouriteListCollection.js 2015-06-09 15:07:19 UTC (rev 1655) @@ -3,24 +3,24 @@ * definition of the collection template. In addition to the methods and properties defined for generic collections, the * FavouriteListCollection class supports the additional methods defined below. */ -var FavouriteListCollection = Collection.extend({ - - init: function() { - this.super.init.apply(this, arguments); - }, - +class FavouriteListCollection extends Collection { + + constructor(...args) { + super(...args); + } + /* - * Description: + * Description: * Return the first favourite list in the collection with the given favListID. - * + * * Arguments: * - favID: The ID of a favourite list. - * - * Return: FavouriteList + * + * Return: FavouriteList */ - getFavouriteList: function(favID) { - + getFavouriteList(favID) { + } - -}); + +} Modified: oipf/lib/js/impl/model/IntegerCollection.js =================================================================== --- oipf/lib/js/impl/model/IntegerCollection.js 2015-06-09 14:37:23 UTC (rev 1654) +++ oipf/lib/js/impl/model/IntegerCollection.js 2015-06-09 15:07:19 UTC (rev 1655) @@ -1,12 +1,9 @@ /* Description: * The IntegerCollection class represents a collection of Integer values. See Annex K for the definition of the * collection template. - * */ - -var IntegerCollection = Collection.extend({ - init: function() { - this.super.init.apply(this, arguments); +class IntegerCollection extends Collection { + constructor(...args) { + super(...args); } -}); - +} Modified: oipf/lib/js/impl/model/LNBInfo.js =================================================================== --- oipf/lib/js/impl/model/LNBInfo.js 2015-06-09 14:37:23 UTC (rev 1654) +++ oipf/lib/js/impl/model/LNBInfo.js 2015-06-09 15:07:19 UTC (rev 1655) @@ -1,98 +1,95 @@ -/* - * The LNBInfo object provides details on the LNB attached to a tuner. +/* + * The LNBInfo object provides details on the LNB attached to a tuner. * Setting any of the properties in this class results in an immediate update of - * the LNB configuration that is active for the associated Tuner. + * the LNB configuration that is active for the associated Tuner. * The LNB configuration is stored persistently. - * */ +class LNBInfo { -var LNBInfo = Class.extend({ - - /* - * A universal LNB that has two local oscillator frequency - * settings available. The selection between the frequencies is - * done by the presence of a 22 kHz control signal. - */ - DUAL_LO_FREQ_LNB: 30, - - - /* - * Only a single local oscillator frequency is available in the LNB. - */ - SINGLE_LO_FREQ_LNB: 31, - - /* - * Description: - * The type of LNB connected to the frontend. - * Valid values are listed in section 7.3.11.1. - * - * Type: Integer - */ - lnbType: null, + constructor(defaultProperties) { + /* + * A universal LNB that has two local oscillator frequency + * settings available. The selection between the frequencies is + * done by the presence of a 22 kHz control signal. + */ + this.DUAL_LO_FREQ_LNB = 30; - /* - * Description: - * The low or only, if a single local oscillator frequency LNB is used, - * LNB local oscillator frequency in MHz. - * - * Type: Number - */ - lnbLowFreq: null, + /* + * Only a single local oscillator frequency is available in the LNB. + */ + this.SINGLE_LO_FREQ_LNB = 31; - /* - * Description: - * If a dual local oscillator frequency LNB is used this is - * the high LNB local oscillator frequency in MHz. If a single - * local oscillator frequency LNB is used this argument shall be set to 0. - * - * Type: Number - */ - lnbHighFreq: null, + /* + * Description: + * The type of LNB connected to the frontend. + * Valid values are listed in section 7.3.11.1. + * + * Type: Integer + */ + this.lnbType = null; - /* - * Description: - * Indicates the frequency (in MHz) when to switch between the high- - * and low-band oscillator frequencies (lnbLowFreq and - * lnbHighFreq respectively). - * - * Type: Number - */ - crossoverFrequency: null, + /* + * Description: + * The low or only, if a single local oscillator frequency LNB is used, + * LNB local oscillator frequency in MHz. + * + * Type: Number + */ + this.lnbLowFreq = null; - /* - * Description: - * Indicates the lowest frequency, in MHz, that the LNB can be used for. - * - * Type: Number - */ - lnbStartFrequency: null, + /* + * Description: + * If a dual local oscillator frequency LNB is used this is + * the high LNB local oscillator frequency in MHz. If a single + * local oscillator frequency LNB is used this argument shall be set to 0. + * + * Type: Number + */ + this.lnbHighFreq = null; - /* - * Description: - * Indicates the highest frequency, in MHz, that the LNB can be used for. - * - * Type: Number - */ - lnbStopFrequency: null, + /* + * Description: + * Indicates the frequency (in MHz) when to switch between the high- + * and low-band oscillator frequencies (lnbLowFreq and + * lnbHighFreq respectively). + * + * Type: Number + */ + this.crossoverFrequency = null; - /* - * Description: - * Indicates the orbital position of the satellite in degrees, negative - * value for west, positive value for east. - * For example, Astra 19.2 East would have orbitalPosition 19.2. - * Thor 0.8 West would have orbitalPosition -0.8. - * This property, if provided, will be used to select a Tuner instance - * (when scanning and tuning). Setting any value which is not a valid - * orbital position (an absolute value greater than 180) indicates - * that the orbital position need not be considered when using - * the associated tuner. - * - * Type: Number - */ - orbitalPosition: null, - - init: function(defaultProperties) { + /* + * Description: + * Indicates the lowest frequency, in MHz, that the LNB can be used for. + * + * Type: Number + */ + this.lnbStartFrequency = null; + + /* + * Description: + * Indicates the highest frequency, in MHz, that the LNB can be used for. + * + * Type: Number + */ + this.lnbStopFrequency = null; + + /* + * Description: + * Indicates the orbital position of the satellite in degrees, negative + * value for west, positive value for east. + * For example, Astra 19.2 East would have orbitalPosition 19.2. + * Thor 0.8 West would have orbitalPosition -0.8. + * This property, if provided, will be used to select a Tuner instance + * (when scanning and tuning). Setting any value which is not a valid + * orbital position (an absolute value greater than 180) indicates + * that the orbital position need not be considered when using + * the associated tuner. + * + * Type: Number + */ + this.orbitalPosition = null; + oipf.utils.initProperties.call(this, defaultProperties); } - -}); + +} Modified: oipf/lib/js/impl/model/LocalSystem.js =================================================================== --- oipf/lib/js/impl/model/LocalSystem.js 2015-06-09 14:37:23 UTC (rev 1654) +++ oipf/lib/js/impl/model/LocalSystem.js 2015-06-09 15:07:19 UTC (rev 1655) @@ -1,380 +1,380 @@ /* * Description: * The LocalSystem object allows hardware settings related to the local device to be read and modified. -* +* * Note: The standbyState property has been removed from this class. */ -var LocalSystem = Class.extend({ - - /* - * The OITF is in the off state and no power is consumed. - * This is the case of a power outage or if the OITF has the - * ability to be completely turned off. Scheduled recording is - * not expected to work. - */ - OFF: 0, - - /* - * The OITF is in normal working mode with user - * interaction. The DAE applications may render any - * presentation graphically. - */ - ON: 1, - - /* - * The OITF is in the lowest possible power consumption - * state (meeting regulations and certifications). The OITF - * may support wake-up from a passive standby in order, for - * example, to perform a scheduled recording. - */ - PASSIVE_STANDBY: 2, - - /* - * The OITF is in an intermediate power consumption state. - * The output to the display shall be inactive. In this state - * DAE applications may continue to operate. - */ - ACTIVE_STANDBY: 3, - - /* - * The OITF is in the lowest possible power consumption - * state (meeting regulations and certifications). If th - * platform supports hibernate mode then the OITF stores - * all applications in volatile memory to allow for quick - * startup. - */ - PASSIVE_STANDBY_HIBERNATE: 4, - - /* - * The OITF shall restart and return to a ON state. - */ - RESTART: 5, - - /* - * Restart the OITF and reset all settings and data to an - * initial/factory state. The exact settings and data to be - * reset are implementation dependant. The use of the this - * operation with the setPowerState method is subject to - * security control defined in section 10.1.3.8 - */ - FACTORY_RESET: 6, - - /* - * No startup URL is known. - */ - STARTUP_URL_NONE: 0, - - /* - * The startup URL is derived from DHCP procedures. - */ - STARTUP_URL_DHCP: 1, - - /* - * The startup URL is derived through TR-069 procedures. - */ - STARTUP_URL_TR069: 2, - - /* - * The startup URL is that which is configured through the OITF firmware. - */ - STARTUP_URL_PRECONFIGURED: 3, - - /* - * The startup URL is obtained through other - * (perhaps non-standardized) procedures. - */ - STARTUP_URL_OTHER: 9, - - /* - * Description: - * Private OITF Identifier. This property SHALL take the value undefined - * except when accessed by applications meeting - * either of the following criteria: - * - * - The application is signalled in an SD&S service provider discovery - * record with an application usage of - * urn:oipf:cs:ApplicationUsageCS:2009:hni-igi where - * the SD&S service provider discovery record was obtained by - * the OITF through the procedure defined in section 5.4.1.2 of [OIPF_PROT2]. - * - * - The URL of the application was discovered directly through - * the procedure defined in section 5.4.1.2 of [OIPF_PROT2]. - * - * In these two cases, it SHALL take the same value as defined for the - * DHCP client identifier in DHCP option 61 - * in section 12.1.1.1 of [OIPF_PROT2]. - * - * Visibility Type: readonly String - */ - deviceID: undefined, - - /* - * Description: - * Indicates whether the system has finished initialising. - * A value of true indicates that the system is ready. - * - * Visibility Type: readonly Boolean - */ - systemReady: null, +class LocalSystem { - /* - * Description: - * String identifying the vendor name of the device. - * - * Visibility Type: readonly String - */ - vendorName: null, - - /* - * Description: - * String identifying the model name of the device. - * - * Visibility Type: readonly String - */ - modelName: null, - - /* - * Description: - * String identifying the name of the family that the device belongs to. - * Devices in a family differ only by details that do not impact - * the behaviour of the OITF aspect of the device, e.g. screen size, - * remote control, number of HDMI ports, size of hard disc. - * Family names are allocated by the vendor and the combination of - * vendorName and familyName should uniquely identify a family of devices. - * Different vendors may use the same familyName, although - * they are recommended to use conventions that avoid this. - * - * Visibility Type: readonly String - */ - familyName: null, + constructor(defaultProperties) { + /* + * The OITF is in the off state and no power is consumed. + * This is the case of a power outage or if the OITF has the + * ability to be completely turned off. Scheduled recording is + * not expected to work. + */ + this.OFF = 0; - /* - * Description: - * String identifying the version number of the platform firmware. - * - * Visibility Type: readonly String - */ - softwareVersion: null, - - /* - * Description: - * String identifying the version number of the platform firmware. - * - * Visibility Type: readonly String - */ - hardwareVersion: null, - - /* - * Description: - * String identifying the version number of the platform firmware. - * - * Visibility Type: readonly String - */ - serialNumber: null, - - /* - * Description: - * Release version of the OIPF specification implemented by the OITF. - * For instance, if the OITF implements release 2 version “1.0”, - * this property should be set to 2. - * - * Visibility Type: readonly Integer - */ - releaseVersion: null, - - /* - * Description: - * Major version of the OIPF specification implemented by the OITF. - * For instance, if the OITF implements release 2 version “2.0”, - * this property should be set to 2. - * - * Visibility Type: readonly Integer - */ - majorVersion: null, - - /* - * Description: - * Minor version of the OIPF specification implemented by the OITF. - * For instance, if the OITF implements release 2 version “2.0”, - * this property should be set to 0. - * - * Visibility Type: readonly Integer - */ - minorVersion: null, - - /* - * Description: - * Profile of the OIPF specification implemented by the OITF. - * Values of this field are not defined in this specification. - * - * Visibility Type: readonly String - */ - oipfProfile: null, - - /* - * Description: - * Flag indicating whether the platform has PVR capability (local PVR). - * Note: This property is deprecated in favour of the pvrSupport property. - * - * Visibility Type: readonly Boolean - */ - pvrEnabled: null, - - /* - * Description: - * Flag indicating whether the platform has CI+ capability. - * - * Visibility Type: readonly String - */ - ciplusEnabled: Boolean, - - /* - * Description: - * The powerState property provides the DAE application the ability - * to determine the current state of the OITF. - * The property is limited to the ACTIVE_STANDBY or ON states. - * - * Visibility Type: readonly Integer - */ - powerState: null, - - /* - * Description: - * The previousPowerState property provides the DAE application the ability - * to retrieve the previous state. - * - * Visibility Type: readonly String - */ - previousPowerState: null, - - /* - * Description: - * The time that the OITF entered the current power state. - * The time is represented in seconds since midnight (GMT) on 1/1/1970. - * - * Visibility Type: readonly String - */ - timeCurrentPowerState: null, - - /* - * Description: - * Get or set the overall system volume. Valid values for this property are in the range 0 - 100. The OITF SHALL store this setting persistently. - * - * Type: Integer - */ - volume: null, + /* + * The OITF is in normal working mode with user + * interaction. The DAE applications may render any + * presentation graphically. + */ + this.ON = 1; - /* - * Description: - * Get or set the mute status of the default audio output(s). A value of true indicates that the default output(s) are currently muted. - * - * Type: Boolean - */ - mute: null, - - /* - * Description: - * A collection of Tuner objects representing the physical tuners available in the OITF. - * - * Visibility Type: readonly TunerCollection - */ - tuners: null, - - /* - * Description: - * A collection of AVOutput objects representing the audio and video outputs of the platform. Applications - * MAY use these objects to configure and control the available outputs. - * - * Visibility Type: readonly AVOutputCollection - */ - outputs: null, - - /* - * Description: - * A collection of NetworkInterface objects representing - * the available network interfaces. - * - * Visibility Type: readonly NetworkInterfaceCollection - */ - networkInterfaces: null, - - /* - * Description: - * Read whether the display is currently in a 2D or 3D mode. - * Return values are: - * ------------------------------------------------------------------------ - * Value | Description - * ------------- ---------------------------------------------------------- - * 1 | Indicates platform support for the NTSC TV standard. - * ------------- ---------------------------------------------------------- - * 2 | Indicates platform support for the PAL-BGH TV standard. - * ------------- ---------------------------------------------------------- - * 4 | Indicates platform support for the SECAM TV standard. - * ------------- ---------------------------------------------------------- - * 8 | Indicates platform support for the PAL-M TV standard. - * ------------- ---------------------------------------------------------- - * 16 | Indicates platform support for the PAL-N TV standard. - * ------------------------------------------------------------------------ - * Values are stored as a bitfield. - * - * Visibility Type: Integer - */ - tvStandardsSupported: null, - - /* - * Description: - * Get the TV standard for which the analogue video outputs are currently - * configured. This property can take one or more of the following values: - * ------------------------------------------------------------------------ - * Value | Description - * ------------- ---------------------------------------------------------- - * 0 | Indicates there are no analogue video outputs - * ------------- ---------------------------------------------------------- - * 1 | Indicates platform support for the NTSC TV standard. - * ------------- ---------------------------------------------------------- - * 2 | Indicates platform support for the PAL-BGH TV standard. - * ------------- ---------------------------------------------------------- - * 4 | Indicates platform support for the SECAM TV standard. - * ------------- ---------------------------------------------------------- - * 8 | Indicates platform support for the PAL-M TV standard. - * ------------- ---------------------------------------------------------- - * 16 | Indicates platform support for the PAL-N TV standard. - * ------------------------------------------------------------------------ - * - * Visibility Type: Integer - */ - tvStandard: null, - - /* - * Description: - * Flag indicating the type of PVR support used by the application. - * This property may take zero or more of the following values: - * ------------------------------------------------------------------------ - * Value | Description - * ------------- ---------------------------------------------------------- - * | PVR functionality is not supported. This is the default - * 0 | value if <recording> as specified in section 9.3.3 - * | has value false . - * ------------- ---------------------------------------------------------- - * | PVR functionality is not supported. This is the default - * 1 | value if <recording> as specified in section 9.3.3 - * | has value false . - * ------------- ---------------------------------------------------------- - * - * Visibility Type: readonly Integer - */ - pvrSupport: null, - - /* - * Description: - * A collection of NetworkInterface objects representing - * the available network interfaces. - * - * Visibility Type: readonly NetworkInterfaceCollection - */ - startupInformation: null, - - init: function(defaultProperties) { + /* + * The OITF is in the lowest possible power consumption + * state (meeting regulations and certifications). The OITF + * may support wake-up from a passive standby in order, for + * example, to perform a scheduled recording. + */ + this.PASSIVE_STANDBY = 2; + + /* + * The OITF is in an intermediate power consumption state. + * The output to the display shall be inactive. In this state + * DAE applications may continue to operate. + */ + this.ACTIVE_STANDBY = 3; + + /* + * The OITF is in the lowest possible power consumption + * state (meeting regulations and certifications). If th + * platform supports hibernate mode then the OITF stores + * all applications in volatile memory to allow for quick + * startup. + */ + this.PASSIVE_STANDBY_HIBERNATE = 4; + + /* + * The OITF shall restart and return to a ON state. + */ + this.RESTART = 5; + + /* + * Restart the OITF and reset all settings and data to an + * initial/factory state. The exact settings and data to be + * reset are implementation dependant. The use of the this + * operation with the setPowerState method is subject to + * security control defined in section 10.1.3.8 + */ + this.FACTORY_RESET = 6; + + /* + * No startup URL is known. + */ + this.STARTUP_URL_NONE = 0; + + /* + * The startup URL is derived from DHCP procedures. + */ + this.STARTUP_URL_DHCP = 1; + + /* + * The startup URL is derived through TR-069 procedures. + */ + this.STARTUP_URL_TR069 = 2; + + /* + * The startup URL is that which is configured through the OITF firmware. + */ + this.STARTUP_URL_PRECONFIGURED = 3; + + /* + * The startup URL is obtained through other + * (perhaps non-standardized) procedures. + */ + this.STARTUP_URL_OTHER = 9; + + /* + * Description: + * Private OITF Identifier. This property SHALL take the value undefined + * except when accessed by applications meeting + * either of the following criteria: + * + * - The application is signalled in an SD&S service provider discovery + * record with an application usage of + * urn:oipf:cs:ApplicationUsageCS:2009:hni-igi where + * the SD&S service provider discovery record was obtained by + * the OITF through the procedure defined in section 5.4.1.2 of [OIPF_PROT2]. + * + * - The URL of the application was discovered directly through + * the procedure defined in section 5.4.1.2 of [OIPF_PROT2]. + * + * In these two cases, it SHALL take the same value as defined for the + * DHCP client identifier in DHCP option 61 + * in section 12.1.1.1 of [OIPF_PROT2]. + * + * Visibility Type: readonly String + */ + this.deviceID = undefined; + + /* + * Description: + * Indicates whether the system has finished initialising. + * A value of true indicates that the system is ready. + * + * Visibility Type: readonly Boolean + */ + this.systemReady = null; + + /* + * Description: + * String identifying the vendor name of the device. + * + * Visibility Type: readonly String + */ + this.vendorName = null; + + /* + * Description: + * String identifying the model name of the device. + * + * Visibility Type: readonly String + */ + this.modelName = null; + + /* + * Description: + * String identifying the name of the family that the device belongs to. + * Devices in a family differ only by details that do not impact + * the behaviour of the OITF aspect of the device, e.g. screen size, + * remote control, number of HDMI ports, size of hard disc. + * Family names are allocated by the vendor and the combination of + * vendorName and familyName should uniquely identify a family of devices. + * Different vendors may use the same familyName, although + * they are recommended to use conventions that avoid this. + * + * Visibility Type: readonly String + */ + this.familyName = null; + + /* + * Description: + * String identifying the version number of the platform firmware. + * + * Visibility Type: readonly String + */ + this.softwareVersion = null; + + /* + * Description: + * String identifying the version number of the platform firmware. + * + * Visibility Type: readonly String + */ + this.hardwareVersion = null; + + /* + * Description: + * String identifying the version number of the platform firmware. + * + * Visibility Type: readonly String + */ + this.serialNumber = null; + + /* + * Description: + * Release version of the OIPF specification implemented by the OITF. + * For instance, if the OITF implements release 2 version “1.0”, + * this property should be set to 2. + * + * Visibility Type: readonly Integer + */ + this.releaseVersion = null; + + /* + * Description: + * Major version of the OIPF specification implemented by the OITF. + * For instance, if the OITF implements release 2 version “2.0”, + * this property should be set to 2. + * + * Visibility Type: readonly Integer + */ + this.majorVersion = null; + + /* + * Description: + * Minor version of the OIPF specification implemented by the OITF. + * For instance, if the OITF implements release 2 version “2.0”, + * this property should be set to 0. + * + * Visibility Type: readonly Integer + */ + this.minorVersion = null; + + /* + * Description: + * Profile of the OIPF specification implemented by the OITF. + * Values of this field are not defined in this specification. + * + * Visibility Type: readonly String + */ + this.oipfProfile = null; + + /* + * Description: + * Flag indicating whether the platform has PVR capability (local PVR). + * Note: This property is deprecated in favour of the pvrSupport property. + * + * Visibility Type: readonly Boolean + */ + this.pvrEnabled = null; + + /* + * Description: + * Flag indicating whether the platform has CI+ capability. + * + * Visibility Type: readonly String + */ + this.ciplusEnabled = Boolean; + + /* + * Description: + * The powerState property provides the DAE application the ability + * to determine the current state of the OITF. + * The property is limited to the ACTIVE_STANDBY or ON states. + * + * Visibility Type: readonly Integer + */ + this.powerState = null; + + /* + * Description: + * The previousPowerState property provides the DAE application the ability + * to retrieve the previous state. + * + * Visibility Type: readonly String + */ + this.previousPowerState = null; + + /* + * Description: + * The time that the OITF entered the current power state. + * The time is represented in seconds since midnight (GMT) on 1/1/1970. + * + * Visibility Type: readonly String + */ + this.timeCurrentPowerState = null; + + /* + * Description: + * Get or set the overall system volume. Valid values for this property are in the range 0 - 100. The OITF SHALL store this setting persistently. + * + * Type: Integer + */ + this.volume = null; + + /* + * Description: + * Get or set the mute status of the default audio output(s). A value of true indicates that the default output(s) are currently muted. + * + * Type: Boolean + */ + this.mute = null; + + /* + * Description: + * A collection of Tuner objects representing the physical tuners available in the OITF. + * + * Visibility Type: readonly TunerCollection + */ + this.tuners = null; + + /* + * Description: + * A collection of AVOutput objects representing the audio and video outputs of the platform. Applications + * MAY use these objects to configure and control the available outputs. + * + * Visibility Type: readonly AVOutputCollection + */ + this.outputs = null; + + /* + * Description: + * A collection of NetworkInterface objects representing + * the available network interfaces. + * + * Visibility Type: readonly NetworkInterfaceCollection + */ + this.networkInterfaces = null; + + /* + * Description: + * Read whether the display is currently in a 2D or 3D mode. + * Return values are: + * ------------------------------------------------------------------------ + * Value | Description + * ------------- ---------------------------------------------------------- + * 1 | Indicates platform support for the NTSC TV standard. + * ------------- ---------------------------------------------------------- + * 2 | Indicates platform support for the PAL-BGH TV standard. + * ------------- ---------------------------------------------------------- + * 4 | Indicates platform support for the SECAM TV standard. + * ------------- ---------------------------------------------------------- + * 8 | Indicates platform support for the PAL-M TV standard. + * ------------- ---------------------------------------------------------- + * 16 | Indicates platform support for the PAL-N TV standard. + * ------------------------------------------------------------------------ + * Values are stored as a bitfield. + * + * Visibility Type: Integer + */ + this.tvStandardsSupported = null; + + /* + * Description: + * Get the TV standard for which the analogue video outputs are currently + * configured. This property can take one or more of the following values: + * ------------------------------------------------------------------------ + * Value | Description + * ------------- ---------------------------------------------------------- + * 0 | Indicates there are no analogue video outputs + * ------------- ---------------------------------------------------------- + * 1 | Indicates platform support for the NTSC TV standard. + * ------------- ---------------------------------------------------------- + * 2 | Indicates platform support for the PAL-BGH TV standard. + * ------------- ---------------------------------------------------------- + * 4 | Indicates platform support for the SECAM TV standard. + * ------------- ---------------------------------------------------------- + * 8 | Indicates platform support for the PAL-M TV standard. + * ------------- ---------------------------------------------------------- + * 16 | Indicates platform support for the PAL-N TV standard. + * ------------------------------------------------------------------------ + * + * Visibility Type: Integer + */ + this.tvStandard = null; + + /* + * Description: + * Flag indicating the type of PVR support used by the application. + * This property may take zero or more of the following values: + * ------------------------------------------------------------------------ + * Value | Description + * ------------- ---------------------------------------------------------- + * | PVR functionality is not supported. This is the default + * 0 | value if <recording> as specified in section 9.3.3 + * | has value false . + * ------------- ---------------------------------------------------------- + * | PVR functionality is not supported. This is the default + * 1 | value if <recording> as specified in section 9.3.3 + * | has value false . + * ------------- ---------------------------------------------------------- + * + * Visibility Type: readonly Integer + */ + this.pvrSupport = null; + + /* + * Description: + * A collection of NetworkInterface objects representing + * the available network interfaces. + * + * Visibility Type: readonly NetworkInterfaceCollection + */ + this.startupInformation = null; + this._listeners = {}; this._callbacks = {}; this._eventManager = new EventManager(); @@ -383,125 +383,121 @@ this._defaultProperties = defaultProperties; oipf.utils.initProperties.call(this, defaultProperties.localSystem); this.systemReady = true; - }, - + } + /* - * Description: - * Set the resolution of the graphics plane. If the specified resolution - * is not supported by the OITF, this method SHALL return false. + * Description: + * Set the resolution of the graphics plane. If the specified resolution + * is not supported by the OITF, this method SHALL return false. * Otherwise, this method SHALL return true. - * + * * Arguments: * - width: The width of the display, in pixels. - * + * * - height: The height of the display, in pixels. - * + * * Return: Boolean */ - setScreenSize: function(width, height) { + setScreenSize(width, height) { var parameters = arguments; - + if (parameters.length > 2) { throw new TypeError("Excessive number of arguments."); } - + if (parameters.length < 2) { throw new TypeError("Insufficient number of arguments."); } - + if (!Number.isInteger(width) && !Number.isInteger(height)) { - throw new TypeError - ("This function cannot be called with theses arguments."); + throw new TypeError("This function cannot be called with theses arguments."); } - - var authorizedResolution = - this._defaultProperties.screenSize[width+"x"+height]; - + + var authorizedResolution = this._defaultProperties.screenSize[width + "x" + height]; + if (authorizedResolution) { this._width = width; this._height = height; - + return true; } - + return false; - - }, - + + } + /* - * Description: - * Set the TV standard to be used on the analogue video outputs. + * Description: + * Set the TV standard to be used on the analogue video outputs. * Returns false if the requested mode cannot be set. - * + * * Arguments: - * - tvStandard: The TV standard to be set. + * - tvStandard: The TV standard to be set. * Valid values are defined in the description of the * tvStandard property in section 7.3.3.2. - * + * * Return: Boolean - * FIXME: Yannis - 23/04/2015 - Take intp account that the value of - * "tvStandard" can be stored as a bitfield. + * FIXME: Yannis - 23/04/2015 - Take intp account that the value of + * "tvStandard" can be stored as a bitfield. */ - setTVStandard: function(tvStandard) { + setTVStandard(tvStandard) { var parameters = arguments; - + if (parameters.length > 1) { throw new TypeError("Excessive number of arguments."); } - + if (parameters.length < 1) { throw new TypeError("Insufficient number of arguments."); } - + if (!Number.isInteger(arguments[0])) { - throw new TypeError - ("This function cannot be called with theses arguments."); + throw new TypeError("This function cannot be called with theses arguments."); } - - var tvStandardSupported = + + var tvStandardSupported = this._defaultProperties.tvStandardsSupported[tvStandard]; if (tvStandardSupported) { this.tvStandard = tvStandard; return true; } - + return false; - }, - + } + /* - * Description: - * Set the type of PVR support used by the application. - * The types of PVR supported by the receiver MAY not be supported + * Description: + * Set the type of PVR support used by the application. + * The types of PVR supported by the receiver MAY not be supported * by the application; in this case, the return value indicates * the pvr support that has been set. - * + * * Arguments: - * - state: The type of PVR support desired by the application. - * More than one type of PVR functionality MAY be specified, + * - state: The type of PVR support desired by the application. + * More than one type of PVR functionality MAY be specified, * allowing the receiver to automatically select the * appropriate mechanism. Valid values are: - * + * * - height: The height of the display, in pixels. - * + * * Return: Boolean */ - setPvrSupport: function(state) { + setPvrSupport(state) { var parameters = arguments; - + if (parameters.length > 1) { throw new TypeError("Excessive number of arguments."); } - + if (parameters.length < 1) { throw new TypeError("Insufficient number of arguments."); } - + if (!Number.isInteger(state)) { - throw new TypeError - ("This function cannot be called with theses arguments."); + throw new TypeError("This function cannot be called with theses arguments."); } - + if (state == 0 || state == 1) { this.pvrSupport = state; return true; @@ -509,44 +505,44 @@ this.pvrSupport = 0; return this.pvrSupport; } - - }, - + + } + /* - * Description: + * Description: * The setPowerState() method allows the DAE application to - * modify the OITF state. The power state change may be restricted - * for some values of type, for example OFF, PASSIVE_STANDBY, + * modify the OITF state. The power state change may be restricted + * for some values of type, for example OFF, PASSIVE_STANDBY, * RESTART and FACTORY_RESET . A call to setPowerState() with a * restricted value of type SHALL return false . - * + * * Arguments: - * - type: The type values that may be specified are defined + * - type: The type values that may be specified are defined * in section 7.3.3.1 - * + * * Return: Boolean */ - setPowerState: function(type) { + setPowerState(type) { var parameters = arguments; - + if (parameters.length > 1) { throw new TypeError("Excessive number of arguments."); } - + if (parameters.length < 1) { throw new TypeError("Insufficient number of arguments."); } - + if (!Number.isInteger(arguments[0])) { - throw new TypeError - ("This function cannot be called with theses arguments."); + throw new TypeError("This function cannot be called with theses arguments."); } - - var restrictedPowerState = + + var restrictedPowerState = this._defaultProperties.restrictedPowerState[type]; - + if (restrictedPowerState) { return false; + } else { this.previousPowerState = this.powerState; this.timeCurrentPowerState = new Date().getTime(); @@ -554,123 +550,121 @@ this._timeout() .then(this._fireEvent.bind( this, createCustomEvent("PowerStateChange", [this.powerState]))); - + return true; } - - }, - + } + /* - * Description: + * Description: * Set the credentials for the specified protocol to use for digest a - * uthentication negotiation for all subsequent requests to the specified - * domain. The credentials are persistently stored overwriting any previous - * set credentials. If domain is null the provided credentials SHALL apply - * for all domains. Returns true if credentials are successfully set, - * false otherwise. - * If digest authentication is not supported for - * the specified protocol then return false . The valid values are - * the strings “ http ” and “ https ”. - * Setting of Digest Credentials on the same protocol and domain - * SHALL update the username and password. - * If the credentials, when used, are incorrect then the behaviour - * SHALL be the same as any other time that stored credentials - * are incorrect, e.g. saved values from a user prompt. - * The credentials SHALL be used (if necessary) in all requests - * made by DAE applications. The credentials MAY be used in requests + * uthentication negotiation for all subsequent requests to the specified + * domain. The credentials are persistently stored overwriting any previous + * set credentials. If domain is null the provided credentials SHALL apply + * for all domains. Returns true if credentials are successfully set, + * false otherwise. + * If digest authentication is not supported for + * the specified protocol then return false . The valid values are + * the strings “ http ” and “ https ”. + * Setting of Digest Credentials on the same protocol and domain + * SHALL update the username and password. + * If the credentials, when used, are incorrect then the behaviour + * SHALL be the same as any other time that stored credentials + * are incorrect, e.g. saved values from a user prompt. + * The credentials SHALL be used (if necessary) in all requests + * made by DAE applications. The credentials MAY be used in requests * made by other components such as media players, DLNA clients, etc. - * + * * Arguments: * - protocol: The protocol to apply the credentials. - * + * * - domain: The domain to which the credentials apply. - * + * * - username: The username to be used in the digest authentication. - * + * * - password: The password to be used in the digest authentication. - * + * * Return: Boolean */ - setDigestCredentials: function(protocol, domain, username, password ) { + setDigestCredentials(protocol, domain, username, password ) { if (protocol != "https" && protocol != "http") { throw new Error("Invalid protocol."); } // Utiliser le localStorage pour stocker les information sionon utilisation d'un fichier simplement - }, - + } + /* - * Description: - * Clear any previously set digest credentials for the specified domain. + * Description: + * Clear any previously set digest credentials for the specified domain. * If domain is null all set credentials are cleared. - * Returns true if the digest credentials for the given protocol and - * domain were cleared or do not exist, + * Returns true if the digest credentials for the given protocol and + * domain were cleared or do not exist, * or false if credentials failed to be cleared. - * + * * Arguments: - * - protocol: The protocol to apply the credentials. The value should - * be the same as one of those specified for + * - protocol: The protocol to apply the credentials. The value should + * be the same as one of those specified for * the setDigestCredentials() method. - * + * * - domain: The domain to which the credentials apply. - - * + + * * Return: Boolean */ - clearDigestCredentials: function(protocol, domain, username, password) { - - }, - + clearDigestCredentials(protocol, domain, username, password) { + + } + /* - * Description: - * Check if digest credentials are currently defined - * for the specified protocol and domain. + * Description: + * Check if digest credentials are currently defined + * for the specified protocol and domain. * Returns true if credentials have been set by a previous call to * setDigestCredentials() , otherwise returns false . - * + * * Arguments: - * - protocol: The protocol to apply the credentials. - * The value should be the same as one of those specified for + * - protocol: The protocol to apply the credentials. + * The value should be the same as one of those specified for * the setDigestCredentials() method. - * + * * - domain: The domain to which the credentials apply. - * + * * Return: Boolean */ - hasDigestCredentials: function(protocol, domain, username, password) { - - }, - + hasDigestCredentials(protocol, domain, username, password) { + + } + get onPowerStateChange() { return this._getCallback("PowerStateChange"); - }, - + } + set onPowerStateChange(callback) { this._setCallback("PowerStateChange", callback); - }, - - _getCallback : function(type) { - if(this._callbacks) { + } + + _getCallback(type) { + if (this._callbacks) { return this._callbacks[type]; } - }, - - _setCallback: function(type, callback){ - if(this._callbacks) { + } + + _setCallback(type, callback) { + if (this._callbacks) { this._callbacks[type] = callback; } - }, - - addEventListener: function(type, listener) { + } + + addEventListener(type, listener) { this._eventManager.addEventListener(type, listener, this); - }, - - _fireEvent: function(event) { + } + + _fireEvent(event) { this._eventManager.fireEvent(event, this); - }, - - removeEventListener: function(type, listener) { + } + + removeEventListener(type, listener) { this._eventManager.removeEventListener(type, listener, this); } - -}); \ No newline at end of file +}