home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2002 September (Special)
/
Chip-Special_2002-09_Digitalni-Video.bin
/
servis
/
wm9
/
mpsetupXP.exe
/
RCDATA
/
CABINET
/
wmploc.DLL
/
256
/
222
< prev
next >
Wrap
Text File
|
2002-08-19
|
4KB
|
174 lines
//<script language="jscript">
function PlayingDVD()
{
return ( (player.currentPlaylist.count>0) && (player.currentPlaylist.item(0).sourceURL.indexOf("wmpdvd:")==0));
}
function SwitchToOnlinePaneIfNecessary()
{
if (PlayingDVD()) return;
if (player.isOnline) SwitchView("MetaDataView");
}
function oschange(NewState)
{
SwitchToOnlinePaneIfNecessary();
UpdateMetaDataTextControls();
}
var g_starringTxtFormat = theme.loadString("res://wmploc/RT_STRING/#2088");
var g_directorTxtFormat = theme.loadString("res://wmploc/RT_STRING/#2082");
var g_studioTxtFormat = theme.loadString("res://wmploc/RT_STRING/#2083");
var g_MPAAratingTxtFormat = theme.loadString("res://wmploc/RT_STRING/#2087");
var g_arrDVDData = new Array
(
'getFormattedData( "LeadPerformers", g_starringTxtFormat )',
'getFormattedData( "Director", g_directorTxtFormat )',
'getFormattedData( "Studio", g_studioTxtFormat )',
'getFormattedData( "MPAARating", g_MPAAratingTxtFormat )'
);
var g_genreTxtFormat = theme.loadString("res://wmploc/RT_STRING/#2165");
var g_labelTxtFormat = theme.loadString("res://wmploc/RT_STRING/#2166");
var g_lengthTxtFormat= theme.loadString("res://wmploc/RT_STRING/#2167");
var g_AMGratingTxtFormat= theme.loadString("res://wmploc/RT_STRING/#2168");
var g_arrAudioData = new Array
(
'getFormattedData( "Genre", g_genreTxtFormat )',
'getFormattedData( "Label", g_labelTxtFormat )',
'getDurationString()',
'getAMGRating()'
);
function getDurationString()
{
if (osMediaOpen != player.openState)
{
return "";
}
var totalDurationInSeconds = player.currentMedia.getItemInfo("TotalDuration");
if (totalDurationInSeconds == "")
{
return "";
}
var durationString = mediacenter.getDurationStringFromSeconds(totalDurationInSeconds);
durationString = durationString.sprintf(g_lengthTxtFormat, durationString);
return durationString;
}
function getAMGRating()
{
var AMGRating = player.currentMedia.getItemInfo("Rating");
if (AMGRating != "")
{
AMGRating = (parseInt(AMGRating)+1) / 2;
AMGRating = AMGRating.toString();
AMGRating = AMGRating.sprintf(g_AMGratingTxtFormat, AMGRating);
}
return AMGRating;
}
var g_dataArray=g_arrAudioData;
var g_moreInfoURL="";
var g_buyNowURL="";
function UpdateMetaDataTextControls()
{
if (player.openState==osMediaOpen)
{
if (PlayingDVD())
{
g_dataArray=g_arrDVDData;
}
else
{
g_dataArray=g_arrAudioData;
}
var metadatastring = "";
var temp="";
for (var index =0; index<4; index++)
{
temp = eval(g_dataArray[index]);
if (temp!="")
{
if (metadatastring!="")
{
metadatastring += "\r";
}
metadatastring += temp;
}
}
meta1.value = metadatastring;
g_moreInfoURL = player.currentMedia.getItemInfo("MoreInfo");
if (g_moreInfoURL!="")
{
moreTxt.visible=true;
}
else
{
moreTxt.visible=false;
}
g_buyNowURL = player.currentMedia.getItemInfo("BuyNow");
noInfoTxt.visible = ( (metadatastring=="") && (g_moreInfoURL=="") );
btnCoverArt.image="WMPImage_AlbumArtSmall";
}
}
function getFormattedData(dataname,formatstring)
{
rawvalue = player.currentMedia.getItemInfo(dataname);
if (rawvalue!="")
{
rawvalue = rawvalue.sprintf(formatstring, rawvalue);
}
return rawvalue;
}
function sprintf(str,s)
{
if (typeof(s)=="string")
{
var re;
re = /%s/i;
str = str.replace(re, s);
}
else
{
var index =1;
for (var replaceStrings in s)
{
var re;
re = eval("/%" + index + "/i");
str = str.replace(re, s[replaceStrings]);
index++;
}
}
return str;
}
String.prototype.sprintf = sprintf;