home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2004 June
/
Chip_2004-06_cd1.bin
/
opsys
/
wmakeup
/
downloads
/
UglyPlayerLama.wmz
/
lama.js
< prev
next >
Wrap
Text File
|
2004-04-09
|
8KB
|
323 lines
/*
⌐2001 MSC. edit: Ben Bosmans 2004
*/
var iBaseOffsetTop = 20;
var bEqualizerOpen = false;
var bPlaylistOpen = false;
var iDrawerClosedPos = 132+iBaseOffsetTop;
var iDrawerOpenedPos = iDrawerClosedPos + 200;
var bVideoPlaying = false;
var iScreenCtrlsSmallLeft = 321;
var iScreenCtrlsSmallTop = 152+iBaseOffsetTop;
var iVolumeSmallLeft = 520;
var iVolumeSmallTop = 137+iBaseOffsetTop;
var iVideoSmallLeft = 297;
var iVideoSmallTop = 192+iBaseOffsetTop;;
var iVideoSmallWidth = 157;
var iVideoSmallHeight = 80;
var iScreenCtrls320Left = 429;
var iScreenCtrls320Top = 10;
var iVolume320Left = 553
var iVolume320Top = 82;
var iVideo320Left = 228;
var iVideo320Top = 50;
var iVideo320Width = 320;
var iVideo320Height = 240;
var kPlaylist = 1;
var kEqualizer = 2;
var iLastOpenDrawer = kPlaylist;
var kVideoSmall = 1;
var kVideo320 = 2;
var iVideoMode = kVideoSmall;
var visClosedPos = 33;
var visOpenedPos = 59;
var visIsOpen = false;
var vidIsPlaying = false;
var speed = 120;
////////////////////////////////////////////////////////////////////////////////
function Init()
{
playlist.setColumnResizeMode( 0, "Stretches" );
playlist.setColumnResizeMode( 1, "AutoSizeData" );
Visualizer.currentEffectType = mediacenter.effectType;
Visualizer.currentPreset = mediacenter.effectPreset;
bVideoPlaying = (player.OpenState == osMediaOpen) &&
(player.currentMedia.ImageSourceWidth>0);
bVideoPlaying ? VideoStart() : VideoEnd();
}
////////////////////////////////////////////////////////////////////////////////
function OnClose()
{
mediacenter.effectType = Visualizer.currentEffectType;
mediacenter.effectPreset = Visualizer.currentPreset;
}
////////////////////////////////////////////////////////////////////////////////
function VideoStart()
{
bVideoPlaying = true;
Visualizer.visible = false;
btnAlbumArt.visible = false;
Video.visible = true;
}
////////////////////////////////////////////////////////////////////////////////
function VideoEnd()
{
bVideoPlaying = false;
btnAlbumArt.visible = false;
Video.visible = false;
Visualizer.visible = true;
}
////////////////////////////////////////////////////////////////////////////////
function DrawerToggle()
{
if( bEqualizerOpen || bPlaylistOpen )
{
DrawerClose();
}
else
{
if( iLastOpenDrawer==kEqualizer )
{
ToggleEqualizer();
}
else if( iLastOpenDrawer==kPlaylist )
{
TogglePlaylist();
}
}
}
////////////////////////////////////////////////////////////////////////////////
function DrawerClose()
{
if( bEqualizerOpen )
{
ToggleEqualizer();
iLastOpenDrawer = kEqualizer;
}
else if ( bPlaylistOpen )
{
TogglePlaylist();
iLastOpenDrawer = kPlaylist;
}
}
////////////////////////////////////////////////////////////////////////////////
function DrawerEndMove()
{
if( bEqualizerOpen )
{
}
else if( bPlaylistOpen )
{
playlist.visible = true;
}
}
////////////////////////////////////////////////////////////////////////////////
function ToggleEqualizer()
{
if( bEqualizerOpen )
{
btnEqualizerReset.visible = false;
txtEqualizerReset.visible = false;
btnDrawerClose.visible = false;
bEqualizerOpen = false;
svEqualizer.visible = false;
svDrawer.moveTo( svDrawer.left, iDrawerClosedPos, speed );
btnDrawerClose.upToolTip = "";
btnEqualizerToggle.upToolTip = xEqTt.toolTip;
btnDrawerToggle.upToolTip = xEqTt.toolTip;
}
else
{
DrawerClose();
bEqualizerOpen = true;
svEqualizer.visible = true;
btnEqualizerReset.visible = true;
txtEqualizerReset.visible = true;
btnDrawerClose.visible = true;
svDrawer.moveTo( svDrawer.left, iDrawerOpenedPos, speed );
btnDrawerClose.upToolTip = xEqTt.value;
btnEqualizerToggle.upToolTip = xEqTt.value;
btnDrawerToggle.upToolTip = xEqTt.value;
}
}
////////////////////////////////////////////////////////////////////////////////
function TogglePlaylist()
{
if( bPlaylistOpen )
{
btnDrawerClose.visible = false;
playlist.visible = false;
bPlaylistOpen = false;
svDrawer.moveTo( svDrawer.left, iDrawerClosedPos, speed );
btnDrawerClose.upToolTip = "";
btnPlaylistToggle.upToolTip = xPlTt.toolTip;
btnDrawerToggle.upToolTip = xPlTt.toolTip;
}
else
{
DrawerClose();
bPlaylistOpen = true;
btnDrawerClose.visible = true;
svDrawer.moveTo( svDrawer.left, iDrawerOpenedPos, speed );
btnDrawerClose.upToolTip = xPlTt.value;
btnPlaylistToggle.upToolTip = xPlTt.value;
btnDrawerToggle.upToolTip = xPlTt.value;
}
}
////////////////////////////////////////////////////////////////////////////////
function DisplayVisualizer()
{
btnAlbumArt.visible = false;
Video.visible = false;
Visualizer.visible = true;
}
////////////////////////////////////////////////////////////////////////////////
function DisplayAlbumArt()
{
Video.visible = false;
Visualizer.visible = false;
if( iVideoMode==kVideoSmall )
{
btnAlbumArt.image = "WMPImage_AlbumArtSmall";
}
else
{
btnAlbumArt.image = "WMPImage_AlbumArtLarge";
}
btnAlbumArt.visible = true;
}
////////////////////////////////////////////////////////////////////////////////
function PlaylistOnEndMove()
{
if( bPlaylistOpen )
playlist.visible = true;
}
////////////////////////////////////////////////////////////////////////////////
function EqOnEndMove()
{
sEqView.visible =
bEqClose.visible = eqIsOpen;
}
////////////////////////////////////////////////////////////////////////////////
function ShowVideoSmall()
{
sv320.visible = false;
svScreenCtrls.left = iScreenCtrlsSmallLeft;
svScreenCtrls.top = iScreenCtrlsSmallTop;
svVolume.left = iVolumeSmallLeft;
svVolume.top = iVolumeSmallTop;
svDisplay.left = iVideoSmallLeft;
svDisplay.top = iVideoSmallTop;
svDisplay.width = iVideoSmallWidth;
svDisplay.height = iVideoSmallHeight;
Video.width = iVideoSmallWidth;
Video.height = iVideoSmallHeight;
Visualizer.width = iVideoSmallWidth;
Visualizer.height = iVideoSmallHeight;
btnAlbumArt.width = iVideoSmallWidth;
btnAlbumArt.height = iVideoSmallHeight;
iVideoMode = kVideoSmall;
if( btnAlbumArt.visible )
DisplayAlbumArt();
}
////////////////////////////////////////////////////////////////////////////////
function ShowVideo320()
{
sv320.visible = true;
svScreenCtrls.left = iScreenCtrls320Left;
svScreenCtrls.top = iScreenCtrls320Top;
svVolume.left = iVolume320Left;
svVolume.top = iVolume320Top;
svDisplay.left = iVideo320Left;
svDisplay.top = iVideo320Top;
svDisplay.width = iVideo320Width;
svDisplay.height = iVideo320Height;
Video.width = iVideo320Width;
Video.height = iVideo320Height;
Visualizer.width = iVideo320Width;
Visualizer.height = iVideo320Height;
btnAlbumArt.width = iVideo320Width;
btnAlbumArt.height = iVideo320Height;
iVideoMode = kVideo320;
if( btnAlbumArt.visible )
DisplayAlbumArt();
}
////////////////////////////////////////////////////////////////////////////////
function AdjustAudio()
{
eq.gainLevel2 = (8*bass.value + treble.value)/9;
eq.gainLevel3 = (7*bass.value + 2*treble.value)/9;
eq.gainLevel4 = (6*bass.value + 3*treble.value)/9;
eq.gainLevel5 = (5*bass.value + 4*treble.value)/9;
eq.gainLevel6 = (4*bass.value + 5*treble.value)/9;
eq.gainLevel7 = (3*bass.value + 6*treble.value)/9;
eq.gainLevel8 = (2*bass.value + 7*treble.value)/9;
eq.gainLevel9 = ( bass.value + 8*treble.value)/9;
}
////////////////////////////////////////////////////////////////////////////////