\n';
}
}
embedOutput += '';
}
} else {
var tableDims = ' WIDTH=' + panelW + ' HEIGHT=' + panelH + ' HSPACE=' + attribs.HSPACE + ' VSPACE=' + attribs.VSPACE + ((attribs.ALIGN != null) ? (' ALIGN=' + attribs.ALIGN) : 'LEFT');
if (Music.enabled && Music.clientSupported && Music.client.upgradable && (attribs.HIDDEN == null || attribs.HIDDEN.toUpperCase () != 'TRUE')) {
var
getPlayerText = (Music.hasPlayer ? 'Upgrade' : 'Obter') + ' Beatnik!',
getPlayerLink = ''
;
if (typeof (Music.getPlayerImagesPath) == 'string' && panelW == 144 && (panelH == 60 || panelH == 45 || panelH == 15)) {
embedOutput = getPlayerLink + '
';
} else {
if (panelW >= 90 && panelH >= 15) embedOutput = '
' + getPlayerLink + '' + getPlayerText + ' |
';
}
}
if (embedOutput == '')
embedOutput = ''
;
}
writeln (embedOutput);
}
}
attribs.VOLUME = attribs.VOLUME - 0;
}
}
function mo_stubEmbed (stubURL) {
this.magicEmbed (((typeof (stubURL) != 'string') ? '' : ('SRC="' + stubURL + '" ')) + 'WIDTH=2 HEIGHT=2 HIDDEN LOOP=TRUE');
}
function mo_preloadEmbed (fileURL,extraAttr) {
this.magicEmbed ('SRC="' + fileURL + '" WIDTH=2 HEIGHT=2 HIDDEN AUTOSTART=FALSE LOOP=FALSE ' + ((typeof (extraAttr) == 'string') ? extraAttr : ''));
}
function mo_getNoteName (noteNumber) {
var noteNames = new Array ('C','C#','D','D#','E','F','F#','G','G#','A','A#','B');
return noteNames [noteNumber % 12] + (Math.floor (noteNumber / 12) - 1) + '';
}
function mo_getNoteNumber (noteName) {
var
noteOffset = 'c-d-ef-g-a-b'.indexOf (noteName.charAt (0).toLowerCase ()),
result = 0,
sharpFlatOffset = 0
;
if (noteOffset != -1) {
var sharpFlatPos = noteName.indexOf ('b',1);
if (sharpFlatPos == -1) {
sharpFlatPos = noteName.indexOf ('#',1);
if (sharpFlatPos == -1) sharpFlatPos = 0; else sharpFlatOffset = 1;
} else {
sharpFlatOffset = -1;
}
var octaveNo = noteName.substring (sharpFlatPos + 1) - 0;
result = 12 + octaveNo * 12 + noteOffset + sharpFlatOffset;
}
return Math.floor (result);
}
function mo_Voice_free () {
with (this) {
clearTimeout (noteOffTimeout);
musicID.playerID.noteOff (channelNo,noteNo,127);
channelNo = 0;
}
}
function mo_Voice (musicID,channelNo,noteNo) {
/*** Constructor Variables ***/
this.musicID = musicID;
this.channelNo = channelNo;
this.noteNo = noteNo;
/*** Instance State Variables ***/
this.timeStamp = 0;
this.noteOffTimeout = setTimeout ('',0);
/*** Object's Exposed Methods ***/
this.free = mo_Voice_free;
}
function mo_disable () {
var methods = new Array ('doMenuItem','engageAudio','fadeTo','fadeVolume','getAutostart','getChannelMute','getChannelSolo','getController','getFileSize','getInfo','getLoop','getPanelDisplay','getPanelMode','getPlayLength','getPosition','getProgram','getReverbType','getTempo','getTrackMute','getTrackSolo','getTranspose','getTransposable','getVolume','isPaused','isPlaying','noteOff','noteOn','pause','play','playNote','setAutostart','setChannelMute','setChannelSolo','setController','setEndTime','setGlobalMute','setLoop','setPanelDisplay','setPanelMode','setPosition','setProgram','setReverbType','setStartTime','setTempo','setTrackMute','setTrackSolo','setTranspose','setTransposable','setVolume','stop');
for (var methodNo = 0; methodNo < methods.length; methodNo++)
this [methods [methodNo]] = mo_null
;
}
function mo_enableMethods () {
var args = mo_enableMethods.arguments;
for (var argNo = 0; argNo < args.length; argNo++)
this [args [argNo]] = window ['mo_' + args [argNo]]
;
}
function mo_addInstanceMethods () {
var args = mo_addInstanceMethods.arguments;
for (var argNo = 0; argNo < args.length; argNo++)
Music.prototype [args [argNo]] = window ['mo_' + args [argNo]]
;
}
function mo_addStaticMethods () {
var args = mo_addStaticMethods.arguments;
for (var argNo = 0; argNo < args.length; argNo++)
Music [args [argNo]] = window ['mo_' + args [argNo]]
;
}
function mo_kill () {
mo_stopAll ();
for (var instanceNo = 0; instanceNo < Music.instances.length; instanceNo++)
Music.instances [instanceNo].disable ()
;
}
/*** Functions Mapped Directly to the Player ***/
function mo_doMenuItem (menuItemName) {this.playerID.doMenuItem (menuItemName)}
function mo_engageAudio (audioState) {this.playerID.engageAudio (audioState)}
function mo_getAutostart () {return this.playerID.getAutostart ()}
function mo_getChannelMute (channelNo) {return this.playerID.getChannelMute (channelNo)}
function mo_getChannelSolo (channelNo) {return this.playerID.getChannelSolo (channelNo)}
function mo_getController (channelNo,controllerNo) {return this.playerID.getController (channelNo,controllerNo)}
function mo_getFileSize () {return this.playerID.getFileSize ()}
function mo_getInfo (infoField) {return this.playerID.getInfo (infoField)}
function mo_getLoop () {return this.playerID.getLoop ()}
function mo_getPanelDisplay () {return this.playerID.getPanelDisplay ()}
function mo_getPanelMode () {return this.playerID.getPanelMode ()}
function mo_getPlayLength () {return this.playerID.getPlayLength ()}
function mo_getPosition () {return this.playerID.getPosition ()}
function mo_getProgram (channelNo) {return this.playerID.getProgram (channelNo)}
function mo_getReverbType () {return this.playerID.getReverbType ()}
function mo_getTempo () {return this.playerID.getTempo ()}
function mo_getTrackMute (trackNo) {return this.playerID.getTrackMute (trackNo)}
function mo_getTrackSolo (trackNo) {return this.playerID.getTrackSolo (trackNo)}
function mo_getTranspose () {return this.playerID.getTranspose ()}
function mo_getTransposable (channelNo) {return this.playerID.getTransposable (channelNo)}
function mo_setAutostart (state) {this.playerID.setAutostart (state)}
function mo_setChannelMute (channelNo,state) {this.playerID.setChannelMute (channelNo,state)}
function mo_setChannelSolo (channelNo,state) {this.playerID.setChannelSolo (channelNo,state)}
function mo_setController (channelNo,controllerNo,controllerValue) {this.playerID.setController (channelNo,controllerNo,controllerValue)}
function mo_setEndTime (endTime) {this.playerID.setEndTime (endTime)}
function mo_setGlobalMute (muteState) {this.playerID.setGlobalMute (muteState)}
function mo_setLoop (state) {this.playerID.setLoop (state)}
function mo_setPanelDisplay (displayType) {this.playerID.setPanelDisplay (displayType)}
function mo_setPanelMode (panelMode) {this.playerID.setPanelMode (panelMode)}
function mo_setPosition (position) {this.playerID.setPosition (position)}
function mo_setReverbType (reverbType) {this.playerID.setReverbType (reverbType)}
function mo_setStartTime (startTime) {this.playerID.setStartTime (startTime)}
function mo_setTempo (tempo) {this.playerID.setTempo (tempo)}
function mo_setTrackMute (trackNo,state) {this.playerID.setTrackMute (trackNo,state)}
function mo_setTrackSolo (trackNo,state) {this.playerID.setTrackSolo (trackNo,state)}
function mo_setTranspose (transpose) {this.playerID.setTranspose (transpose)}
function mo_setTransposable (channelNo,state) {this.playerID.setTransposable (channelNo,state)}
/*** Music Object Class Definition ***/
function Music (objectName) {
this.objectName = objectName;
/*** Instance State Variables ***/
this.delayAutostart = false;
this.volFade_timeout = setTimeout ('',0);
this.volFade_step = 0;
this.volFade_time = 0;
this.volFade_timeElapsed = 0;
this.volFade_interval = 0;
this.volFade_fromVolume = 0;
this.volFade_volume = 0;
this.volFade_toVolume = 0;
this.volFade_endCallback = null;
this.volFade_inProgress = false;
this.volFade_restoreVolume = false;
this.monophonic = new Array (false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false);
this.ready = false;
this.playerID = null;
this.onLoadHandler = null;
this.onMetaEventHandler = null;
this.onPauseHandler = null;
this.onPlayHandler = null;
this.onStopHandler = null;
this.onReadyHandler = null;
/*** Method Configuration Methods ***/
this.disable = mo_disable;
this.enableMethods = mo_enableMethods;
/*** Initialisation ***/
this.disable ();
this.enableMethods ('enable','endVolumeFade','execHandlers','execOnMetaEvent','execOnPause','execOnPlay','execOnReady','execOnStop','execVolumeFade','getMonophonic','magicEmbed','onLoad','onMetaEvent','onPause','onPlay','onStop','preloadEmbed','onReady','setMonophonic','stubEmbed');
window [objectName] = this;
Music.instances [Music.instances.length] = this;
}
/*** Static Methods ***/
mo_addStaticMethods ('getNoteName','getNoteNumber','hasMinVersion','installPlayer','isPlayerCompatible','magicEmbed','promptClose','promptUser','stopAll');
/*** Static Properties ***/
Music.debugToJavaConsole = true;
Music.debugToAlert = false;
Music.debugToStatus = true;
Music.enabled = true;
Music.ignoreJavaDisabled = false;
Music.requiredMinVersion = '';
Music.showCompatibilityPrompt = true;
Music.silentIfInadequate = false;
/*** Static Read-only Properties ***/
Music.hasPlayer = false;
Music.playerType = '';
Music.playerVersion = '';
/*** Private Properties ***/
Music.absoluteMinVersion = '';
Music.framePrefix = '';
Music.bodyEventsAdded = false;
Music.globalNoteNo = 0;
Music.minFadeInterval = 100;
Music.storedHandlers = 0;
Music.hasCallbackIssue = false;
Music.instances = new Array ();
Music.polyphony = 32;
Music.voices = new Array ();
Music.newVoice = new mo_Voice (null,0,0);
for (mo_voiceNo = 0; mo_voiceNo < Music.polyphony; mo_voiceNo++)
Music.voices [mo_voiceNo] = new mo_Voice (null,0,0)
;
/*** Debug Handling ***/
function mo_debug (_message,_URL,_lineNo) {
var debugStr = '\n**** DEBUG MESSAGE ****\n ' + _message + ((typeof (_lineNo) == 'number') ? ('\n LINE# ' + _lineNo) : '') + '\n FILE: ' + ((typeof (_URL) != 'string') ? window.location.href : _URL) + '\n';
if (Music.debugToJavaConsole && typeof (java) != 'undefined') java.lang.System.out.println (debugStr);
if (Music.debugToAlert) alert (debugStr);
if (Music.debugToStatus) window.defaultStatus = debugStr;
return true;
}
function mo_enableDebug (windowHandle) {
windowHandle.onerror = mo_debug;
for (var frameNo = 0; frameNo < windowHandle.frames.length; frameNo++)
mo_enableDebug (windowHandle.frames [frameNo])
;
}
mo_enableDebug (top);
function mo_addEventHandler (windowHandle,objectID,eventType,handler) {
var storedHandlerStr = '';
if (typeof (objectID [eventType]) == 'function') {
if (typeof (windowHandle.mo_storedHandlers) == 'undefined') windowHandle.mo_storedHandlers = 0;
windowHandle.mo_storedHandlers++;
var storedHandler = 'mo_storedEventHandler' + mo_storedHandlers;
windowHandle [storedHandler] = objectID [eventType];
storedHandlerStr = '; return ' + storedHandler + ' (event)';
}
objectID [eventType] = windowHandle.eval ('new Function (\'event\',\'' + handler + storedHandlerStr + '\')');
}
function mo_SupportedClient (_name,_platform,_minVersion,_upgradable) {
this.name = _name;
this.platform = _platform;
this.minVersion = _minVersion;
this.upgradable = _upgradable;
}
Music.supportedClients = new Array (
new mo_SupportedClient ('Netscape','Win32','3.01',true),
new mo_SupportedClient ('Netscape','MacPPC','3.01',true),
new mo_SupportedClient ('Microsoft Internet Explorer','Win32','4.0',true),
new mo_SupportedClient ('WebTV Plus Receiver','WebTV','3.0',false),
new mo_SupportedClient ('WebTV Satellite Receiver','WebTV','3.0',false)
);
with (navigator) {
if (mo_stringHasAny (userAgent,'Win95','Windows 95','WinNT','Windows NT','Win98','Windows 98')) {
Music.platform = 'Win32';
} else if (userAgent.indexOf ('PPC') != -1) {
Music.platform = 'MacPPC';
} else if (userAgent.indexOf ('WebTV') != -1) {
Music.platform = 'WebTV';
} else {
Music.platform = (typeof (platform) == 'undefined') ? 'Unknown' : platform;
}
Music.clientVersion = mo_retrieveVersion (appVersion);
Music.clientSupported = false;
for (mo_clientNo = 0; mo_clientNo < Music.supportedClients.length; mo_clientNo++) {
Music.client = Music.supportedClients [mo_clientNo];
if (Music.client.name == appName && Music.client.platform == Music.platform && mo_meetsMinVersion (Music.clientVersion,Music.client.minVersion)) {
Music.clientSupported = true;
break;
}
}
if (Music.clientSupported) Music.playerType = (appName == 'Microsoft Internet Explorer') ? 'ActiveX' : 'Plug-in';
}
function mo_checkForPlayer () {
if (Music.clientSupported) {
if (Music.playerType == 'Plug-in') {
with (navigator) {
for (var pluginNo = 0; pluginNo < plugins.length; pluginNo++) {
if (plugins [pluginNo].name.indexOf ('Beatnik') != -1 && plugins [pluginNo].name.indexOf ('Stub') == -1) {
Music.playerVersion = mo_retrieveVersion (plugins [pluginNo].name);
if (Music.playerVersion == '') {
if (Music.platform == 'Mac') {
Music.playerVersion = '1.1.7';
} else if (Music.platform == 'WebTV') {
Music.playerVersion = '0.9.0';
}
}
Music.hasPlayer = true;
break;
}
}
Music.hasCallbackIssue = appName == 'Netscape' && mo_hasMinVersion ('1.3') && navigator.javaEnabled ();
}
} else {
document.writeln (
''
);
Music.hasPlayer = typeof (document.mo_testInstance.getVersion) != 'undefined';
if (Music.hasPlayer) Music.playerVersion = mo_retrieveVersion (document.mo_testInstance.getVersion ());
Music.hasCallbackIssue = true;
}
}
}
if (typeof (mo_delayPlayerCheck) == 'undefined') mo_checkForPlayer ();
Music.showCompatibilityPrompt = false; // cbm - 2/22/99
// -->
Beatnik Player da Beatnik, Inc.
Visite site da Web do Beatnik em
http://www.beatnik.com/
para obter mais informações,
ouvir ótimas músicas e ter acesso a entretenimento interativo!
©1999 Beatnik, Inc. Todos os direitos reservados