Author: ygrego Date: 2015-03-11 11:12:08 +0000 (Wed, 11 Mar 2015) New Revision: 928 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/928 Log: All the following methods: "_createChannelATSC_T", "_createChannelIPTV", "_createChannelDVBOrISDB", "_createChannelDVB_SI_DIRECT" have been created in order to have differents definitions of "Channel" constructor. That can be useful in usage of method "createChannelObject", a mapping between the arguments of this method and those of "Channel" constructor. Modified: oipf/js/impl/model/Channel.js Modified: oipf/js/impl/model/Channel.js =================================================================== --- oipf/js/impl/model/Channel.js 2015-03-11 10:41:27 UTC (rev 927) +++ oipf/js/impl/model/Channel.js 2015-03-11 11:12:08 UTC (rev 928) @@ -82,13 +82,80 @@ * 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, + init: function () { + var dispatcher = { 3: "_createChannelATSC_T", 4: "_createChannelDVB_SI_DIRECT", 5: "_createChannelDVBOrISDB", 6: "_createChannelIPTV"}; + this.channelId = createUUID(); + this[dispatcher[arguments.length]].apply(this, arguments); + + }, - init: function (name, channelType, channelId, idType) { + _createChannelATSC_T: function(idType, sourceID, name) { + this.idType = idType; + this.sourceID = sourceID; this.name = name; - this.channelType = CHANNEL_CONSTANT[channelType]; - this.channelId = channelId; + }, + + _createChannelIPTV: function(idType, onid, tsid, sid, ipBroadcastID, name) { this.idType = idType; + this.ipBroadcastID = ipBroadcastID; + this.name = name; + if (idType == 41) { + this.onid = onid; + this.tsid = tsid; + this.sid = sid; + } + }, + + _createChannelDVBOrISDB: function(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){ + this.idType = idType; + this.dsd = dsd; + this.sid = sid; + this.name = name; } - + }); \ No newline at end of file