home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hentai 69
/
HENTAI69.iso
/
Extra
/
MPSetup.exe
/
1033
/
RCDATA
/
CABINET
/
wmploc.DLL
/
256
/
MEDIAINFO.JS
< prev
next >
Wrap
Text File
|
2002-12-14
|
9KB
|
432 lines
// Windows Media Player - Copyright 2000 Microsoft Corporation.
//<script>
// See MediaInfo.xls in SD for table of states
var mtNone = 0;
var mtCD = 1;
var mtDVD = 2;
var mtAudio = 3;
var mtOther = 4;
var g_MediaType = mtNone;
var lnkNone = 0;
var lnkFindAlbumInfo = 1;
var lnkFindDVDInfo = 2;
var lnkDVDInfo = 3;
var lnkBuyCD = 4;
var lnkBuyDVD = 5;
var lnkBuyTickets = 6;
var g_rgLinkText = new Array(
0,
1452,
1454,
1456,
1458,
1460,
1462
);
var g_rgLinkTooltip = new Array(
0,
1453,
1455,
1457,
1459,
1461,
1463
);
var g_Link1 = lnkNone;
var g_Link2 = lnkNone;
var artNone = 0;
var artAlbum = 1;
var artDVD = 2;
var g_Art = artNone;
var LRDetails = 1;
var LREdit = 2;
var LRBuyNow = 4;
var LRBuyTickets = 8;
function OnLoad()
{
svCoverArt.left=(vMediaInfo.width-svCoverArt.width)/2;
svCoverArt.horizontalAlignment="center"
txtAux.top=svCoverArt.top+svCoverArt.height+4;
Refresh();
}
function OnStateChange(NewState)
{
if(osMediaOpen==NewState)
{
Refresh();
}
}
function OnCurrentItemChange()
{
if((osPlaylistOpenNoMedia==player.openState)&&(psReady==player.playState))
{
Refresh();
}
}
function OnMediaChange(Item)
{
if( player.currentMedia && player.currentMedia.isIdentical( Item ) )
{
Refresh();
}
}
function OnPlaylistChange(Playlist,change)
{
if( player.currentPlaylist.isIdentical( Playlist ) || (8 == change) )
{
Refresh();
}
}
function OnCurrentMediaItemAvailable(bstrItemName)
{
if( ( (bstrItemName == "WMPImage_AlbumArtLarge") || (bstrItemName == "WMPImage_AlbumArtSmall") ) &&
(osMediaOpen==player.openState) )
{
Refresh();
}
}
function OnClickLink1()
{
OnClickLink(g_Link1);
}
function OnClickLink2()
{
OnClickLink(g_Link2);
}
function OnClickLink( Link )
{
switch( Link )
{
case lnkFindAlbumInfo:
case lnkFindDVDInfo:
helper.linkRequest=LREdit;
break;
case lnkDVDInfo:
helper.linkRequest=LRDetails;
break;
case lnkBuyCD:
case lnkBuyDVD:
helper.linkRequest=LRBuyNow;
break;
case lnkBuyTickets:
helper.linkRequest=LRBuyTickets;
break;
}
}
function OnClickCoverArt()
{
if( g_Art != artNone )
{
helper.linkRequest=LRDetails;
}
}
function Refresh()
{
g_MediaType = GetMediaType();
switch( g_MediaType )
{
case mtNone:
RefreshNone();
break;
case mtCD:
RefreshCD();
break;
case mtDVD:
RefreshDVD();
break;
case mtAudio:
RefreshAudio();
break;
case mtOther:
RefreshOther();
break;
}
svCoverArt.backgroundImage = "";
svCoverArt.backgroundImage = GetCoverImage();
}
function RefreshNone()
{
g_Link1 = lnkNone;
g_Link2 = lnkNone;
UpdateLinks();
g_Art = artNone;
UpdateArt();
txtAux.value="";
}
function RefreshCD()
{
var sAux = "";
var nLAvailable = 0;
nLAvailable = helper.linkAvailable;
g_Link1 = ( ( 0 != ( nLAvailable & LRBuyNow ) )? lnkBuyCD : lnkNone );
g_Link2 = ( ( 0 != ( nLAvailable & LRBuyTickets ) )? lnkBuyTickets : lnkNone );
if( ( g_Link1 == lnkNone ) && ( g_Link2 == lnkNone ) )
{
g_Link1 = lnkFindAlbumInfo;
}
UpdateLinks();
g_Art = artAlbum;
UpdateArt();
sAux=player.currentPlaylist.getItemInfo("Name");
if( "" == sAux )
{
sAux= theme.loadString("res://wmploc/RT_STRING/#917");
}
txtAux.value=sAux;
}
function RefreshDVD()
{
var sAux = "";
var nLAvailable = 0;
var rootPlaylist = helper.getRootPlaylist( player.currentPlaylist );
if( null != rootPlaylist )
{
sAux=rootPlaylist.getItemInfo("Name");
}
if( "" == sAux )
{
sAux= theme.loadString("res://wmploc/RT_STRING/#950");
}
var fFound = false;
if( sAux != theme.loadString("res://wmploc/RT_STRING/#950") )
{
fFound = true;
}
nLAvailable = helper.linkAvailable;
g_Link1 = ( ( 0 != ( nLAvailable & LRBuyNow ) )? lnkBuyDVD : lnkNone );
g_Link2 = ( ( 0 != ( nLAvailable & LRBuyTickets ) )? lnkBuyTickets : lnkNone );
if( ( g_Link1 == lnkNone ) && ( g_Link2 == lnkNone ) )
{
if( fFound )
{
g_Link1 = lnkDVDInfo;
}
else
{
g_Link1 = lnkFindDVDInfo;
}
}
UpdateLinks();
g_Art = artDVD;
UpdateArt();
txtAux.value=sAux;
}
function RefreshAudio()
{
var nLAvailable = 0;
nLAvailable = helper.linkAvailable;
g_Link1 = ( ( 0 != ( nLAvailable & LRBuyNow ) )? lnkBuyCD : lnkNone );
g_Link2 = ( ( 0 != ( nLAvailable & LRBuyTickets ) )? lnkBuyTickets : lnkNone );
if( ( g_Link1 == lnkNone ) && ( g_Link2 == lnkNone ) )
{
g_Link1 = lnkFindAlbumInfo;
}
UpdateLinks();
g_Art = artAlbum;
UpdateArt();
txtAux.value=player.currentMedia.getItemInfo("Album");
}
function RefreshOther()
{
g_Link1 = lnkNone;
g_Link2 = lnkNone;
UpdateLinks();
g_Art = artNone;
UpdateArt();
txtAux.value=player.currentMedia.getItemInfo("Title");
}
function UpdateLinks()
{
txtLink1.value = "res://wmploc.dll/RT_STRING/#" + g_rgLinkText[ g_Link1 ].toString();
txtLink1.tooltip = "res://wmploc.dll/RT_STRING/#" + g_rgLinkTooltip[ g_Link1 ].toString();
txtLink2.value = "res://wmploc.dll/RT_STRING/#" + g_rgLinkText[ g_Link2 ].toString();
txtLink2.tooltip = "res://wmploc.dll/RT_STRING/#" + g_rgLinkTooltip[ g_Link2 ].toString();
txtLink1.horizontalAlignment = "left";
txtLink2.horizontalAlignment = "left";
if( lnkNone != g_Link1 && lnkNone != g_Link2 )
{
txtLink1.width = svLinkBar.width / 2;
txtLink2.left = txtLink1.width;
txtLink2.width = txtLink1.width;
txtLink1.horizontalAlignment = "left";
txtLink2.horizontalAlignment = "right";
}
else if( lnkNone != g_Link1 )
{
txtLink1.width = svLinkBar.width;
txtLink1.horizontalAlignment = "stretch";
}
else if( lnkNone != g_Link2 )
{
txtLink2.left = 0;
txtLink2.width = svLinkBar.width;
txtLink2.horizontalAlignment = "stretch";
}
txtLink1.visible = ( lnkNone != g_Link1 );
txtLink2.visible = ( lnkNone != g_Link2 );
txtLink1.accName = txtLink1.value;
txtLink2.accName = txtLink2.value;
}
function OnLinkBarResize()
{
if( lnkNone != g_Link1 && lnkNone != g_Link2 )
{
txtLink2.horizontalAlignment = "left";
txtLink1.width = svLinkBar.width / 2;
txtLink2.left = txtLink1.width;
txtLink2.width = txtLink1.width;
txtLink2.horizontalAlignment = "right";
}
}
function UpdateArt()
{
switch( g_Art )
{
case artNone:
btnCoverArtClick.cursor = "system";
btnCoverArtClick.tabStop = "false";
btnCoverArtClick.upTooltip = "";
break;
case artAlbum:
btnCoverArtClick.cursor = "hand";
btnCoverArtClick.tabStop = "true";
btnCoverArtClick.upTooltip = "res://wmploc.dll/RT_STRING/#1450";
break;
case artDVD:
btnCoverArtClick.cursor = "hand";
btnCoverArtClick.tabStop = "true";
btnCoverArtClick.upTooltip = "res://wmploc.dll/RT_STRING/#1451";
break;
}
btnCoverArtClick.accName = btnCoverArtClick.upTooltip;
}
function OpenMedia()
{
return( ( null != player.currentMedia ) );
}
function GetMediaType()
{
if( !OpenMedia() )
{
return( mtNone );
}
if ( (player.currentPlaylist.count>0) )
{
var sURL = player.currentPlaylist.item(0).sourceURL;
if(sURL.indexOf("wmpdvd:")==0)
{
return( mtDVD );
}
if(sURL.indexOf("wmpcd:")==0)
{
return( mtCD );
}
}
var sType = player.currentMedia.getItemInfo("FileType").toUpperCase();
if( ( "WMA" == sType ) || ( "MP3" == sType ) )
{
return( mtAudio );
}
return( mtOther );
}
function GetCoverImage()
{
if( !OpenMedia() )
{
return( "res://wmploc.dll/RT_BITMAP/#" + helper.getCurrentArtID( true ).toString() );
}
return( "WMPImage_AlbumArtLarge" );
}
function DoACCKeyPress(keyCode, dofunction)
{
if ( (keyCode==32) || (keyCode==13) )
{
dofunction();
}
}