home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2003 December
/
Chip_2003-12_cd1.bin
/
opsys
/
wmakeup
/
download
/
SmartDisplayBlue.wmz
/
mira.js
< prev
next >
Wrap
Text (UTF-16)
|
2003-03-17
|
33KB
|
759 lines
/*
The Skins Factory
http://www.theskinsfactory.com
info@theskinsfactory.com
*/
function checkMediaOnLoad(){
if(player){}
view.width = 0;
view.height = 0;
view.backgroundImage = "";
theme.currentViewID = "mainView";
if( ((player.Playstate==3)||(player.Playstate==2)) && (player.currentMedia.ImageSourceWidth>0)){
theme.currentViewID = 'videoView';
loadGlobalPrefs();
}else{
theme.currentViewID = 'mainView';
loadGlobalPrefs();
}
}
var introStatus = false;
function introSequence(){
if(!introStatus){
var _shutterStatus = theme.loadPreference('shutterStatus');
if (_shutterStatus != '--') {
shutterStatus = (_shutterStatus.toLowerCase() == 'true') ? false : true;
} else {
shutterStatus = true;
}
toggleShutter();
toggleShutterUpdate();
view.timerInterval = 0;
}
}
function mainStartUp(){
volume.value = player.settings.volume;
loadMainPrefs();
checkPlayerState();
updateMetadata();
}
var shutterStatus = false;
function toggleShutter(){
if(shutterStatus){
mainBotDrawer.moveTo(57,319,500);
shutterButtonSub.moveTo(106,392,500);
mainSeekDrawer.moveTo(0,167,500);
mainVolDrawer.moveTo(221,167,500);
botDrawerButtons.visible = seek.visible = volume.visible = true;
drawerButton.down = true;
shutterStatus = !shutterStatus;
}else{
mainBotDrawer.moveTo(57,282,500);
shutterButtonSub.moveTo(106,356,500);
mainSeekDrawer.moveTo(18,167,500);
mainVolDrawer.moveTo(202,167,500);
drawerButton.down = false;
shutterStatus = !shutterStatus;
}
}
var shutterStatus2 = false;
function toggleShutterUpdate(){
if(!shutterStatus2){
shutterSub.backgroundImage = "shutter_open.gif";
shutterButton.down = false;
shutterStatic.visible = false;
shutterStatus2 = !shutterStatus2;
}else{
shutterSub.backgroundImage = "shutter_close.gif";
shutterButton.down = true;
shutterStatic.visible = true;
shutterStatus2 = !shutterStatus2;
}
}
function checkShutterStatus(){
shutterStatus = shutterStatus;
botDrawerButtons.visible = seek.visible = volume.visible = !shutterStatus;
}
function checkPlayerState(){
if (player){
switch (player.playState){
case 3: //playing
if(player.currentMedia.ImageSourceWidth>0){
theme.currentViewID = 'videoView';
break;
}
break;
}
}
if (!player.controls.isAvailable("Stop")) {
}
}
// 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 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 updateSeekToolTip2(){
if(player.openState!=13) return;
var seekHours = Math.floor((seek2.value / 3600));
if (seekHours < 10) seekHours = "0" + seekHours;
var seekMinutes = Math.floor((seek2.value - (seekHours*3600))/60);
if (seekMinutes < 10) seekMinutes = "0" + seekMinutes;
var seekSeconds = Math.floor((seek2.value - (seekMinutes*60) - (seekHours*3600)));
if (seekSeconds < 10) seekSeconds = "0" + seekSeconds;
var seekString;
if (seekHours==00) {
seekString = "";
}else{
seekString = seekHours + ":";
}
seekString += seekMinutes + ":" + seekSeconds;
seek2.toolTip = seekString;
seek2.toolTip += " / ";
seek2.toolTip += player.currentMedia.DurationString;
}
function updateToolTip(id,button,tip){
if("true"==theme.loadPreference( id )){
eval( button +".upToolTip = locHide" + tip + ".toolTip" );
}else{
eval( button +".upToolTip = locShow" + tip + ".toolTip" );
}
}
function updateVolToolTip(){
volume.toolTip = "";
volume.toolTip += player.settings.volume;
}
function updateRemoteVolToolTip(){
volume2.toolTip = "";
volume2.toolTip += player.settings.volume;
}
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 37:
case 40:
if(player.settings.volume < 95){
player.settings.volume+=5;
}else{
player.settings.volume = 100;
}
break;
case 39:
case 38:
if(player.settings.volume > 5){
player.settings.volume-=5;
}else{
player.settings.volume = 0;
}
break;
}
//mute.down = false;
player.settings.mute = false;
}
function seekKey(event){
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 < 900){
player.controls.currentPosition+=10;
}else{
player.controls.currentPosition = 1000;
}
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.currentMedia.ImageSourceWidth>0 ){
player.controls.stop();
}
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(){
if ("true"==theme.loadPreference("visViewer")){
theme.openView( 'visView' );
}
if ("true"==theme.loadPreference("remoteViewer")){
theme.closeView('remoteView');
}
}
function saveMainPrefs() {
theme.savePreference('shutterStatus',shutterStatus);
}
function mainShutDown(){
saveMainPrefs();
}
function loadGlobalPrefs(){
if ("true"==theme.loadPreference("plViewer")){
theme.openView( 'plView' );
}
if ("true"==theme.loadPreference("eqViewer")){
theme.openView( 'eqView' );
}
}
// playlist
function loadPlPrefs(){
theme.savePreference( 'plViewer', "true" );
autoSizeView('plWidth','plHeight');
var index = 0;
playlist1.setColumnResizeMode( index++, "Stretches" );
playlist1.setColumnResizeMode( index++, "AutosizeHeader" );
playlist1.setColumnResizeMode( index++, "AutosizeHeader" );
playlist1.setColumnResizeMode( index++, "AutosizeHeader" );
playlist1.setColumnResizeMode( index++, "AutosizeHeader" );
}
function addToPlaylist(){
var media = theme.openDialog( "FILE_OPEN" , "FILES_ALLMEDIA" );
if(media){
newMedia = player.mediaCollection.add( media );
playlist1.playlist.appendItem( newMedia );
}
}
function delFromPlaylist(){
playlist1.deleteSelected()
}
function savePlPrefs(){
saveViewSize('plWidth','plHeight');
}
// equalizer
function loadEQPrefs(){
theme.savePreference( 'eqViewer', "true" );
if(truBass.enabled){
srsCover.visible = false;
}
}
function updateBalToolTip(){
balance.toolTip = "";
balance.toolTip += player.settings.balance;
}
function toggleSpeaker(){
if(eq.speakerSize==2){
eq.speakerSize = -1;
}
eq.speakerSize++
}
// visualizations
function loadVisPrefs(){
theme.savePreference( 'visViewer', "true" );
visEffects.currentEffectType = mediacenter.effectType;
visEffects.currentPreset = mediacenter.effectPreset;
autoSizeView('visWidth','visHeight');
checkVisualsPlayerState()
}
function saveVisPrefs(){
mediacenter.effectType = visEffects.currentEffectType;
mediacenter.effectPreset = visEffects.currentPreset;
saveViewSize('visWidth','visHeight');
}
function checkVisualsPlayerState(){
if (player){
switch (player.playState){
case 3: //playing
//visMask.visible = true;
break;
}
}
if (!player.controls.isAvailable("Stop")) {
//visMask.visible = false;
}
}
function displayVisText(){
visEffectsText.visible = true;
visEffectsText.value = visEffects.currentEffectTitle + ": " + visEffects.currentPresetTitle;
visView.timerInterval = 6000
}
function hideVisText(){
visEffectsText.visible = false;
visView.timerInterval = 0
}
// 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();
updateVideoMetadata('status');
if (("--"==theme.loadPreference("remoteViewer"))||("true"==theme.loadPreference("remoteViewer"))){
theme.openView( 'remoteView' );
}
if ("true"==theme.loadPreference("visViewer")){
theme.closeView( 'visView' );
}
}
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 + 52;
view.height = viewHeight + 264;
}
function checkSnapStatus(){
if(player.openState!=13) return;
if("false"==theme.loadPreference("vidSnapper")){
loadVidSize();
}else{
SnapToVideo();
}
}
function returnToMain(){
theme.currentViewID = 'mainView';
// hide remote
}
function checkVideoOpenState(){
if(player){
switch(player.openState){
case 13:
if(player.currentMedia.ImageSourceWidth>0){
break;
}else{
//theme.currentViewID = 'mainView';
}
}
}
}
function checkVideoPlayerState(){
if (player){
switch (player.playState){
case 3: //playing
if(player.currentMedia.ImageSourceWidth>0){
videoFrame.visible = true;
if(!player.fullScreen){
checkSnapStatus();
}
}else{
videoFrame.visible = false;
}
break;
}
if((player.openState==13)&&player.currentMedia.ImageSourceWidth>0){
switchButton.enabled = false;
vidResize.enabled = true;
vidZoom.enabled = true;
switchButton.upToolTip = returnPlayerDis.toolTip;
}else{
switchButton.enabled = true;
vidResize.enabled = false;
vidZoom.enabled = false;
switchButton.upToolTip = returnPlayer.toolTip;
}
}
if (!player.controls.isAvailable("Stop")) {
videoFrame.visible = false;
vidZoom.enabled = false;
switchButton.enabled = true;
vidResize.enabled = false;
switchButton.upToolTip = returnPlayer.toolTip;
view.width = view.minWidth;
view.height = view.minHeight;
}
}
var drawerStatus = false;
function toggleVidDrawer(){
if(!drawerStatus){
vidSettingsDrawer.moveTo(0,view.height-195,600);
vidDraweButtonSub.moveTo(0,view.height-35,600);
vidSliderSub.visible = true;
vidDrawerButton.down = true
drawerStatus = !drawerStatus;
}else{
vidSettingsDrawer.moveTo(0,view.height-352,600);
vidDraweButtonSub.moveTo(0,view.height-192,600);
vidDrawerButton.down = false;
drawerStatus = !drawerStatus;
}
}
function checkDrawerStatus(){
drawerStatus = drawerStatus;
vidSliderSub.visible = drawerStatus;
}
function updateVideoMetadata(type){
if("status"==type){
if(player.openState!=13) return;
var metaAuthor = player.currentMedia.getItemInfo("author");
if (metaAuthor != "") {
metaAuthor += " - ";
}
vidMetadata.value = player.status;
if (vidMetadata.value != "") {
vidMetadata.value += " - ";
}
vidMetadata.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){
vidMetadata.value = metaAuthor;
}
}else{
vidMetadata.value = player.status;
vidMetadata.scrolling = (vidMetadata.textWidth>vidMetadata.width);
return;
}
vidMetadata.value += player.currentmedia.name;
vidMetadata.scrolling = (vidMetadata.textWidth>vidMetadata.width);
}
// vid remote
function loadVidRemotePrefs(){
theme.savePreference( 'remoteViewer', "true" );
// view.width = view.minWidth;
// view.height = view.minHeight;
}