home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2003 February
/
Chip_2003-02_cd1.bin
/
zkuste
/
wmakeup
/
download
/
WWNxp.wmz
/
skin.js
< prev
next >
Wrap
Text File
|
2002-04-22
|
12KB
|
550 lines
/*
Media Switcher & Usability Functions
⌐ Copyright 2002 The Skins Factory, Inc. All Rights Reserved. May Not Be Reproduced Without Written Authorization.
http://www.theskinsfactory.com
info@theskinsfactory.com
*/
/*
winXP version
*/
function checkMediaOnLoad(){
if(player){}
view.width = 0;
view.height = 0;
view.backgroundImage = "";
if( ((player.Playstate==3)||(player.Playstate==2)) && (player.currentMedia.ImageSourceWidth>0)){
theme.currentViewID = 'videoView';
setView = "videoView";
loadGlobalPrefs();
killVis();
}else{
theme.currentViewID = 'mainView';
setView = "mainView";
loadGlobalPrefs();
}
}
/*
remember the setView value
*/
function checkPlayerState(){
if (player){
switch (player.playState){
case 0: //undefined
visOn = visOn;
//killVis();
break;
case 1: //stopped
visOn = visOn;
//killVis();
break;
case 2: //paused
visButtonBack.moveTo(39,112,500);
visNext.enabled = false;
visPrev.enabled = false;
visButton.enabled = false;
visOn = visOn;
break;
case 3: //playing
visButton.enabled = true;
visOn = visOn;
toggleVis();
break;
case 6: //buffering
visOn = visOn;
break;
case 7: //waiting
visOn = visOn;
//killVis();
break;
case 8: //media ended
visOn = visOn;
//killVis();
break;
case 9: //Transitioning
visOn = visOn;
break;
case 10: //Ready
//killVis();
break;
}
}
if (!player.controls.isAvailable("Stop")) {
killVis();
visOn = visOn;
if(player.currentMedia.ImageSourceWidth>0){
theme.currentViewID = 'videoView';
setView = "videoView";
}
}
updateMetadata();
checkPlaylist();
}
function checkPlayerMediaGlobal(){
if((player.OpenState == osMediaOpen) && (player.currentMedia.ImageSourceWidth>0)){
if((setView=="videoView")|| (player.playState==8&&setView=="videoView")){
setView = "videoView";
}else{
theme.currentViewID="videoView";
setView = "videoView";
}
}else if((player.currentMedia.duration > 0) && !(player.currentMedia.ImageSourceWidth>0)){
if(setView=="mainView"){
setView = "mainView";
}else{
theme.currentViewID="mainView";
setView = "mainView";
}
}else{
setView = setView;
}
}
function mainLoader(){
visEffects.currentEffectType = mediacenter.effectType;
visEffects.currentPreset = mediacenter.effectPreset;
loadMainPrefs();
checkPlayerState();
updateMetadata();
updateVolToolTip();
volume.value = player.settings.volume;
}
// && (player.currentMedia.ImageSourceWidth<0)
function killVis(){
visButton.enabled = false;
visDisabled();
}
// new vis code -- default state is vis custom ani,
// the preference is not set for startup -- so don't think it's a bug
visOn = 2;
function toggleVis(){
switch(visOn){
case 1:
visEnabled();
visButton.enabled = true;
visPlayback.visible = false;
break;
case 2:
visPlayback.visible = true;
visButton.enabled = true;
visMask.visible = false;
visButtonBack.moveTo(39,112,500);
visNext.enabled = false;
visPrev.enabled = false;
visButton.upToolTip = "Vis Effects";
visPlayback.visible = true;
break;
case 3:
visPlayback.visible = false;
visDisabled();
visButton.enabled = true;
visOn = 0;
break;
}
}
function visEnabled(){
visMask.visible = true;
visButtonBack.moveTo(52,100,500);
visNext.enabled = true;
visPrev.enabled = true;
visButton.upToolTip = "Vis Effects";
}
function visDisabled(){
visMask.visible = false;
visButtonBack.moveTo(39,112,500);
visNext.enabled = false;
visPrev.enabled = false;
visButton.upToolTip = "Vis Effects";
visPlayback.visible = false;
}
function checkPlaylist(){
if(player.currentPlaylist.count <= 0){
playMe.visible = true;
}
}
function updateSeekToolTip(){
progressMain.toolTip = "Seek - [";
progressMain.toolTip += player.controls.currentPositionString;
progressMain.toolTip += "]";
}
function updateVolToolTip(){
volume.toolTip = "Volume - [";
volume.toolTip += player.settings.volume;
volume.toolTip += "%]";
}
function updateMetadata(){
if(player.openState!=13) return;
metadata.value = player.status;
authorppl = player.currentmedia.getiteminfo("#author");
if (authorppl == "") {
authorppl = player.currentmedia.getiteminfo("author");
}
if (authorppl != "") {
authorppl += " - ";
}
if (metadata.value != "") {
metadata.value += " - ";
}
metadata.value += authorppl;
metadata.value += player.currentmedia.name;
metadata.scrolling = (metadata.textWidth>metadata.width);
}
function mainCloser(){
saveMainPrefs();
mediacenter.effectType = visEffects.currentEffectType;
mediacenter.effectPreset = visEffects.currentPreset;
}
function loadMainPrefs(){
setView = "mainView";
var _visOn = theme.loadPreference('visOn');
if (_visOn != '--'){
if(_visOn==1){
visOn = 1;
toggleVis();
}else if(_visOn==2){
visOn = 2;
toggleVis();
}else{
visOn = 3;
toggleVis();
}
}
}
function saveMainPrefs() {
theme.savePreference('visOn',visOn);
}
function volUpDown(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;
}
}
function seekUpDown(event){
switch(event.keycode){
case 39:
case 38:
if(player.controls.currentPosition < 900){
player.controls.currentPosition+=10;
}else{
player.controls.currentPosition = 1000;
}
break;
case 37:
case 40:
if(player.controls.currentPosition > 10){
player.controls.currentPosition-=10;
}else{
player.controls.currentPosition = 0;
}
break;
}
}
function viewResizer(event){
switch(event.keycode){
case 37:
view.width-=20;
mediacenter.videoZoom-=20;
break;
case 38:
view.height-=20
mediacenter.videoZoom-=20;
break;
case 39:
view.width+=20;
mediacenter.videoZoom+=20;
break;
case 40:
view.height+=20;
mediacenter.videoZoom+=20;
break;
}
}
function toggleEQ(){
if("true"==theme.loadPreference("eqViewer")){
theme.savePreference("eqViewer", "false");
theme.closeView( "eqView" );
//eqButton.upToolTip = "Open EQ Settings";
}else{
theme.openView( "eqView" );
//eqButton.upToolTip = "Close EQ Settings";
}
}
function videoZoom(){
if(mediacenter.videoZoom < 76){
mediacenter.videoZoom = 100;
}else if(mediacenter.videoZoom <101){
mediacenter.videoZoom = 150;
}else if(mediacenter.videoZoom < 156){
mediacenter.videoZoom = 200;
}else if(mediacenter.videoZoom < 201){
mediacenter.videoZoom = 250;
}else{
mediacenter.videoZoom = 75;
}
SnapToVideo();
updateZoomToolTip();
}
function updateZoomToolTip(){
vidZoom.upToolTip = "Zoom - [current: ";
vidZoom.upToolTip += mediacenter.videoZoom;
vidZoom.upToolTip += "%] - [next: ";
if(mediacenter.videoZoom < 76){
nextZoom = 100;
}else if(mediacenter.videoZoom <101){
nextZoom = 150;
}else if(mediacenter.videoZoom < 156){
nextZoom = 200;
}else if(mediacenter.videoZoom < 201){
nextZoom = 250;
}else{
nextZoom = 75;
}
vidZoom.upToolTip += nextZoom;
vidZoom.upToolTip += "%]";
}
function SnapToVideo(){
var zoom = mediacenter.videoZoom;
var viewWidth = (player.currentMedia.imageSourceWidth * (zoom/100.00));
var viewHeight = (player.currentMedia.imageSourceHeight * (zoom/100.00));
view.width = viewWidth + 196;
view.height = viewHeight + 43;
// view.width= player.currentMedia.imageSourceWidth + 196;
// view.height= player.currentMedia.imageSourceHeight + 41;
}
leftDrawer = rightDrawer = 1;
function moveLeftVidDrawer(){
if(leftDrawer==1){
leftDrBot.moveTo(20,35,500);
leftDrTop.moveTo(20,0,500);
leftDrawer = 2;
vidButtons.visible = true;
leftDrOpener.upToolTip = "Close Video Play Button Panel";
}else{
leftDrBot.moveTo(20,35,700);
leftDrTop.moveTo(20,0,700);
leftDrawer = 1;
}
}
function moveLeftVidDrawerTop(){
if(leftDrawer==2){
leftDrBot.moveTo(20,-50,500);
leftDrTop.moveTo(20,-85,500);
}else{
leftDrBot.moveTo(20,82,400);
vidButtons.visible = false;
leftDrOpener.upToolTip = "Open Video Play Button Panel";
}
}
function moveRighVidDrawer(){
if(rightDrawer==1){
rightDrBot.moveTo(0,35,500);
rightDrTop.moveTo(0,0,500);
rightDrawer = 2;
sliderDrawer.visible = true;
rightDrOpener.upToolTip = "Close Video Control Panel";
}else{
rightDrBot.moveTo(0,35,700);
rightDrTop.moveTo(0,0,700);
rightDrawer = 1;
}
}
function moveRightVidDrawerTop(){
if(rightDrawer==2){
rightDrBot.moveTo(0,-50,500);
rightDrTop.moveTo(0,-85,500);
}else{
rightDrBot.moveTo(0,82,400);
sliderDrawer.visible = false;
rightDrOpener.upToolTip = "Open Video Control Panel";
}
}
function loadVidPrefs(){
setView = "videoView";
var _leftDrawer = theme.loadPreference('leftDrawer');
var _rightDrawer = theme.loadPreference('rightDrawer');
if (_leftDrawer != '--'){
if(_leftDrawer==2){
moveLeftVidDrawer();
}
}
if (_rightDrawer != '--'){
if(_rightDrawer==2){
moveRighVidDrawer();
}
}
updateVolToolTip();
updateZoomToolTip();
}
function saveVidPrefs(){
theme.savePreference('leftDrawer',leftDrawer);
theme.savePreference('rightDrawer',rightDrawer);
}
function loadPlPrefs(){
theme.savePreference( 'plViewer', "true" );
var dwScale = theme.loadPreference( "PlaylistWidth" );
if( "--" != dwScale )
{
plView.width = dwScale;
}
dwScale = theme.loadpreference( "PlaylistHeight" );
if( "--" != dwScale )
{
plView.height = dwScale;
}
plFrame.setColumnResizeMode( 0, "stretches" );
plFrame.setColumnResizeMode( 1, "autosizedata" );
plFrame.setColumnResizeMode( 2, "autosizedata" );
plFrame.setColumnResizeMode( 3, "autosizedata" );
}
function savePlPrefs(){
theme.savepreference( "PlaylistWidth", plView.width );
theme.savepreference( "PlaylistHeight", plView.height );
}
function togglePL(){
if("true"==theme.loadPreference("plViewer")){
theme.savePreference("plViewer", "false");
theme.closeView( "plView" );
}else{
theme.openView( "plView" );
}
}
function toggleContent(){
if("true"==theme.loadPreference("contentViewer")){
theme.savePreference("contentViewer", "false");
theme.closeView( "contentView" );
}else{
theme.openView( "contentView" );
}
}
function loadGlobalPrefs(){
if ("true"==theme.loadPreference("plViewer")){
theme.openView( 'plView' );
}
if ("true"==theme.loadPreference("eqViewer")){
theme.openView( 'eqView' );
}
if ("true"==theme.loadPreference("contentViewer")){
theme.openView( 'contentView' );
}
}
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:
player.URL=theme.openDialog('FILE_OPEN','FILES_ALLMEDIA');
break;
case 80:
case 112:
togglePL();
break;
case 102:
case 70:
if((setView=="videoView")&&player.PlayState==3){
videoZoom();
}
break;
}
}