home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Minami 79
/
MINAMI79.iso
/
Extra
/
MPSetup.exe
/
1033
/
RCDATA
/
CABINET
/
wmploc.DLL
/
256
/
ALBUMART.JS
< prev
next >
Wrap
Text File
|
2002-12-14
|
3KB
|
181 lines
// Windows Media Player - Copyright 2000 Microsoft Corporation.
//<script>
var ART_NONE = 0;
var ART_LARGE = 1;
var ART_SMALL = 2;
var g_fBuyNow = false;
var g_ArtType = ART_NONE;
//
// Initialization
//
function InitAlbumArt()
{
//
// Note: btnCoverArt.image is also initialized .WMS file as LM
// doesn't like size changes on load!
//
SetAlbumArt( GetAlbumArtType(), true );
}
//
// Events
//
function OnSizeCheckTimer()
{
SetAlbumArt( GetAlbumArtType(), false );
}
function OnStateChange(NewState)
{
if(osMediaOpen==NewState)
{
SetAlbumArt( GetAlbumArtType(), true );
}
}
function OnCurrentItemChange()
{
if((osPlaylistOpenNoMedia==player.openState)&&(psReady==player.playState))
{
SetAlbumArt( GetAlbumArtType(), true );
}
}
function OnMediaChange(Item)
{
if( player.currentMedia && player.currentMedia.isIdentical( Item ) )
{
SetAlbumArt( GetAlbumArtType(), true );
}
}
function OnPlaylistChange(Playlist,change)
{
if( player.currentPlaylist.isIdentical( Playlist ) || (8 == change) )
{
SetAlbumArt( GetAlbumArtType(), true );
}
}
function OnCurrentMediaItemAvailable(bstrItemName)
{
if( ( (bstrItemName == "WMPImage_AlbumArtLarge") || (bstrItemName == "WMPImage_AlbumArtSmall") ) &&
(osMediaOpen==player.openState) )
{
SetAlbumArt( GetAlbumArtType(), true );
}
}
function OnCoverArtMouseOver()
{
if (g_fBuyNow)
{
btnCoverArt.cursor = "hand";
}
else
{
btnCoverArt.cursor = "system";
}
}
function OnClickCoverArt()
{
if (g_fBuyNow)
{
helper.linkRequest = 4;
}
}
function OnShowTitles()
{
UpdateTitles();
svAlbumArt.top = mediacenter.showTitles? 45 : 4;
svAlbumArt.height = AlbumArt.height - svAlbumArt.top;
}
//
// Utility
//
function StartSizeCheckTimer()
{
AlbumArt.timerInterval="1000";
}
function StopSizeCheckTimer()
{
AlbumArt.timerInterval="0";
}
function GetAlbumArtType()
{
if (!player.currentMedia)
{
return( ART_NONE );
}
if( svAlbumArt.width < 200 || svAlbumArt.height < 200 )
{
return( ART_SMALL );
}
return( ART_LARGE );
}
function SetAlbumArt( ArtType, fForce )
{
if( fForce || ( ArtType != g_ArtType ) )
{
btnCoverArt.image = "";
btnCoverArt.image = GetImageString( ArtType );
if( ART_NONE == ArtType )
{
StopSizeCheckTimer();
}
if( ART_SMALL == ArtType )
{
StartSizeCheckTimer();
}
if( ART_LARGE == ArtType )
{
StartSizeCheckTimer();
}
g_ArtType = ArtType;
}
g_fBuyNow = ( 0 != ( helper.linkAvailable & 4 ) );
}
function GetImageString( ArtType )
{
if( ART_NONE == ArtType )
{
return( "" );
}
if( ART_SMALL == ArtType )
{
return( "WMPImage_AlbumArtSmall" );
}
return( "WMPImage_AlbumArtLarge" );
}
function UpdateTitles()
{
if (!player.currentMedia) return;
trackname.visible = mediacenter.showTitles;
playlistArtist.value = player.currentMedia.getItemInfo('artist');
trackname.value = player.currentMedia.name;
}