home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2003 January
/
ChipCD_1.03.iso
/
zkuste
/
wmakeup
/
download
/
Erektorset.wmz
/
ErectorSet.js
< prev
next >
Wrap
Text File
|
2000-05-03
|
5KB
|
240 lines
var noPane = 0;
var eqPane = 1;
var plPane = 2;
var vidPane = 3;
var currentPane = 0;
var plClosedPos =-40;
var plOpenedPos = 0;
var plistIsOpen = false;
var plIsOpen = false;
var speed = 120;
var vidIsRunning = false;
function OnTimerTick()
{
var mm = ((seek.value < 600) ? "0" : "")
+ Math.floor(seek.value / 60);
var ss = ((seek.value%60) < 10 ? "0" : "")
+ Math.floor(seek.value % 60);
metadataTime.value = mm + ":" + ss;
}
function Init() {
vidIsRunning = (player.currentMedia.ImageSourceWidth > 0);
if (player.currentMedia.ImageSourceWidth > 0) {
StartVideo();
} else {
EndVideo();
}
}
function OnOpenStateChange()
{
vidIsRunning = (player.currentMedia.ImageSourceWidth > 0);
if(player.OpenState == osMediaOpen)
{
metadataArtist.value = player.currentmedia.getiteminfo("Author");
if (vidIsRunning) {
StartVideo();
} else {
EndVideo();
}
// makes bClose show up when switching from video to audio
}
}
function OnPlayStateChange()
{
vidIsRunning = (player.currentMedia.ImageSourceWidth > 0);
switch(player.PlayState)
{
case psStopped:
visEffects.visible = false;
// intentional fallthrough
case psPaused:
bgPlay.tabStop = true;
bPause.visible = false;
bPause.upToolTip = "Play";
break;
case psPlaying:
metadataArtist.value = player.currentmedia.getiteminfo("Author");
if (vidIsRunning) {
StartVideo();
} else {
EndVideo();
}
bgPlay.tabStop = false;
bPause.visible = true;
bPause.upToolTip = "Pause";
break;
}
}
/*
function SetVisibility(newPane)
{
bClose.enabled = !vidIsRunning;
switch(newPane)
{
case noPane:
sBalloon.visible = sAudio.visible =
pl.visible = vid.visible = false;
break;
case eqPane:
sBalloon.visible = sAudio.visible = true;
pl.visible = vid.visible = false;
break;
case plPane:
sBalloon.visible = pl.visible = true;
sAudio.visible = vid.visible = false;
break;
case vidPane:
sBalloon.visible = vid.visible = true;
sAudio.visible = pl.visible = false;
break;
}
currentPane = newPane;
}
function TogglePl()
{
if(currentPane == plPane)
{
SetVisibility(vidIsRunning ? vidPane : noPane);
}
else
{
SetVisibility(plPane);
}
}
function ToggleAudio()
{
if(currentPane == eqPane)
{
SetVisibility(vidIsRunning ? vidPane : noPane);
}
else
{
SetVisibility(eqPane);
}
}
function StartVideo()
{
vidIsRunning = true;
SetVisibility(vidPane);
}
function EndVideo()
{
vidIsRunning = false;
if(currentPane == vidPane)
{
SetVisibility(noPane);
}
}*/
function AdjustEQ()
{
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;
}
/*
function OnPlayStateChange()
{
switch(player.PlayState)
{
case psStopped:
visEffects.visible = false;
// intentional fallthrough
case psPaused:
bgPlay.tabStop = true;
bPause.visible = false;
bPause.upToolTip = "Play";
break;
case psPlaying:
metadataArtist.value =
player.currentmedia.getiteminfo("Author");
visEffects.visible = !vidIsRunning;
bgPlay.tabStop = false;
bPause.visible = true;
bPause.upToolTip = "Pause";
break;
}
}
*/
function ToggleView()
{
if(plIsOpen)
{
pl.visible = true;
pl.moveto(plClosedPos, 171, speed);
pl2.visible = true;
pl2.moveto(10, 200, speed);
}
else
{
pl.visible = true;
pl.moveto(plOpenedPos, 171, speed);
pl2.visible = true;
pl2.moveto(10, 176, speed);
}
plIsOpen = !plIsOpen;
}
function TogglePlist()
{
if(plistIsOpen)
{
plist.moveto(0, 0, speed);
plist.visible = false;
}
else
{
plist.visible = true;
plist.moveto(16, 34, speed);
vid.visible = false;
}
plistIsOpen = !plistIsOpen;
}
function StartVideo()
{
vid.visible = true;
visEffects.visible = false;
}
function EndVideo()
{
visEffects.visible = true;
vid.visible = false;
}