Symbol 8 MovieClip [mc_explicit] Frame 21
this.removeMovieClip();
Symbol 12 MovieClip [mc_volbutton] Frame 1
#initclip 12
Object.registerClass("mc_volbutton", iButton);
#endinitclip
this.bluedisc._alpha = 0;
stop();
Symbol 14 MovieClip [mc_AppleButton] Frame 1
#initclip 8
Object.registerClass("mc_AppleButton", iButton);
#endinitclip
Symbol 20 MovieClip [mc_buttonArray] Frame 1
mc_tippedCursor._visible = false;
mc_play.mc = mc_tippedCursor;
mc_url.mc = mc_tippedCursor;
mc_vol.mc = mc_tippedCursor;
Symbol 23 MovieClip [mc_xfmode] Frame 1
stop();
Symbol 23 MovieClip [mc_xfmode] Frame 2
stop();
Symbol 25 MovieClip [mc_panel_tag] Frame 1
#initclip 9
Object.registerClass("mc_panel_tag", iButton);
#endinitclip
Symbol 28 MovieClip [url_mc] Frame 1
#initclip 10
Object.registerClass("url_mc", iButton);
#endinitclip
this.onRollOver = showTip;
this.onRollOut = hideTip;
stop();
Symbol 29 MovieClip [FMP256] Frame 1
#initclip 11
Object.registerClass("FMP256", FMP256core4SP);
#endinitclip
function reflow() {
isExpanded = Stage.width > 390;
mc_LCD._visible = isExpanded;
mc_BG._width = Stage.width;
mc_PT._xscale = (isExpanded ? 100 : -100);
xy_PT.x = Stage.width - 8;
FMPUtils.setXY(mc_PT, xy_PT);
mc_PT.tip = arrTIPS[(isExpanded ? 6 : 5)];
}
function disableMe(msg) {
this.isEnabled = false;
mc_LCD.t1.text = msg;
arrScrollText[0] = msg;
arrScrollText[2] = (isSilent ? "" : "BROKEN PLAYER IS BROKEN ;_;");
arrScrollText[1] = "";
}
function versionKill() {
disableMe(lblFlashVersion);
mc_LCD.onRelease = function () {
getURL ("http://www.adobe.com/products/flashplayer/");
};
stop();
}
function configureUI() {
mc_BA.mc_vol.tip = arrTIPS[3];
var _local1 = (isPaused ? "play_b" : "pause");
var _local2 = arrTIPS[(isPaused ? 0 : 1)];
mc_BA.mc_play.setIT(_local1, _local2);
mc_BA.mc_XFM.gotoAndStop((XFM ? 1 : 2));
}
function setTitle() {
mc_LCD.t1.text = scrolltext(0);
mc_LCD.t2.text = scrolltext(1);
mc_LCD.t3.text = scrolltext(2);
}
function ticker() {
if (isSliding) {
var _local1 = Math.round((mc_BA.mc_vol._x - volDisplay[0]) * volScale);
setGlobalVolume(_local1);
}
}
var lblBadPLAYLIST = "ERROR READING PLAYLIST";
var lblNoPLAYLIST = "ERROR - NO PLAYLIST FOUND";
var lblBadCONFIG = "ERROR READING CONFIGURATION FILE";
var lblNoCONFIG = "ERROR: NO CONFIGURATION FILE FOUND";
var lblNoTracks = "STATION OFFLINE";
var lblPending = "CONNECTING TO SERVER...";
var lblFlashVersion = "Flash Player update required. Click here";
var lblNoData = "Track titles not available";
var lblNoStats = "Audio statistics not available";
var arrTIPS = new Array("Play", "Pause", "Help/Info", "Volume", "Visit website", "Expand", "Compact");
Stage.showMenu = false;
Stage.align = "TL";
Stage.scaleMode = "noScale";
var _uarr = _level0._url.split("?", 1);
var _configFile = (_uarr[0].slice(0, -3) + "xml");
if (typeof(_uarr[1]) == "string") {
var _uparr = _uarr[1].split("&");
var i = 0;
while (i < _uparr.length) {
var token = _uparr[i].split("=");
if (token[0].toLowerCase() == "config") {
_configFile = token[1];
}
i++;
}
}
if (typeof(_level0.config) == "string") {
_configFile = _level0.config;
}
var _cache = ((_level0.cache == 1) ? true : false);
var SCPT = System.capabilities.playerType;
var strDNeXurl = "http://www.draftlight.net/dnex/mp3player/minicaster/pro/";
var _cacheXML = (_cache || (_level0._url.slice(0, 4) == "file"));
var FMPlistener = new Object();
var isSliding = false;
var isSeeking = false;
var version_ok = false;
var int_Scroller;
var int_Ticker;
var strNoData = lblNoData;
var _sdata;
var version_sys = System.capabilities.version;
if (typeof(version_sys) == "string") {
var ava = version_sys.split(" ");
var avn = ava[1].split(",");
version_ok = Number(avn[0]) >= 8;
}
var str_myVersion = "5.72";
var volDisplay = new Array(21, 45, 46);
var volScale = (100 / volDisplay[2]);
var _scroll;
var thisWidth = Stage.width;
var isExpanded = (thisWidth > 390);
var sWidth = (isExpanded ? (thisWidth) : 400);
var tf_lcd = new TextFormat("_sans", 10, 16777215);
var bfilter = (new flash.filters.BlurFilter(10, 0, 20));
var steel = (new flash.display.BitmapData(sWidth, 100, false, 2236962));
var xy_LCD = (new flash.geom.Point(110, 10));
var wh_LCD = (new flash.geom.Point(sWidth - 127, 40));
var xy_PT = (new flash.geom.Point(sWidth - 8, 35));
var xy_XFM = (new flash.geom.Point(13, 57));
this.createEmptyMovieClip("mc_BG", this.getNextHighestDepth());
FMPUtils.bevelRectBitmap(mc_BG, steel, 0, 0, sWidth - 1, 69, 2236962, 2236962, 10, 100);
this.createEmptyMovieClip("mc_LCD", this.getNextHighestDepth());
this.attachMovie("mc_buttonArray", "mc_BA", this.getNextHighestDepth());
mc_LCD.attachMovie("mc_lcdPanel", "mc_panel", mc_LCD.getNextHighestDepth());
mc_BA.attachMovie("mc_xfmode", "mc_XFM", mc_BA.getNextHighestDepth());
mc_LCD.mc_panel._width = wh_LCD.x;
FMPUtils.setXY(mc_LCD, xy_LCD);
FMPUtils.setXY(mc_PT, xy_PT);
FMPUtils.setXY(mc_BA.mc_XFM, xy_XFM);
mc_LCD.createTextField("t1", mc_LCD.getNextHighestDepth(), 10, 14, wh_LCD.x - 10, 17);
mc_LCD.t1.setNewTextFormat(tf_lcd);
mc_LCD.createTextField("t2", mc_LCD.getNextHighestDepth(), 10, 27, wh_LCD.x - 10, 17);
mc_LCD.t2.setNewTextFormat(tf_lcd);
mc_LCD.createTextField("t3", mc_LCD.getNextHighestDepth(), 10, 38, wh_LCD.x - 10, 17);
mc_LCD.t3.setNewTextFormat(tf_lcd);
mc_PT.mc = mc_BA.mc_tippedCursor;
mc_PT.tip = arrTIPS[5];
mc_PT.setOffset(-70, 0);
mc_LCD.t1.autoSize = "left";
var i = 0;
while (i < 100) {
mc_LCD.t1.text = mc_LCD.t1.text + "X-";
if (mc_LCD.t1._width > (wh_LCD.x - 35)) {
_scroll = i * 2;
break;
}
i++;
}
mc_LCD.t1.autoSize = "none";
resizeListener = new Object();
resizeListener.onResize = function () {
reflow();
};
reflow();
if (flash.external.ExternalInterface.available) {
if (flash.external.ExternalInterface.call("fmp256resize", thisWidth, 70) != thisWidth) {
mc_PT._visible = false;
} else {
Stage.addListener(resizeListener);
}
} else {
mc_PT._visible = false;
}
FMPlistener.noCONFIG = function (_file) {
disableMe(lblNoCONFIG);
};
FMPlistener.badCONFIG = function (_file) {
disableMe(lblBadCONFIG);
};
FMPlistener.genError = function (_msg) {
disableMe(_msg);
};
FMPlistener.badPLAYLIST = function (_file) {
disableMe((lblBadPLAYLIST + " : ") + _file);
};
FMPlistener.silent_mode = function (_b) {
strNoData = (_b ? "" : (lblNoData));
strNoStats = (_b ? "" : (lblNoStats));
extendedReporting.xtrace("107:Config defines Silent Mode: " + (_b ? "ON" : "OFF"));
};
FMPlistener.plLoading = function () {
mc_LCD.t1.text = lblPLLOADING;
strScrollText[0] = lblPLLOADING;
};
FMPlistener.updateUI = function (_isPL) {
configureUI();
};
FMPlistener.announceTrack = function () {
var _local1 = strCPWsite.length > 0;
var _local2 = (_local1 ? (arrTIPS[4]) : (arrTIPS[2]));
var _local3 = (_local1 ? "url_b" : "url_g");
mc_BA.mc_url.setIT(_local3, _local2);
arrScrollText[0] = ((arrMounts[0].songTitle == "") ? (strCPWtitle) : (arrMounts[0].songTitle));
arrScrollText[1] = ((arrMounts[0].songTitle == "") ? (strNoData) : (strCPWtitle));
arrScrollText[2] = ((((isNPdata && (isStats)) && (arrMounts[0].bitrate != "-1")) && (arrMounts[0].songTitle != "")) ? (((((arrMounts[0].bitrate + " : ") + arrMounts[0].cL) + " of ") + arrMounts[0].mL) + " listeners") : (strNoStats));
mc_BA.mc_url.onRelease = function () {
getURL (((strCPWsite.length > 0) ? (strCPWsite) : (strDNeXurl)), "_blank");
};
};
FMPListener.trackWaiting = function (_total) {
strScrollText[0] = lblPending;
};
FMPlistener.stopAudio = function (_msg) {
strScrollText[0] = lblNoTracks;
strScrollText[3] = _msg;
this.isEnabled = false;
};
FMPlistener.initVol = function (_vol) {
mc_BA.mc_vol._x = Math.round(volDisplay[0] + (_vol / volScale));
};
FMPlistener.playPending = function () {
strScrollText[0] = lblPending;
mc_BA.mc_play.setIT("play_g", "");
};
if (version_ok) {
int_Scroller = setInterval(mx.utils.Delegate.create(this, setTitle), 200);
int_Ticker = setInterval(mx.utils.Delegate.create(this, ticker), 100);
this.addListener(FMPlistener);
if (flash.external.ExternalInterface.available) {
if (flash.external.ExternalInterface.addCallback("setconfig", this, setConfig)) {
extendedReporting.xtrace("113:setconfig registered to JavaScript");
}
if (flash.external.ExternalInterface.addCallback("playpause", this, pressPlay)) {
extendedReporting.xtrace("113:playpause registered to JavaScript");
}
}
mc_BA.mc_vol.onPress = function () {
if (isEnabled) {
this.bluedisc._alpha = 100;
this.startDrag(true, volDisplay[0], volDisplay[1], volDisplay[2] + volDisplay[0], volDisplay[1]);
isSliding = true;
}
};
mc_BA.mc_vol.onRelease = function () {
if (isSliding) {
this.bluedisc._alpha = 0;
this.stopDrag();
isSliding = false;
}
};
mc_BA.mc_vol.onReleaseOutside = function () {
if (isSliding) {
this.bluedisc._alpha = 0;
this.stopDrag();
isSliding = false;
}
};
mc_BA.mc_play.onRelease = function () {
if (isEnabled) {
pressPlay(1);
}
};
mc_PT.onRelease = function () {
if (flash.external.ExternalInterface.available) {
flash.external.ExternalInterface.call("fmp256resize", (isExpanded ? 125 : (sWidth)), 70);
}
};
this.setup(_configFile, _cacheXML, _scroll);
} else {
versionKill();
}
Symbol 30 MovieClip [__Packages.extendedReporting] Frame 0
class extendedReporting
{
function extendedReporting () {
}
static function xtrace(_str) {
flash.external.ExternalInterface.call("xtrace", _str);
}
}
Symbol 31 MovieClip [__Packages.FMPUtils] Frame 0
class FMPUtils
{
function FMPUtils () {
}
static function setXY(_mc, _p) {
_mc._x = _p.x;
_mc._y = _p.y;
}
static function centerMovieClip(_mc) {
_mc._x = Math.floor((Stage.width - _mc._width) / 2);
_mc._y = Math.floor((Stage.height - _mc._height) / 2);
}
static function centerVideoClip(_mc, _w, _h, availWidth, availHeight, _Yoffset, _stf) {
var _local2 = availWidth / _w;
var _local3 = availHeight / _h;
_mc._x = Math.floor(Stage.width / 2);
_mc._y = Math.floor(availHeight / 2) + _Yoffset;
if (((availWidth < _w) || (availHeight < _h)) || (_stf)) {
_mc._width = _w * ((_local2 < _local3) ? (_local2) : (_local3));
_mc._height = _h * ((_local2 < _local3) ? (_local2) : (_local3));
} else {
_mc._width = _w;
_mc._height = _h;
}
}
static function bevelRect(mc, x1, y1, x2, y2, fc, c1, c2, r, a) {
mc.beginFill(fc, a);
roundRect(mc, x1, y1, x2, y2, c1, c2, r, a);
mc.endFill();
}
static function bevelRectBitmap(mc, bmd, x1, y1, x2, y2, c1, c2, r, a) {
mc.beginBitmapFill(bmd, null, true, true);
roundRect(mc, x1, y1, x2, y2, c1, c2, r, a);
mc.endFill();
}
static function plainFrame(mc, w, h, c, a) {
roundRect(mc, 0, 0, w, h, c, c, 0, a);
}
static function plainRect(mc, w, h, c, a) {
mc.beginFill(c, a);
mc.moveTo(0, 0);
mc.lineTo(0, h);
mc.lineTo(w, h);
mc.lineTo(w, 0);
mc.lineTo(0, 0);
mc.endFill();
}
static function line(mc, x1, y1, x2, y2, c, a) {
mc.lineStyle(0, c, a, true);
mc.moveTo(x1, y1);
mc.lineTo(x2, y2);
}
static function circ(mc, d, c, a) {
mc.beginFill(c, a);
mc.moveTo(0, -d);
mc.curveTo(d, -d, d, 0);
mc.curveTo(d, d, 0, d);
mc.curveTo(-d, d, -d, 0);
mc.curveTo(-d, -d, 0, -d);
mc.endFill();
}
static function roundRect(mc, x1, y1, x2, y2, c1, c2, r, a) {
mc.lineStyle(0, c1, a, true);
mc.moveTo(x1 + (0.29 * r), y2 - (0.29 * r));
if (r > 0) {
mc.curveTo(x1, y2 - (0.62 * r), x1, y2 - r);
}
mc.lineTo(x1, y1 + r);
if (r > 0) {
mc.curveTo(x1, y1, x1 + r, y1);
}
mc.lineTo(x2 - r, y1);
if (r > 0) {
mc.curveTo(x2 - (0.62 * r), y1, x2 - (0.29 * r), y1 + (0.29 * r));
}
mc.lineStyle(0, c2, a, true);
if (r > 0) {
mc.curveTo(x2, y1 + (0.62 * r), x2, y1 + r);
}
mc.lineTo(x2, y2 - r);
if (r > 0) {
mc.curveTo(x2, y2, x2 - r, y2);
}
mc.lineTo(x1 + r, y2);
if (r > 0) {
mc.curveTo(x1 + (0.62 * r), y2, x1 + (0.29 * r), y2 - (0.29 * r));
}
}
}
Symbol 32 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 33 MovieClip [__Packages.iButton] Frame 0
class iButton extends MovieClip
{
var onRollOver, onRollOut, mc_tip, __get__mc, __get__tip, mc_icon, intFade;
function iButton (_name, _depth, _initObj) {
super(_name, _depth, _initObj);
onRollOver = showTip;
onRollOut = oRO;
}
function onRollOver2() {
}
function onRollOut2() {
}
function onRelease2() {
}
function onPress2() {
}
function set mc(_mc) {
mc_tip = _mc;
//return(__get__mc());
}
function set tip(_st) {
_tooltip = _st;
//return(__get__tip());
}
function setIT(_ic, _st) {
mc_icon.gotoAndStop(_ic);
_tooltip = _st;
}
function setOffset(_ox, _oy) {
x_offset = x_offset + _ox;
y_offset = y_offset + _oy;
}
function showTip() {
if (_tooltip.length > 0) {
var _local3 = new flash.geom.Point(_root._xmouse + x_offset, _root._ymouse + y_offset);
mc_tip.tipText.text = _tooltip;
mc_tip.tipText2.text = _tooltip;
mc_tip._parent.globalToLocal(_local3);
FMPUtils.setXY(mc_tip, _local3);
if (mc_tip._x < 0) {
mc_tip._x = 0;
}
if (mc_tip._y < 0) {
mc_tip._y = 0;
}
if (mc_tip._x > (Stage.width - mc_tip._width)) {
mc_tip._x = Stage.width - mc_tip._width;
}
if (mc_tip._y > (Stage.height - mc_tip._height)) {
mc_tip._y = Stage.height - mc_tip._height;
}
mc_tip._visible = true;
intFade = setInterval(mx.utils.Delegate.create(this, hideTip), 600);
onRollOver2();
}
}
function oRO() {
hideTip();
onRollOut2();
}
function hideTip() {
if (intFade != undefined) {
clearInterval(intFade);
}
mc_tip._visible = false;
}
var _tooltip = "";
var x_offset = 15;
var y_offset = 5;
}
Symbol 34 MovieClip [__Packages.FMP256core4SP] Frame 0
class FMP256core4SP extends MovieClip
{
var lvPLS, lvPLR, NP, arrSoundMCs, createEmptyMovieClip, getNextHighestDepth, arrSounds, arrMounts, arrScrollOffset, arrScrollText, sndSoundG, xmlCONFIG, strConfigURL, broadcastMessage;
function FMP256core4SP () {
super();
extendedReporting.xtrace(("100:-#- FMP256 Minicaster PRO-ICE " + coreVersion) + " -#-");
AsBroadcaster.initialize(this);
lvPLS = new LoadVars();
lvPLR = new LoadVars();
NP = new FMPNowPlaying();
NP.setup();
arrSoundMCs = new Array(createEmptyMovieClip("mc0", getNextHighestDepth()), createEmptyMovieClip("mc1", getNextHighestDepth()));
arrSounds = new Array(new Sound(arrSoundMCs[0]), new Sound(arrSoundMCs[1]));
arrMounts = new Array();
arrScrollOffset = new Array(0, 0, 0, 0, 0);
arrScrollText = new Array("Minicaster Pro-ICE " + coreVersion, "Draftlight Networks", "", "", "");
sndSoundG = new Sound();
sndSoundG.setVolume(100);
}
function setup(_config, _cacheXML, _sclen) {
if (nScrollLength == 0) {
NP.addListener(this);
}
isCached = _cacheXML;
nScrollLength = _sclen;
if (_config.length > 0) {
xmlCONFIG = new XML();
strConfigURL = _config;
xmlCONFIG.ignoreWhite = true;
xmlCONFIG.onLoad = mx.utils.Delegate.create(this, parseConfigXML);
xmlCONFIG.load(strConfigURL);
} else {
broadcastMessage("NoCONFIG", strConfigURL);
}
}
function NPinfo(_obj) {
if (_obj.title != arrMounts[0].songTitle) {
extendedReporting.xtrace("201:SongTitle=" + _obj.title);
}
arrMounts[0].songTitle = _obj.title;
arrMounts[0].cL = _obj.currlisteners;
arrMounts[0].pL = _obj.peaklisteners;
arrMounts[0].mL = _obj.maxlisteners;
arrMounts[0].bitrate = _obj.bitrate;
isNPdata = true;
announceTrack(true);
}
function NPfail(_u) {
extendedReporting.xtrace("202:Now playing data not available from " + _u);
arrMounts[0].songTitle = "";
arrMounts[0].cL = 0;
arrMounts[0].pL = 0;
arrMounts[0].mL = 0;
arrMounts[0].bitrate = "-1";
isNPdata = false;
announceTrack(true);
}
function startPlaying(_playNow) {
var _local4;
var _local2;
if (isFirstPlay) {
isFirstPlay = false;
}
isPaused = !_playNow;
isWaiting = !_playNow;
if (_playNow) {
if (isXFade && (XFM)) {
if (intFadeout > 0) {
clearInterval(intFadeout);
}
nS = ((nS == 1) ? 0 : 1);
intFadeout = setInterval(mx.utils.Delegate.create(this, soundFade), 200);
}
arrSounds[nS] = null;
arrSounds[nS] = new Sound(arrSoundMCs[nS]);
arrSounds[nS].checkPolicyFile = false;
arrSounds[nS].onLoad = mx.utils.Delegate.create(this, soundLoad);
intReload = setInterval(mx.utils.Delegate.create(this, soundReload), nReload * 60000);
_local2 = arrMounts[0]._streamURL + (isAntiCache ? ("?fmp256anticache=" + Math.random()) : "");
extendedReporting.xtrace((((("120:LOADING '" + _local2) + "' slot=") + nS) + " XFade=") + XFM);
arrSounds[nS].loadSound(_local2, true);
arrSounds[nS].setVolume(((isXFade && (XFM)) ? 0 : 100));
if (intCheckAudio > 0) {
clearInterval(intCheckAudio);
}
intCheckAudio = setInterval(mx.utils.Delegate.create(this, checkAudio), 2000);
}
announceTrack(_playNow);
}
function stopAudio(_isOK, _msg) {
extendedReporting.xtrace(("501:Audio stopped [" + _msg) + "]");
isPaused = true;
if (intFadeout > 0) {
clearInterval(intFadeout);
}
if (intReload > 0) {
clearInterval(intReload);
}
arrSounds[0].stop();
arrSounds[0] = null;
arrSounds[1].stop();
arrSounds[1] = null;
if (_isOK) {
broadcastMessage("updateUI", false);
} else {
broadcastMessage("stopAudio", _msg);
}
}
function pressPlay(_type) {
if (_type == 0) {
stopAudio(true, "forced");
} else if (isEnabled && (isAllDefined)) {
if (isFirstPlay || (isPaused)) {
isFirstPlay = false;
broadcastMessage("playPending", 0);
startPlaying(true);
} else {
stopAudio(true, "button press");
}
}
}
function scrolltext(i) {
var _local2 = arrScrollText[i];
var _local6 = _local2.length;
if (arrScrollOffset[i] == undefined) {
arrScrollOffset[i] == 0;
}
if (_local6 < nScrollLength) {
return(_local2);
}
_local2 = _local2 + " : ";
var _local4 = _local2.substr(arrScrollOffset[i], nScrollLength);
var _local5 = "";
if (_local4.length < (nScrollLength + 3)) {
_local5 = _local2.substr(0, nScrollLength - _local4.length);
}
arrScrollOffset[i]++;
if (arrScrollOffset[i] == (_local6 + 3)) {
arrScrollOffset[i] = 0;
}
return(_local4 + _local5);
}
function setGlobalVolume(_vol) {
sndSoundG.setVolume(_vol);
}
function setConfig(_u, _v) {
stopAudio();
isVolFloating = _v != "1";
extendedReporting.xtrace("112:Received new config URL: " + _u);
setup(_u, isCached, nScrollLength);
}
function XML_init_parse(attr) {
var _local2;
for (var _local4 in attr) {
_local2 = Number(attr[_local4]);
switch (_local4.toLowerCase()) {
case "volume" :
nInitialVolume = (((_local2 >= 0) && (_local2 <= 100)) ? (_local2) : 100);
if (isVolFloating) {
setVol(nInitialVolume, "config file");
}
break;
case "autoplay" :
isAutoStart = ((_local2 == 1) ? true : false);
break;
case "silent" :
isSilent = ((_local2 == 1) ? true : false);
broadcastMessage("silent_mode", isSilent);
break;
case "reload" :
nReload = _local2;
if (nReload < 1) {
nReload = 1;
}
if (nReload > 30) {
nReload = 30;
}
break;
case "xfade" :
XFM = ((_local2 == 1) ? true : false);
break;
default :
broadcastMessage("XML_init_" + _local4.toLowerCase(), _local2);
}
}
}
function XML_mount_parse(attr) {
if ((attr.firstChild.nodeValue != null) && (!isPlaylistDefined)) {
var _local2 = urlDecode(attr.firstChild.nodeValue);
isMountDefined = true;
arrMounts = new Array();
var _local3 = _local2.slice(_local2.indexOf("/", 8));
extendedReporting.xtrace("103:Config defines mount point UID: " + _local3);
NP.__set__strMount(_local3);
var _local4 = new FMPMountData(_local3, "", _local2, 0, 0, "0", "MP3 audio");
arrMounts.push(_local4);
extendedReporting.xtrace("103:Config defines mount point URL: " + _local2);
}
}
function XML_playlist_parse(attr) {
if ((attr.firstChild.nodeValue != null) && (!isMountDefined)) {
strCPWplaylist = urlDecode(attr.firstChild.nodeValue);
isPlaylistDefined = true;
lvPLR.onData = mx.utils.Delegate.create(this, parsePLS);
var _local2 = ["User-Agent", "Mozilla/Flash DNeX_MinicasterPro/www.draftlight.net"];
lvPLS.addRequestHeader(_local2);
lvPLS.sendAndLoad(strCPWplaylist, lvPLR, "POST");
extendedReporting.xtrace("104:Config defines DNAS playlist file: " + strCPWplaylist);
}
}
function XML_website_parse(attr) {
strCPWsite = ((attr.firstChild.nodeValue == null) ? "" : (urlDecode(attr.firstChild.nodeValue)));
extendedReporting.xtrace("105:Config defines info website: " + strCPWsite);
}
function XML_title_parse(attr) {
strCPWtitle = ((attr.firstChild.nodeValue == null) ? "" : (urlDecode(attr.firstChild.nodeValue)));
extendedReporting.xtrace("106:Config defines stream title: " + strCPWtitle);
}
function XML_nowplaying_parse(attr) {
var _local2;
isStats = true;
for (var _local4 in attr.attributes) {
_local2 = attr.attributes[_local4].toLowerCase();
switch (_local4.toLowerCase()) {
case "type" :
NP.__set__isIcecast(_local2 == "icecast");
break;
case "stats" :
isStats = Number(_local2) == 1;
break;
case "poll" :
nNowPlayingPOLL = parseInt(_local2);
if (nNowPlayingPOLL < 10) {
nNowPlayingPOLL = 10;
} else {
if (nNowPlayingPOLL <= 300) {
break;
}
nNowPlayingPOLL = 300;
}
}
}
if (attr.firstChild.nodeValue != null) {
NP.__set__streamURL(urlDecode(attr.firstChild.nodeValue));
NP.__set__isDefined(true);
extendedReporting.xtrace("107:Config defines NPD URL: " + urlDecode(attr.firstChild.nodeValue));
extendedReporting.xtrace(("107:Config defines NPD poll: " + nNowPlayingPOLL) + " seconds");
extendedReporting.xtrace("107:Config defines NPD stats display: " + (isStats ? "ON" : "OFF"));
}
}
function XML_mp3cast_parse(_tag) {
var _local4 = _tag.childNodes.length;
var _local5;
var _local2 = 0;
while (_local2 < _local4) {
_local5 = _tag.childNodes[_local2];
switch (_tag.childNodes[_local2].nodeName.toLowerCase()) {
case "mount" :
XML_mount_parse(_tag.childNodes[_local2]);
break;
case "playlist" :
XML_playlist_parse(_tag.childNodes[_local2]);
break;
case "nowplaying" :
XML_nowplaying_parse(_tag.childNodes[_local2]);
break;
case "website" :
XML_website_parse(_tag.childNodes[_local2]);
break;
case "title" :
XML_title_parse(_tag.childNodes[_local2]);
}
_local2++;
}
}
function parseConfigXML(_st) {
isMountDefined = false;
var _local3;
var _local5;
var _local2;
var _local4;
if ((xmlCONFIG.status == 0) && (xmlCONFIG.firstChild.nodeName.toLowerCase() == "config")) {
extendedReporting.xtrace("114:Config file loaded and accepted");
_local5 = xmlCONFIG.firstChild.childNodes.length;
_local3 = 0;
while (_local3 < _local5) {
_local2 = xmlCONFIG.firstChild.childNodes[_local3];
_local4 = _local2.nodeName.toLowerCase();
if (_local4 == "init") {
XML_init_parse(_local2.attributes);
} else if (_local4 == "mp3cast") {
XML_mp3cast_parse(_local2);
}
_local3++;
}
broadcastMessage("createUI");
if (isMountDefined) {
preparePlayback();
}
} else {
extendedReporting.xtrace("506:Config file not found or XML format incorrect");
broadcastMessage("badCONFIG", strConfigURL);
}
}
function preparePlayback() {
isAllDefined = isPlaylistDefined || (isMountDefined);
if (NP.__get__isDefined()) {
NP.__set__strMount(arrMounts[0].uid);
updateNP();
intNP = setInterval(mx.utils.Delegate.create(this, updateNP), nNowPlayingPOLL * 1000);
}
startPlaying(isAutoStart);
}
function parsePLS(_s) {
var _local5;
var _local4;
var _local2;
var _local6 = false;
if (_s != undefined) {
extendedReporting.xtrace("110:DNAS playlist file loaded OK");
_local4 = _s.toString().split(newline);
if (_local4[0].substr(0, 10) == "[playlist]") {
_local2 = 2;
while (_local2 < _local4.length) {
if (_local4[_local2].substr(0, 4) == "File") {
_local5 = _local4[_local2].split("=", 2);
var _local3 = new FMPMountData("", "", _local5[1], 0, 0, 0, 0);
arrMounts.push(_local3);
_local6 = true;
}
_local2++;
}
}
if (_local6) {
extendedReporting.xtrace(("111:DNAS playlist file parsed OK - " + arrMounts.length) + " entries");
preparePlayback();
}
}
if (!_local6) {
broadcastMessage("badPLAYLIST");
}
}
function updateNP() {
NP.poll();
}
function announceTrack(_playingNow) {
if (!_playingNow) {
broadcastMessage("trackWaiting", 1);
isFirstPlay = true;
}
broadcastMessage("announceTrack");
broadcastMessage("updateUI", true);
}
function soundReload() {
isXFade = true;
clearInterval(intReload);
extendedReporting.xtrace("150:Reloading stream, XFade=" + XFM);
startPlaying(true);
}
function soundFade() {
var _local2 = ((nS == 1) ? 0 : 1);
var _local5 = arrSounds[nS].position;
if (_local5 > 5000) {
var _local3 = arrSounds[_local2].getBytesLoaded();
var _local4 = ((_local3 > 0) ? (_local3) : "N/A");
arrSounds[nS].setVolume(100);
arrSounds[_local2].stop();
delete arrSounds[_local2];
clearInterval(intFadeout);
intFadeout = 0;
isXFade = false;
extendedReporting.xtrace("151:XFade completed. Chunk size = " + _local4);
}
}
function soundLoad(_st) {
if (!_st) {
extendedReporting.xtrace("502:Stream failed to load from " + arrMounts[0].streamURL);
if (!soundError) {
if (arrMounts.length > 1) {
extendedReporting.xtrace("503:Trying next URL in playlist...");
arrMounts.shift();
startPlaying(true);
} else if (isXFade) {
XFM = false;
delete arrSounds[1];
nS = 0;
isXFade = false;
clearInterval(intFadeout);
clearInterval(intCheckAudio);
startPlaying(true);
} else {
stopAudio(false, "Audio stream failed to load");
}
}
} else {
extendedReporting.xtrace("121:Stream loaded OK");
}
soundError = false;
}
function setVol(_vol, _st) {
sndSoundG.setVolume(_vol);
extendedReporting.xtrace((("108:Volume set to " + _vol) + "% by ") + _st);
broadcastMessage("initVol", _vol);
}
function str_replace(_s, _r, _t) {
var _local1 = _t.split(_s);
return(_local1.join(_r));
}
function urlDecode(_u) {
_u = str_replace("%20", " ", _u);
_u = str_replace(newline, "", _u);
_u = str_replace("\r", "", _u);
_u = str_replace("\t", "", _u);
_u = str_replace("%26", "&", _u);
_u = str_replace("%3D", "=", _u);
_u = str_replace("%22", "\"", _u);
return(_u);
}
function checkAudio() {
intCheckCount++;
var _local2;
if (arrSounds[0].position != undefined) {
_local2 = (((("Bytes Loaded=" + arrSounds[0].getBytesLoaded()) + ", Position=") + arrSounds[0].position) + ", Duration=") + arrSounds[0].duration;
extendedReporting.xtrace("109:Slot 0 status: " + _local2);
}
if (arrSounds[1].position != undefined) {
_local2 = (((("Bytes Loaded=" + arrSounds[1].getBytesLoaded()) + ", Position=") + arrSounds[1].position) + ", Duration=") + arrSounds[1].duration;
extendedReporting.xtrace("109:Slot 1 status: " + _local2);
}
if (intCheckCount == 6) {
clearInterval(intCheckAudio);
intCheckCount = 0;
if ((arrSounds[nS].getBytesLoaded() <= 10000) && (arrSounds[nS].position == 0)) {
extendedReporting.xtrace("504:Stream data is being downloaded but I cannot read it. The web browser is blocking me.");
soundError = true;
if (XFM && (isXFade)) {
XFM = false;
delete arrSounds[1];
nS = 0;
isXFade = false;
if (intFadeout > 0) {
clearInterval(intFadeout);
}
startPlaying(true);
} else {
stopAudio();
broadcastMessage("genError", "Cannot play: Stream server not responding");
}
} else if ((arrSounds[nS].position == 0) && (arrSounds[nS].duration == 0)) {
soundError = true;
stopAudio();
extendedReporting.xtrace("505:Content of stream does not seem to be MP3 audio");
broadcastMessage("genError", "Cannot play: Stream is not in MP3 format");
}
}
}
static var coreVersion = "v4.32f";
var nS = 0;
var XFM = true;
var intFadeout = 0;
var intCheckAudio = 0;
var intCheckCount = 0;
var intNP = 0;
var nSep = 0;
var intReload = 0;
var nReload = 5;
var nScrollLength = 0;
var nInitialVolume = 100;
var nCurrVolume = 0;
var soundError = false;
var isCached = false;
var isAntiCache = false;
var isNPdata = false;
var isFirstPlay = true;
var isXFade = false;
var isAllDefined = false;
var isAutoStart = false;
var isPaused = true;
var isSilent = false;
var isStats = false;
var isLoaded = false;
var isVolFloating = true;
var isWaiting = true;
var isEnabled = true;
var isMountDefined = false;
var isPlaylistDefined = false;
var strCPWplaylist = "";
var strCPWtitle = "";
var strCPWsite = "";
var nNowPlayingPOLL = 15;
var strNowPlayingURL = "";
var strCPWType = "S";
}
Symbol 35 MovieClip [__Packages.FMPNowPlaying] Frame 0
class FMPNowPlaying
{
var lv, lv2, stat, strURL, __get__streamURL, _strMount, __get__isIcecast, broadcastMessage;
function FMPNowPlaying () {
AsBroadcaster.initialize(this);
lv = new LoadVars();
lv2 = new LoadVars();
stat = new Object();
stat.stitle = "";
stat.sbitrate = "0";
stat.maxlisteners = 0;
stat.currlisteners = 0;
stat.peaklisteners = 0;
stat.uid = "";
stat.online = 0;
}
function setup() {
var _local2 = ["User-Agent", "Mozilla/Flash DNeX_MinicasterPro/www.draftlight.net"];
lv.addRequestHeader(_local2);
lv2.onData = mx.utils.Delegate.create(this, procStatus);
}
function set streamURL(_s) {
strURL = _s;
//return(__get__streamURL());
}
function set strMount(_s) {
_strMount = _s;
//return(strMount);
}
function set isIcecast(_b) {
_isIcecast = _b;
//return(__get__isIcecast());
}
function set isDefined(_b) {
_isDefined = _b;
//return(isDefined);
}
function get isDefined() {
return(_isDefined);
}
function get info() {
return(stat);
}
function get strMount() {
return(_strMount);
}
function poll() {
if (isValid) {
lv.sendAndLoad(strURL, lv2, "POST");
}
}
function procStatus(_s) {
if (_s != undefined) {
if (_isIcecast) {
procIcecast(_s);
} else {
procShoutcast(_s);
}
} else {
broadcastMessage("NPfail", strURL);
retries++;
if (retries == 2) {
isValid = false;
}
}
}
function procShoutcast(_s) {
var _local5 = false;
var _local6;
var _local3;
var _local2 = new Object();
var _local4 = _s.toString();
if (_local4.substr(0, 11).toLowerCase() == "<html><meta") {
_local6 = _local4.substr(_local4.indexOf("<body>", 0) + 6);
_local3 = _local6.split(",", 7);
if (_local3[6].indexOf("</body>") > 0) {
_local2.title = _local3[6].slice(0, _local3[6].indexOf("</body>"));
_local2.bitrate = _local3[5] + "kbps";
_local2.uid = _local3[4];
_local2.maxlisteners = _local3[3];
_local2.peaklisteners = parseInt(_local3[2], 10);
_local2.online = parseInt(_local3[1], 2);
_local2.currlisteners = parseInt(_local3[0], 10);
_local5 = !(isNaN(_local2.online) || (isNaN(_local2.currlisteners)));
}
} else {
extendedReporting.xtrace("510:Invalid Shoutcast nowplaying page content");
}
if (!_local5) {
broadcastMessage("badSTATUS", strURL);
isValid = false;
} else {
stat = _local2;
broadcastMessage("NPinfo", stat);
}
}
function procIcecast(_s) {
var _local6 = false;
var _local5;
var _local3;
var _local2 = new Object();
var _local7 = _s.toString();
if (_local7.substr(0, 8) == ":ICECAST") {
_local5 = _local7.split(newline);
var _local4 = 2;
while (_local4 < _local5.length) {
if ((_local5[_local4].substr(0, 1) != ":") && (_local5[_local4].length > 20)) {
_local3 = _local5[_local4].split("|", 8);
_local2.title = _local3[5];
_local2.bitrate = (_local3[6] + "kbps") + ((_local3[7] != "") ? ((" / " + _local3[7]) + "Hz") : "");
_local2.UID = _local3[0];
_local2.maxlisteners = _local3[4];
_local2.peaklisteners = parseInt(_local3[3], 10);
_local2.currlisteners = parseInt(_local3[2], 10);
if (_local2.UID == _strMount) {
stat = _local2;
broadcastMessage("NPinfo", _local2);
_local6 = true;
}
}
_local4++;
}
} else {
extendedReporting.xtrace("510:Invalid Icecast2 nowplaying page content");
}
if (!_local6) {
broadcastMessage("badSTATUS", strURL);
isValid = false;
}
}
function str_replace(_s, _r, _t) {
var _local1 = _t.split(_s);
return(_local1.join(_r));
}
function urlDecode(_u) {
_u = str_replace("%20", " ", _u);
_u = str_replace("%26", "&", _u);
_u = str_replace("%3D", "=", _u);
_u = str_replace("%22", "\"", _u);
return(_u);
}
var _isIcecast = false;
var isValid = true;
var _isDefined = false;
var retries = 0;
}
Symbol 36 MovieClip [__Packages.FMPMountData] Frame 0
class FMPMountData
{
var _uid, _songTitle, _streamURL, _currList, _peakList, _maxList, _bitrate;
function FMPMountData (_uid, _title, _u, _cl, _pl, _ml, _br) {
this._uid = _uid;
_songTitle = _title;
_streamURL = _u;
_currList = _cl;
_peakList = _pl;
_maxList = _ml;
_bitrate = _br;
}
function get uid() {
return(_uid);
}
function get songTitle() {
return(_songTitle);
}
function get streamURL() {
return(_streamURL);
}
function get cL() {
return(_currList);
}
function get pL() {
return(_peakList);
}
function get mL() {
return(_maxList);
}
function get bitrate() {
return(_bitrate);
}
function set uid(_s) {
_uid = _s;
//return(uid);
}
function set songTitle(_s) {
_songTitle = _s;
//return(songTitle);
}
function set streamURL(_s) {
_streamURL = _s;
//return(streamURL);
}
function set cL(_n) {
_currList = _n;
//return(cL);
}
function set pL(_n) {
_peakList = _n;
//return(pL);
}
function set mL(_s) {
_maxList = _s;
//return(mL);
}
function set bitrate(_s) {
_bitrate = _s;
//return(bitrate);
}
}