Author: ygrego Date: 2015-03-26 16:38:37 +0000 (Thu, 26 Mar 2015) New Revision: 975 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/975 Log: -The namespace "channelUtils" has been added to following methods "findChannel", "verifyASuitableTunerAvailable", "getChannelByDsd, "isAValidTerrestrialDsd", "getChannelByIpBroadcastID" when these one are called. -The calls to "getChannelConfig" have been replaced by "_channelService". Modified: oipf/js/impl/VideoBroadcastObject.js Modified: oipf/js/impl/VideoBroadcastObject.js =================================================================== --- oipf/js/impl/VideoBroadcastObject.js 2015-03-26 16:05:41 UTC (rev 974) +++ oipf/js/impl/VideoBroadcastObject.js 2015-03-26 16:38:37 UTC (rev 975) @@ -282,7 +282,7 @@ * in section 7.13.9. The method SHALL return the value null if the channel list is not * (partially) managed by the OITF (i.e., if the channel list information is managed entirely in the network). */ - getChannelConfig: function() { + getChannelConfigr: function() { return oipfObjectFactory.createChannelConfig(); }, @@ -312,7 +312,7 @@ * TODO : binding of necessary ressources */ bindToCurrentChannel: function() { - var channelConfig = this.getChannelConfig(); + var channelConfig = this._channelService; var currentChannel = channelConfig.currentChannel; var self = this; @@ -357,7 +357,7 @@ case this._STOPPED: //FIX-ME :Make enable video and audio presentation - if (!verifyASuitableTunerAvailable(currentChannel.idType)) { + if (!channelUtils.verifyASuitableTunerAvailable(currentChannel.idType)) { this._timer = oipf.utils.timeout(0) .then(this.changePlayState.bind(this, this._STOPPED, 0)); } else { @@ -510,14 +510,14 @@ if (CHANNEL_CREATION[idType]) { //Verify a channel of this idType (ID_DVB_SI_DIRECT = 13). - if (isAValidTerrestrialDsd(dsd)) { //Verify the dsd validity. + if (channelUtils.isAValidTerrestrialDsd (dsd)) { //Verify the dsd validity. if ((sid >= 1) && (sid <= 65535)) { //Verify the rigth range of service id. var newChannel = new Channel(idType, dsd, sid, "localChannel" + createUUID()); - var channelConfig = this.getChannelConfig(); + var channelConfig = this._channelService; - if (getChannelByDsd(channelConfig.channelList, dsd)) { + if (channelUtils.getChannelByDsd(channelConfig.channelList, dsd)) { /* Normally channelList is readonly but the method documentation say * that the channel must be add if it not already present. @@ -591,11 +591,11 @@ } if (idType == 30) { - var equivalentChannel = this.getChannelConfig().channelList.getChannelBySourceID(sourceID); + var equivalentChannel = this._channelService.channelList.getChannelBySourceID(sourceID); } else if (idType == 40) { - equivalentChannel = getChannelByIpBroadcastID(ipBroadcastID); + equivalentChannel = channelUtils.getChannelByIpBroadcastID(ipBroadcastID); } else { - equivalentChannel = this.getChannelConfig().channelList.getChannelByTriplet(onid, tsid, sid); + equivalentChannel = this._channelService.channelList.getChannelByTriplet(onid, tsid, sid); } if (equivalentChannel) { @@ -604,7 +604,7 @@ newChannel = new Channel(arguments.push("localChannel:"+createUUID())); } - this.getChannelConfig().channelList.push(newChannel); + this._channelService.channelList.push(newChannel); } return null; @@ -632,7 +632,7 @@ if (this.playState >= this._CONNECTING && this.playState <= this._STOPPED && channel) { - if (verifyASuitableTunerAvailable(channel.idType, this) && channel.idType != 41) { + if (channelUtils.verifyASuitableTunerAvailable(channel.idType, this) && channel.idType != 41) { timeout(0) .then(this.changeStateToConnectingWhenSwitching.bind(this, channel)); @@ -823,7 +823,7 @@ //claimed scarce resources //Call method to claim scarce resources - var channelConfig = this.getChannelConfig(); + var channelConfig = this._channelService; var favouriteLists = channelConfig.favouriteLists; if ((this.playState > 0) && (this.playState < 4)) { @@ -861,9 +861,9 @@ channelCollection = channelConfig.currentFavouriteLists; } - var channelToChange = findChannel(channelCollection, this.currentChannel, step); + var channelToChange = channelUtils.findChannel(channelCollection, this.currentChannel, step); - if (verifyASuitableTunerAvailable(channelToChange.idType, this)) { + if (channelUtils.verifyASuitableTunerAvailable(channelToChange.idType, this)) { timeout(0) .then(this.changeStateToConnectingWhenSwitching.bind(this, channelToChange)); }