function snapshot(){function n(){r()}function r(){e={},o(),h(),y(),T(),t&&w()}function i(){return e}function s(){return e.presets}function o(){var e;funcObj.presets.getSetPresets()&&(e=funcObj.presets.getPresetTxtArr(),presetJSONarray=l(e),u())}function u(){e.presets=presetJSONarray}function a(t,n){e.presets[t]=n}function f(e){var t={};if(e==undefined)return t;if(e.nodeType==1){if(e.attributes.length>0){t.attributes={};for(var n=0,r=e.attributes.length;n<r;n++){var i=e.attributes.item(n);t.attributes[i.nodeName]=i.value}}}else e.nodeType==3&&(t=e.nodeValue);if(e.hasChildNodes())for(var s=0,r=e.childNodes.length;s<r;s++){var o=e.childNodes.item(s),u=o.nodeName;if(typeof t[u]=="undefined")t[u]=f(o);else{if(typeof t[u].push=="undefined"){var a=t[u];t[u]=[],t[u].push(a)}t[u].push(f(o))}}return t}function l(e){var t=new DOMParser,n,r,i=[];for(var s=0;s<e.length;s++)e[s]!=null?(n=t.parseFromString(e[s],"text/xml"),r=f(n),i.push(r)):i.push(null);return i}function c(){return e.sources}function h(){var e=funcObj.sources.getMargeSources();if(!e.length)return;sourceArr=[];for(var t in e)sourceArr[t]=m(e[t]);p(sourceArr)}function p(t){e.sources=t}function d(t){source=m(t),e.sources.indexOf(source)==-1&&e.sources.push(source)}function v(t){var n=m(t),r=e.sources.indexOf(n);r!=-1&&e.sources.splice(r,1)}function m(e){var t={};return t.source=e.sourceName,t.account=e.sourceAccount,t}function g(){return t}function y(n){if(n==undefined){t=!1;var r=funcObj.play.getPlayItem("dcAll"),i=S(r,"playStatus");i==="PLAY_STATE"&&(t=!0),e.isPlaying=t}else e.isPlaying=n}function b(){return e.nowPlayingInfo}function w(){var e=funcObj.play.getPlayItem("dcAll");nowPlayingInfo={};var t=S(e,"album"),n=S(e,"artist"),r=funcObj.play.getCurPlaySrc(),i=S(e,"track"),s=S(e,"trackType");E(t,n,r,i,s)}function E(t,n,r,i,s){nowPlayingInfo={},nowPlayingInfo.album=t,nowPlayingInfo.artist=n,nowPlayingInfo.source=r,nowPlayingInfo.track=i,nowPlayingInfo.trackType=s,e.nowPlayingInfo=nowPlayingInfo}function S(e,t){if(!e.children(t).length)return;var n;return t=="trackType"&&(e.children("isAdvertisment").length==0?n="song":n="ad"),n=e.children(t)[0].textContent,n}function x(){return e.speakers}function T(){var e=[],t=funcObj.devCon.getDevices();for(var n in t)e[n]=L(t[n]);N(e)}function N(t){e.speakers=t}function C(t){var n=L(t);e.speakers.indexOf(n)==-1&&e.speakers.push(n)}function k(t){var n=L(t),r=e.speakers.indexOf(n);r!=-1&&e.speakers.splice(r,1)}function L(e){var t={};return t.name=e.name,t.status=e.status,t.type=e.type,t.IP=e.ip,t.uID=e.uID,t.MACaddress=e.smscMacAddress,t}function A(t){for(var n in e.speakers)if(e.speakers[n].uID==t)return e.speakers[n].MACaddress;return null}function O(t){e.MACaddress=t}var e,t;this.getSnapshot=i,this.getPresets=s,this.setPresetsFromArr=u,this.setPreset=a,this.getSources=c,this.setSourcesFromArr=p,this.addSource=d,this.removeSource=v,this.getIsPlaying=g,this.setIsPlaying=y,this.getSpeakers=x,this.setSpeakersFromArr=N,this.getSpeakerMACadd=A,this.setMACaddress=O,this.getNowPlaying=b,this.setNowPlayingFromInfo=E,n()};