home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Plus! (NZ) 2000 October
/
PCWORLDPLUS_OCTO.BIN
/
review
/
wmp7.exe
/
RCDATA
/
CABINET
/
wmploc.DLL
/
256
/
142
< prev
next >
Wrap
Text (UTF-16)
|
2000-06-26
|
30KB
|
568 lines
// Windows Media Player - Copyright 2000 Microsoft Corporation.
var g_strPlayImage="";
var g_strPlayHover="";
var g_strPlayDown="";
var g_strPauseHover="";
var g_strPauseDown="";
var g_psPlayState=0;
var g_osOpenState=0;
var g_fIsLiveBroadcast=false;
var g_fShowingBuyMe=false;
function InitMiniControls()
{
g_strPlayImage="res://wmploc.dll/RT_BITMAP/#373";
g_strPlayHover="res://wmploc.dll/RT_BITMAP/#374";
g_strPlayDown="res://wmploc.dll/RT_BITMAP/#375";
g_strPauseUp="res://wmploc.dll/RT_BITMAP/#427";
g_strPauseHover="res://wmploc.dll/RT_BITMAP/#423";
g_strPauseDown="res://wmploc.dll/RT_BITMAP/#424";
player.settings.enableErrorDialogs = false;
OnOpenStateChangeTransport();
OnPlayStateChangeTransport();
OnStatusChangeTransport();
}
function InitControls()
{
g_strPlayImage="res://wmploc.dll/RT_BITMAP/#294";
g_strPlayHover="res://wmploc.dll/RT_BITMAP/#293";
g_strPlayDown="res://wmploc.dll/RT_BITMAP/#292";
g_strPauseUp="res://wmploc.dll/RT_BITMAP/#288";
g_strPauseHover="res://wmploc.dll/RT_BITMAP/#289";
g_strPauseDown="res://wmploc.dll/RT_BITMAP/#290";
OnOpenStateChangeTransport();
OnPlayStateChangeTransport();
OnStatusChangeTransport();
}
function InitBuyMe()
{
var BuyBMP = mediacenter.getNamedString("BuyMusicButton");
var BuyURL = mediacenter.getNamedString("BuyMusicURL");
if (BuyBMP != "" && BuyURL != "")
{
buyme.Image = 'BuyMusicButton';
g_fShowingBuyMe = true;
ShowBuyMe();
}
}
function ShowBuyMe()
{
if (g_fShowingBuyMe == true)
{
buyme.visible = (buyme.left > (bgSeekCtls.left + bgSeekCtls.width + 15));
}
}
function LaunchBuy()
{
var BuyURL = 'http://www.microsoft.com/isapi/redir.dll?Prd=windows&Sbp=MediaPlayer&Pver=7&ar=MediaBuy&Sba=' + mediacenter.getNamedString("BuyMusicURL");
player.launchURL( BuyURL );
}
function MetaDataObject( label, str, url, tooltip )
{
this.label = label;
this.str = str;
this.url = url;
this.tooltip = tooltip;
}
var g_sMetaDataItems= new Array( "play", "show", "clip", "author", "copyright", "drm" );
var g_sAudioLabels = new Array( "", "2070", "2071", "2072", "2076", "2078" );
var g_sVideoLabels = new Array( "", "2073", "2074", "2075", "2076", "2078" );
function GetItemInfo(obj, strItem)
{
var str;
str = obj.getItemInfo(strItem);
return (str)
}
function GetMetaData(itemIndex, data)
{
data.url = "";
data.tooltip = "";
if (player.currentMedia.imageSourceWidth > 0)
{
data.label = g_sVideoLabels[itemIndex];
}
else
{
data.label = g_sAudioLabels[itemIndex];
}
if ("" != data.label)
{
data.label = theme.loadString("res://wmploc.dll/RT_STRING/#" + data.label);
}
switch (itemIndex)
{
case 0:
data.str = player.status;
break;
case 1:
data.str = GetItemInfo(player.currentPlaylist, "title");
if ("" == data.str)
data.str = GetItemInfo(player.currentMedia, "Album");
data.url = GetItemInfo(player.currentPlaylist, "moreinforef");
data.tooltip = GetItemInfo(player.currentPlaylist, "abstract");
break;
case 2:
data.str = GetItemInfo(player.currentMedia, "title");
data.url = GetItemInfo(player.currentMedia, "moreinforef");
data.tooltip = GetItemInfo(player.currentMedia, "abstract");
break;
case 3:
data.str = GetItemInfo(player.currentMedia, "author");
break;
case 4:
data.str = GetItemInfo(player.currentMedia, "copyright");
break;
case 5:
data.str = "";
if ("true" == player.currentMedia.getItemInfo("Is_Protected"))
{
if ("true" == player.currentMedia.getItemInfo("Is_Trusted"))
{
data.str = player.currentMedia.getItemInfo("Signature_Name");
}
else
{
data.str = theme.loadString("res://wmploc.dll/RT_STRING/#2077");
data.label = "";
}
}
break;
}
}
function ShowMetaData(data)
{
if ("" != data.str)
{
if ("" != data.label)
{
var re;
re = /%s/i;
metadata.value = data.label.replace(re, data.str);
}
else
{
metadata.value = data.str;
}
metadata.tooltip = data.tooltip;
if ("" != data.url)
{
metadata.hoverFontStyle = "underline";
metadata.enabled = true;
}
else
{
metadata.hoverFontStyle = "normal";
metadata.enabled = false;
}
}
else
{
ShowStatus("");
}
}
function ShowStatus(sStr)
{
metadata.value = sStr;
metadata.hoverFontStyle = "normal";
metadata.tooltip = "";
metadata.enabled = false;
}
var g_iNextMetaDataIndex = 0;
var g_metaDataInfo = new MetaDataObject("", "", "", "");
function RotateMetaData()
{
for (i = 0; i < g_sMetaDataItems.length; i++)
{
GetMetaData(g_iNextMetaDataIndex, g_metaDataInfo);
g_iNextMetaDataIndex++;
if (g_iNextMetaDataIndex == g_sMetaDataItems.length)
g_iNextMetaDataIndex = 0;
if ("" != g_metaDataInfo.str)
{
ShowMetaData(g_metaDataInfo);
return;
}
}
ShowStatus("");
}
function ForceMetaData(itemIndex)
{
g_iNextMetaDataIndex = itemIndex;
GetMetaData(itemIndex, g_metaDataInfo);
ShowMetaData(g_metaDataInfo);
}
function OnClickMetaData()
{
if ("" != g_metaDataInfo.url)
player.launchURL(g_metaDataInfo.url);
}
function UpdateReceptionQuality()
{
var nReceptionQuality = player.network.receptionQuality;
if (nReceptionQuality > 0)
{
if(nReceptionQuality == 100)
{
QualityIcon.image = "res://wmploc.dll/RT_IMAGE/qbest.gif";
QualityIcon.upToolTip="res://wmploc.dll/RT_STRING/#2079";
}
else if(nReceptionQuality < 99 && nReceptionQuality > 86 )
{
QualityIcon.image = "res://wmploc.dll/RT_IMAGE/qOK.gif";
QualityIcon.upToolTip="res://wmploc.dll/RT_STRING/#2080";
}
else if(nReceptionQuality < 86 && nReceptionQuality > 0 )
{
QualityIcon.image = "res://wmploc.dll/RT_IMAGE/qbad.gif";
QualityIcon.upToolTip="res://wmploc.dll/RT_STRING/#2081";
}
QualityIcon.visible=true;
}
else
{
QualityIcon.image = "res://wmploc.dll/RT_IMAGE/qbest.gif";
QualityIcon.upToolTip="";
QualityIcon.visible=true;
}
}
function OnTimerTransport()
{
if (osMediaOpen != g_osOpenState)
return;
switch(g_psPlayState)
{
case psPlaying:
UpdateReceptionQuality();
RotateMetaData();
break;
}
}
function OnStatusChangeTransport()
{
ShowStatus(player.status);
}
function OnBufferingChangeTransport()
{
var nProgress = player.network.bufferingprogress;
if ((nProgress > 0) && (nProgress < 100))
{
ShowStatus(player.status);
QualityIcon.image = "res://wmploc.dll/RT_IMAGE/buffering.gif";
QualityIcon.upToolTip="";
}
}
function OnDisconnectTransport()
{
ShowStatus(theme.loadString("res://wmploc.dll/RT_STRING/#2063"));
}
function playOnClick()
{
if (player.PlayState == psPlaying)
{
player.controls.pause();
}
else
{
player.controls.play();
}
}
function OnFFWD()
{
if (player.PlayState == psScanForward)
{
player.controls.play();
}
else
{
player.controls.FastForward();
}
}
function OnREW()
{
if (player.PlayState == psScanReverse)
{
player.controls.play();
}
else
{
player.controls.FastReverse();
}
}
function volumeOnChange()
{
player.settings.mute=false;
}
function muteOnClick()
{
player.settings.mute = (player.settings.mute == true) ? false : true;
}
function OnPlayStateChangeTransport()
{
g_psPlayState = player.PlayState;
switch (g_psPlayState)
{
case psUndefined:
QualityIcon.visible=false;
QualityIcon.upToolTip = "";
tracktime.visible=false;
seek.foregroundProgress = 0;
play.image=g_strPlayImage;
play.disabledImage=g_strPlayImage;
play.hoverImage=g_strPlayHover;
play.downImage=g_strPlayDown;
play.upToolTip="res://wmploc.dll/RT_STRING/#1800";
play.enabled=false;
rew.down=false;
ffwd.down=false;
break;
case psTransitioning:
tracktime.visible=false;
play.image=g_strPlayImage;
play.disabledImage=g_strPlayImage;
play.hoverImage=g_strPlayHover;
play.downImage=g_strPlayDown;
play.upToolTip="res://wmploc.dll/RT_STRING/#1800";
play.enabled=false;
rew.down=false;
ffwd.down=false;
break;
case psReady:
QualityIcon.visible=false;
QualityIcon.upToolTip = "";
tracktime.visible=false;
seek.foregroundProgress = 0;
play.image=g_strPlayImage;
play.disabledImage=g_strPlayImage;
play.hoverImage=g_strPlayHover;
play.downImage=g_strPlayDown;
play.upToolTip="res://wmploc.dll/RT_STRING/#1800";
play.enabled=true;
rew.down=false;
ffwd.down=false;
break;
case psStopped:
QualityIcon.visible=true;
QualityIcon.image = "res://wmploc.dll/RT_IMAGE/stopped.gif";
QualityIcon.upToolTip = "";
play.image=g_strPlayImage;
play.disabledImage=g_strPlayImage;
play.hoverImage=g_strPlayHover;
play.downImage=g_strPlayDown;
play.upToolTip="res://wmploc.dll/RT_STRING/#1800";
play.enabled=true;
ffwd.down=false;
rew.down=false;
break;
case psPaused:
QualityIcon.visible=true;
QualityIcon.image = "res://wmploc.dll/RT_IMAGE/paused.gif";
QualityIcon.upToolTip = "";
play.image=g_strPlayImage;
play.disabledImage=g_strPlayImage;
play.hoverImage=g_strPlayHover;
play.downImage=g_strPlayDown;
play.upToolTip="res://wmploc.dll/RT_STRING/#1800";
play.enabled=true;
ffwd.down=false;
rew.down=false;
break;
case psPlaying:
ForceMetaData(0);
UpdateReceptionQuality();
tracktime.visible=true;
play.image=g_strPauseUp;
play.disabledImage=g_strPauseUp;
play.hoverImage=g_strPauseHover;
play.downImage=g_strPauseDown;
play.upToolTip="res://wmploc.dll/RT_STRING/#1801";
play.enabled=!g_fIsLiveBroadcast;
ffwd.down=false;
rew.down=false;
break;
case psWaiting:
UpdateReceptionQuality();
play.Image=g_strPauseUp;
play.disabledImage=g_strPauseUp;
play.hoverImage=g_strPauseHover;
play.downImage=g_strPauseDown;
play.upToolTip="res://wmploc.dll/RT_STRING/#1801";
play.enabled=!g_fIsLiveBroadcast;
rew.down=false;
ffwd.down=false;
break;
case psScanForward:
UpdateReceptionQuality();
play.Image=g_strPlayImage;
play.hoverImage=g_strPlayHover;
play.disabledImage=g_strPlayImage;
play.downImage=g_strPlayDown;
play.upToolTip="res://wmploc.dll/RT_STRING/#1800";
play.enabled=true;
rew.down=false;
ffwd.down=true;
break;
case psScanReverse:
UpdateReceptionQuality();
play.Image=g_strPlayImage;
play.hoverImage=g_strPlayHover;
play.disabledImage=g_strPlayImage;
play.downImage=g_strPlayDown;
play.upToolTip="res://wmploc.dll/RT_STRING/#1800";
play.enabled=true;
rew.down=true;
ffwd.down=false;
break;
case psBuffering:
play.image=g_strPlayImage;
play.disabledImage=g_strPlayImage;
play.hoverImage=g_strPlayHover;
play.downImage=g_strPlayDown;
play.upToolTip="res://wmploc.dll/RT_STRING/#1800";
play.enabled=true;
QualityIcon.image = "res://wmploc.dll/RT_IMAGE/buffering.gif";
QualityIcon.upToolTip="";
break;
}
}
function OnOpenStateChangeTransport()
{
var temp, str, strType;
g_osOpenState = player.OpenState;
switch (g_osOpenState)
{
case osUndefined:
tracktime.visible=false;
g_fIsLiveBroadcast=false;
break;
case osPlaylistChanging:
break;
case osPlaylistLocating:
break;
case osPlaylistConnecting:
break;
case osPlaylistLoading:
break;
case osPlaylistOpening:
break;
case osPlaylistOpenNoMedia:
break;
case osPlaylistChanged:
break;
case osMediaChanging:
QualityIcon.visible = false;
break;
case osMediaLocating:
QualityIcon.visible=true;
QualityIcon.image = "res://wmploc.dll/RT_IMAGE/locating.gif";
QualityIcon.upToolTip="";
break;
case osMediaConnecting:
QualityIcon.visible=true;
QualityIcon.image = "res://wmploc.dll/RT_IMAGE/locating.gif"; // uses same image as Locating
QualityIcon.upToolTip="";
break;
case osMediaLoading:
break;
case osMediaWaiting:
g_fIsLiveBroadcast = (player.currentMedia.getItemInfo("Type") == "broadcast");
seek.enabled = !g_fIsLiveBroadcast;
break;
case osMediaOpening:
QualityIcon.visible=true;
QualityIcon.image = "res://wmploc.dll/RT_IMAGE/opening.gif";
QualityIcon.upToolTip="";
break;
case osMediaOpen:
tracktime.visible=true;
g_fIsLiveBroadcast = (player.currentmedia.getiteminfo("Type") == "broadcast");
seek.enabled = !g_fIsLiveBroadcast;
break;
case osBeginLicenseAcquisition:
break;
case osEndLicenseAcquisition:
break;
case osBeginIndividualization:
break;
case osEndIndividualization:
break;
default:
break;
}
}