home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2003 April
/
Chip_2003-04_cd1.bin
/
zkuste
/
wmakeup
/
download
/
Tierce.wmz
/
tierce.js
< prev
next >
Wrap
Text File
|
2002-12-03
|
5KB
|
187 lines
// script cobbled together from bits of other people's skin code with my changes and ammendments
// it's ok! - I know it yours!
var vidplay=false;
var eqopen=false;
var plopen=false;
var visopen=false;
function init() {
text_upd();
vis_bg.visible=false;
trk_bg2.visible=false;
viseffects.visible=false;
visfg.visible=false;
if (player.controls.isAvailable("Pause")) {
time.visible=true;
} else {
time.visible=false;
}
vidplay=(player.OpenState == osMediaOpen) && (player.currentMedia.ImageSourceWidth>0);
vidplay ? vid_start() : vid_end();
if (!player.controls.isAvailable("Stop")) { vid_end(); }
}
function state_change() {
text_upd();
vidplay=(player.OpenState == osMediaOpen) && (player.currentMedia.ImageSourceWidth>0);
if (!player.controls.isAvailable("Stop")) { vid_end(); }
vidplay ? vid_start() : vid_end();
}
function toggle_vis() {
if (vis_bg.visible) {
vis_bg.visible=false;
trk_bg2.visible=false;
viseffects.visible=false;
visfg.visible=false;
} else {
vis_bg.visible=true;
trk_bg2.visible=true;
viseffects.visible=true;
visfg.visible=true;
}
}
function toggle_time() {
if (player.controls.isAvailable("Pause")) {
time.visible=true;
} else {
time.visible=false;
}
}
function openeq() {
if (eqopen) {
theme.closeView('body_eq');
eqopen=false;
} else {
theme.openView('body_eq');
eqopen=true;
}
}
function openpl() {
if (plopen) {
theme.closeView('body_pl');
plopen=false;
} else {
theme.openView('body_pl');
plopen=true;
}
}
function vol_dn() {
volumeSet = player.settings.volume;
if (volumeSet > 7) {
volup.enabled=true;
voldn.enabled=true;
volumeSet-=7;
} else {
volup.enabled=true;
voldn.enabled=false;
volumeSet=0;
}
player.settings.volume = volumeSet;
player.settings.mute = false;
}
function vol_up() {
volumeSet = player.settings.volume;
if (volumeSet < 93) {
volup.enabled=true;
voldn.enabled=true;
volumeSet+=7;
} else {
volup.enabled=false;
voldn.enabled=true;
volumeSet=100;
}
player.settings.volume = volumeSet;
player.settings.mute = false;
}
function chkDecVol() {
return !(player.settings.volume == 0);
}
function chkIncVol() {
return !(player.settings.volume == 100);
}
function vid_check() {
return (player.OpenState == osMediaOpen) && (player.currentMedia.ImageSourceWidth>0);
}
function vid_start() {
vidplay=true;
viseffects.visible=false;
theme.openview('body_video');
}
function vid_end() {
vidplay=false;
}
function text_upd(){
metadata.value = " ";
artistname = player.currentmedia.getiteminfo("#author");
if (artistname == "") { artistname = player.currentmedia.getiteminfo("author"); }
if (artistname != "") { artistname += " - "; }
rate = player.currentmedia.getiteminfo("#bitrate").substring(0,player.currentmedia.getiteminfo("#bitrate").length-3);
if (rate == "") { rate = player.currentmedia.getiteminfo("bitrate").substring(0,player.currentmedia.getiteminfo("bitrate").length-3); }
rate += (rate) ? " kbps" : " ñ";
metadata.value += artistname;
metadata.value += player.currentmedia.name;
if (rate != "") {
metadata.value += " - ";
metadata.value += rate;
}
metadata.value += " ";
metadata.scrolling = (metadata.textWidth>metadata.width);
}
// 'borrowed' from the winamp converter .js and xml
function OnLoadVideo() {
SnapToVideo();
}
function AllowResizeVideo() {
mediacenter.videoStretchToFit=true;
mediacenter.videoShrinkToFit=true;
return;
}
function ZoomVideo() {
g_fUserHasSized = true;
mediacenter.videoStretchToFit = false;
mediacenter.videoShrinkToFit = false;
if( mediacenter.videoZoom < 51 ) {
mediacenter.videoZoom = 100;
} else if( mediacenter.videoZoom < 101 ) {
mediacenter.videoZoom = 200;
} else {
mediacenter.videoZoom = 50;
}
SnapToVideo();
}
function SnapToVideo() {
if( (!g_fUserHasSized && mediacenter.videoStretchToFit) || !mediacenter.videoStretchToFit) {
var zoom = mediacenter.videoStretchToFit ? 100 : mediacenter.videoZoom;
var x = (player.currentMedia.imageSourceWidth * (zoom / 100.0));
var y = (player.currentMedia.imageSourceHeight * (zoom / 100.0));
g_fExpectingSizeChange = true;
view.width = x + 16;
view.height = y + 113;
g_fExpectingSizeChange = false;
} else {
view.height= player.currentMedia.imageSourceHeight + 113;
view.width= player.currentMedia.imageSourceWidth + 16;
}
vidinfo.value = "Zoom: " + mediacenter.videoZoom + "%";
}
function OnCloseVideo() {
body_video.close();
}