home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2003 December
/
Chip_2003-12_cd1.bin
/
opsys
/
wmakeup
/
download
/
Halloween.wmz
/
wood.js
< prev
next >
Wrap
Text File
|
2003-10-04
|
12KB
|
586 lines
/*
http://www.theskinsfactory.com
info@theskinsfactory.com
Wood Skin
*/
var visStatus = true;
function toggleVis()
{
if(!visStatus)
{
visMask.alphaBlendTo(0,500);
visButton.down = false;
visStatus = !visStatus;
}
else
{
visMask.alphaBlendTo(255,500);
visButton.down = true;
visStatus = !visStatus;
}
}
function mainStartUp(){
volume.value = player.settings.volume;
loadMainPrefs();
theme.savePreference("vidViewer", "false");
checkPlayerState();
updateMetadata('status');
}
function checkPlayerState(){
if (player){
switch (player.playState){
case 2:
case 3: //playing
if(("false"==theme.loadPreference("vidViewer"))&&player.currentMedia.ImageSourceWidth>0){
theme.openView('videoView');
if("true"==theme.loadPreference("visViewer")){
theme.savePreference("visViewer", "false");
theme.closeView( "visView" );
}
}
if(!visStatus)
{
visMask.alphaBlendTo(255,500);
visButton.down = true;
}
break;
}
}
if (!player.controls.isAvailable("Stop")) {
visMask.alphaBlendTo(0,500);
time.value = "00:00";
visButton.down = false;
}
}
// metadata
function updateMetadata(type){
if("status"==type){
if(player.openState!=13) return;
var metaAuthor = player.currentMedia.getItemInfo("author");
if (metaAuthor != "") {
metaAuthor += " - ";
}
metadata.value = player.status;
if (metadata.value != "") {
metadata.value += " - ";
}
metadata.value += metaAuthor;
}else if("playlist"==type){
if(player.currentPlaylist.count==0) return;
var metaAuthor = player.currentMedia.getItemInfo("author");
if (metaAuthor != "") {
metaAuthor += " - ";
}
if(player.openState!=13){
metadata.value = metaAuthor;
}
}else{
metadata.value = player.status;
metadata.scrolling = (metadata.textWidth>metadata.width);
return;
}
metadata.value += player.currentmedia.name;
metadata.scrolling = (metadata.textWidth>metadata.width);
}
// button and hotkey definitions
// open file
function openFile()
{
var media = theme.openDialog('FILE_OPEN','FILES_ALLMEDIA');
if(media)
{
player.URL = media;
player.controls.play();
}
}
function viewHotKeys()
{
switch(event.keycode)
{
case 122:
case 90:
player.controls.previous();
break;
case 120:
case 88:
player.controls.play();
break;
case 99:
case 67:
player.controls.pause();
break;
case 118:
case 86:
player.controls.stop();
break;
case 98:
case 66:
player.controls.next();
break;
case 108:
case 76:
openFile();
break;
}
}
function viewResizer(event)
{
switch(event.keycode)
{
case 37:
view.width-=20;
break;
case 38:
view.height-=20
break;
case 39:
view.width+=20;
break;
case 40:
view.height+=20;
break;
}
}
function updateToolTip(id,button,tip)
{
if("true"==theme.loadPreference( id ))
{
eval( button +".upToolTip = locHide" + tip + ".toolTip" );
}
else
{
eval( button +".upToolTip = locShow" + tip + ".toolTip" );
}
}
function updateSeekToolTip()
{
if(player.openState!=13) return;
var seekHours = Math.floor((seek.value / 3600));
if (seekHours < 10) seekHours = "0" + seekHours;
var seekMinutes = Math.floor((seek.value - (seekHours*3600))/60);
if (seekMinutes < 10) seekMinutes = "0" + seekMinutes;
var seekSeconds = Math.floor((seek.value - (seekMinutes*60) - (seekHours*3600)));
if (seekSeconds < 10) seekSeconds = "0" + seekSeconds;
var seekString;
if (seekHours==00)
{
seekString = "";
}
else
{
seekString = seekHours + ":";
}
seekString += seekMinutes + ":" + seekSeconds;
seek.toolTip = seekString;
seek.toolTip += " / ";
seek.toolTip += player.currentMedia.DurationString;
}
function updateVolToolTip(id)
{
vol = "";
vol += player.settings.volume;
eval(id + ".toolTip = vol" );
}
function updateShuffRep()
{
if(player.settings.getMode('shuffle'))
{
shuffleButton.down = true;
}else{
shuffleButton.down = false;
}
if(player.settings.getMode('loop'))
{
repeatButton.down = true;
}else{
repeatButton.down = false;
}
}
//
function volKey(event)
{
switch(event.keycode)
{
case 39:
case 38:
if(player.settings.volume < 95)
{
player.settings.volume+=5;
}else{
player.settings.volume = 100;
}
break;
case 37:
case 40:
if(player.settings.volume > 5)
{
player.settings.volume-=5;
}else{
player.settings.volume = 0;
}
break;
}
player.settings.mute = false;
}
function seekKey(event)
{
if(player.openState!=13) return;
switch(event.keycode)
{
case 37:
case 40:
if(player.controls.currentPosition > 10)
{
player.controls.currentPosition-=10;
}else{
player.controls.currentPosition = 0;
}
break;
case 39:
case 38:
if(player.controls.currentPosition < player.currentMedia.duration)
{
player.controls.currentPosition+=10;
}else{
player.controls.currentPosition = player.currentMedia.duration;
}
break;
}
}
// view toggle
function toggleView(name,id)
{
if("true"==theme.loadPreference(id))
{
theme.savePreference(id, "false");
theme.closeView( name );
}else{
theme.openView( name );
}
}
function closeView(id)
{
theme.savePreference(id, "false");
if( id=="vidViewer" )
{
player.controls.stop();
//theme.savePreference("vidCheck", "false");
theme.savePreference("vidViewer", "false");
}
view.close();
}
function autoSizeView(width,height)
{
var viewSize = theme.loadPreference( width );
if( "--" != viewSize )
{
view.width = viewSize;
}else{
view.width = view.minWidth;
}
viewSize = theme.loadpreference( height );
if( "--" != viewSize )
{
view.height = viewSize;
}else{
view.height = view.minHeight;
}
}
function saveViewSize(width,height)
{
theme.savepreference( width , view.width );
theme.savepreference( height , view.height );
}
// preferences
function loadMainPrefs(){
visEffects.currentEffectType = mediacenter.effectType;
visEffects.currentPreset = mediacenter.effectPreset;
if ("true"==theme.loadPreference("plViewer"))
{
theme.openView( 'plView' );
}
if ("true"==theme.loadPreference("eqViewer"))
{
theme.openView( 'eqView' );
}
if ("true"==theme.loadPreference("visViewer"))
{
theme.openView( 'visView' );
}
}
function saveMainPrefs() {
mediacenter.effectType = visEffects.currentEffectType;
mediacenter.effectPreset = visEffects.currentPreset;
}
function mainShutDown(){
saveMainPrefs();
}
// playlist
function loadPlPrefs()
{
theme.savePreference( 'plViewer', "true" );
autoSizeView('plWidth','plHeight');
var index = 0;
playlist1.setColumnResizeMode( index++, "AutosizeData" );
playlist1.setColumnResizeMode( index++, "Stretches" );
playlist1.setColumnResizeMode( index++, "AutosizeHeader" );
playlist1.setColumnResizeMode( index++, "AutosizeHeader" );
playlist1.setColumnResizeMode( index++, "AutosizeHeader" );
playlist1.setColumnResizeMode( index++, "AutosizeHeader" );
}
function savePlPrefs(){
saveViewSize('plWidth','plHeight');
}
// eq settings
function loadEQPrefs(){
theme.savePreference( 'eqViewer', "true" );
}
function updateBalToolTip(){
balance.toolTip = "";
balance.toolTip += player.settings.balance;
}
function toggleSkinFx(){
if("true"==theme.loadPreference("soundFX")){
theme.savePreference("soundFX", "false");
}else{
theme.savePreference("soundFX", "true");
}
}
function toggleSpeaker(){
if(eq.speakerSize==2){
eq.speakerSize = -1;
}
eq.speakerSize++
}
// video settings
function loadVidPrefs(){
theme.savePreference( 'vidViewer', "true" );
var _drawerStatus = theme.loadPreference('drawerStatus');
if (_drawerStatus != '--') {
drawerStatus = (_drawerStatus.toLowerCase() == 'true') ? false : true;
} else {
drawerStatus = true;
}
checkSnapStatus();
checkVideoPlayerState();
updateZoomToolTip();
toggleVidDrawer();
}
function saveVidPrefs(){
theme.savePreference('drawerStatus',drawerStatus);
}
function loadVidSize(){
var vidSizer = theme.loadPreference( "videoWidth" );
if( "--" != vidSizer )
{
view.width = vidSizer;
}
vidSizer = theme.loadpreference( "videoHeight" );
if( "--" != vidSizer )
{
view.height = vidSizer;
}
}
function saveVidSize(){
theme.savepreference( "videoWidth", view.width );
theme.savepreference( "videoHeight", view.height );
theme.savePreference("vidSnapper" , "false");
vidZoom.upToolTip = vidSetTip.toolTip;
mediacenter.videoZoom = 50;
}
function videoZoom(){
if("false"==theme.loadPreference("vidSnapper")){
mediacenter.videoZoom = 50;
}
if(mediacenter.videoZoom < 76){
mediacenter.videoZoom = 100;
}else if(mediacenter.videoZoom <101){
mediacenter.videoZoom = 150;
}else if(mediacenter.videoZoom < 156){
mediacenter.videoZoom = 200;
}else{
mediacenter.videoZoom = 75;
}
SnapToVideo();
updateZoomToolTip();
}
function updateZoomToolTip(){
vidZoom.upToolTip = vidZoomIn.toolTip + mediacenter.videoZoom + vidZoomMid.toolTip;
if(mediacenter.videoZoom < 76){
nextZoom = 100;
}else if(mediacenter.videoZoom <101){
nextZoom = 150;
}else if(mediacenter.videoZoom < 156){
nextZoom = 200;
}else{
nextZoom = 75;
}
vidZoom.upToolTip += nextZoom + vidZoomOut.toolTip;
if("false"==theme.loadPreference("vidSnapper")){
vidZoom.upToolTip = vidSetTip.toolTip;
}
}
function SnapToVideo(){
theme.savePreference("vidSnapper" , "true");
var zoom = mediacenter.videoZoom;
var viewWidth = (player.currentMedia.imageSourceWidth * (zoom/100.00));
var viewHeight = (player.currentMedia.imageSourceHeight * (zoom/100.00));
view.width = viewWidth + 73;
view.height = viewHeight + 163;
}
function checkSnapStatus(){
if(player.openState!=13) return;
if("false"==theme.loadPreference("vidSnapper")){
loadVidSize();
}else{
SnapToVideo();
}
}
function checkVideoPlayerState(){
if (player){
switch (player.playState){
case 3: //playing
if(!player.currentMedia.ImageSourceWidth>0){
theme.savePreference('vidViewer', "false");
view.close();
break;
}
vidBack.visible = vidBack2.visible = false;
videoFrame.visible = true;
if(!player.fullScreen){
checkSnapStatus();
}
break;
case 8:
return;
break;
}
vidResize.enabled = true;
vidZoom.enabled = true;
}
if (!player.controls.isAvailable("Stop")) {
videoFrame.visible = false;
vidResize.enabled = false;
vidZoom.enabled = false;
vidBack.visible = vidBack2.visible = true;
view.width = 321;
view.height = 328;
}
}
function toggleVidDrawer(){
if(!drawerStatus){
vidDrawer.moveTo(0,view.height-100,500);
vidDrawerFrame.visible = true;
vidDrawerButton.down = true;
drawerStatus = !drawerStatus;
}else{
vidDrawer.moveTo(0,view.height-200,500);
drawerStatus = !drawerStatus;
}
}
function checkVidDrawer(){
drawerStatus = drawerStatus;
vidDrawerFrame.visible = drawerStatus;
}