home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Minami 79
/
MINAMI79.iso
/
Extra
/
MPSetup.exe
/
1033
/
RCDATA
/
CABINET
/
wmploc.DLL
/
256
/
NOWPLAYING.JS
< prev
next >
Wrap
Text File
|
2002-12-14
|
19KB
|
859 lines
// Windows Media Player - Copyright 2000 Microsoft Corporation.
//<script>
// Dimensions must match wmpnowplayinghelper.cpp
var g_BannerHeight = 36;
var g_SepWidth = 2;
var g_SepHeight = 2;
var g_ControlbarHeight = 20;
var g_SettingsMinHeight = 21;
var g_SettingsMaxHeight = 500;
var g_SidebarMinWidth = 100;
var g_SidebarMaxWidth = 500;
var g_PlaylistMinHeight = 35;
var g_MetadataMinHeight = 26;
var g_DisplayMinWidth = 200;
var g_DisplayMinHeight = 19;
var g_MediaMinHeight = 20;
var PLUGIN_TYPE_BACKGROUND = 1;
var PLUGIN_TYPE_SEPARATEWINDOW = 2;
var PLUGIN_TYPE_DISPLAYAREA = 3;
var PLUGIN_TYPE_SETTINGSAREA = 4;
var PLUGIN_TYPE_METADATAAREA = 5;
var PLUGIN_TYPE_BANNERAREA = 240;
var PLUGIN_PROP_CURRENTPRESET = "CurrentPreset"
var PLUGIN_PROP_SKINFILE = "SkinFile"
var VIEW_FLAGSEX_ATTEMPTEDAUTORUN = 0x0001;
var g_VResize = false;
var g_HResize = false;
var g_SResize = false;
var g_fCaptionsDetected = false;
var g_fShowCaptions = false;
var g_fShowBanner = false;
var g_fClosing = false;
var g_rgSettings = new Array(
"AppColorView",
"CrossFadeView",
"EQView",
"MediaLinkView",
"AdvancedVideoSettingsView",
"AdvancedAudioView",
"SRSView",
"VideoSettingsView"
);
var g_nSettingsTitleLeft = 0;
function OnLoad()
{
g_nSettingsTitleLeft = txtSettingsTitle.left;
g_fCaptionsDetected = helper.captionsAvailable;
plMedia.setColumnResizeMode( 0, "Stretches" );
plMedia.setColumnResizeMode( 1, "AutosizeData" );
ResetDisplayPlugin();
UpdateCaptions();
UpdateBannerPlugin();
UpdateSettingsPlugin();
UpdateMetadataPlugin();
UpdateVizControls();
UpdatePanels();
UpdateFullScreenButton();
UpdateSettingsTitle();
UpdateCustomize();
}
function OnOpenStateChange()
{
if( osMediaOpen == player.OpenState )
{
g_fCaptionsDetected = helper.captionsAvailable;
ResetDisplayPlugin();
UpdateCaptions();
UpdateBannerPlugin();
UpdatePanels();
UpdateVizControls();
}
UpdateFullScreenButton();
}
function OnPlayStateChange()
{
if( psPlaying == player.playState )
{
ResetDisplayPlugin();
UpdateCaptions();
UpdatePanels();
UpdateVizControls();
}
UpdateFullScreenButton();
}
function OnScriptCommand(scType, Param)
{
scType = scType.toUpperCase();
if(scType == "TEXT" || scType == "<SYNC" || scType == "CAPTION" || scType == "SYNCHRONIZEDLYRICLYRIC")
{
g_fCaptionsDetected = true;
UpdateCaptions();
UpdatePanels();
}
}
function UpdatePanels()
{
if( !g_fClosing )
{
var lSettings = 0;
var lSidebar = 0;
var lMetadata = 0;
var lPlaylist = 0;
var lDisplay = 0;
var lCaptions = 0;
var lBanner = 0;
helper.calcLayout( vMain.width, vMain.height, g_fShowCaptions, g_fShowBanner );
lSettings = helper.getLayoutSize( 1 );
lSidebar = helper.getLayoutSize( 2 );
lMetadata = helper.getLayoutSize( 3 );
lPlaylist = helper.getLayoutSize( 4 );
lDisplay = helper.getLayoutSize( 5 );
lCaptions = helper.getLayoutSize( 6 );
lBanner = helper.getLayoutSize( 7 );
if( 0 != lSettings )
{
svSettings.verticalAlignment="top";
svSettings.top=svMain.height-g_ControlbarHeight-lSettings;
svSettings.height=lSettings;
svSettings.verticalAlignment="bottom";
svSettings.visible = true;
svMedia.height = svSettings.top-g_SepHeight ;
}
else
{
svSettings.visible = false;
svMedia.height = svMain.height-g_ControlbarHeight;
}
if( 0 != lSidebar )
{
svSidebar.width = lSidebar;
svMain.width = vMain.width - lSidebar - g_SepWidth;
svSidebar.visible = true;
}
else
{
svSidebar.visible = false;
svSidebar.width = lSidebar;
svMain.width = vMain.width;
}
if( 0 != lMetadata )
{
piMetadata.height = lMetadata;
piMetadata.visible = true;
}
else
{
piMetadata.visible = false;
}
if( 0 != lPlaylist )
{
if( 0 != lMetadata )
{
plMedia.top = lMetadata + g_SepHeight;
}
else
{
plMedia.top = 0;
}
plMedia.height = lPlaylist;
plMedia.visible = true;
}
else
{
plMedia.visible = false;
}
UpdateResizeBars();
if( 0 != lDisplay )
{
piDisplay.height = lDisplay;
piDisplay.visible = true;
}
else
{
piDisplay.visible = false;
}
piBanner.visible = ( 0 != lBanner );
if( 0 != lCaptions )
{
piCaptions.verticalAlignment = "top";
piCaptions.top = lDisplay;
piCaptions.height = lCaptions;
piCaptions.verticalAlignment = "bottom";
piCaptions.visible = true;
}
else
{
piCaptions.visible = false;
}
}
}
function ResetDisplayPlugin()
{
mediacenter.displayView = helper.resolveDisplayView(false);
UpdateDisplayPlugin();
UpdateDisplayPreset();
}
var g_fSetQuickHideForBorder=false;
function OnClose()
{
g_fClosing = true;
if( g_fSetQuickHideForBorder )
{
QuickHideForBorder( false );
}
}
function QuickHideForBorder(fHide)
{
if (fHide && (!mediacenter.quickHide) && (!g_fSetQuickHideForBorder))
{
g_fSetQuickHideForBorder = true;
mediacenter.quickHide=true;
}
else if ( (!fHide) && g_fSetQuickHideForBorder)
{
mediacenter.quickHide=false;
g_fSetQuickHideForBorder=false;
}
}
function UpdateDisplayPlugin()
{
piDisplay.objectID = mediacenter.displayView;
// handle skin
if( piDisplay.objectID == "BorderView" )
{
QuickHideForBorder(true);
var skinfile = helper.getSkinFile();
piDisplay.setProperty( PLUGIN_PROP_SKINFILE, skinfile );
// Reset if error
if( ( piDisplay.getProperty( PLUGIN_PROP_SKINFILE ) != skinfile ) || ( "" == skinfile ) )
{
mediacenter.displayView = helper.resolveDisplayView(true);
UpdateDisplayPreset();
QuickHideForBorder(false);
}
}
else
{
QuickHideForBorder(false);
}
// Reset if error
if( "" == piDisplay.objectID )
{
mediacenter.displayView = helper.resolveDisplayView(true);
UpdateDisplayPreset();
}
// Reset full screen
if( piDisplay.objectID != "VideoView" && piDisplay.objectID != "VizView" )
{
mediacenter.fullScreenAvailable = false;
}
// Sync back
mediacenter.displayView = piDisplay.objectID;
// Update filler
UpdateFillLink();
}
function UpdateDisplayPreset()
{
var displayPreset = 0;
if( piDisplay.objectID != "VideoView" && piDisplay.objectID != "VizView" && piDisplay.objectID != "BorderView" && piDisplay.objectID != "MetadataView" )
{
piDisplay.setProperty( PLUGIN_PROP_CURRENTPRESET, mediacenter.displayPreset );
// Sync back
displayPreset = piDisplay.getProperty( PLUGIN_PROP_CURRENTPRESET );
mediacenter.displayPreset = displayPreset;
}
}
function UpdateCaptions()
{
var fShowCaptions = false;
if ( mediacenter.showCaptions && !PlayingDVD() )
{
if( piDisplay.objectID == "VideoView" || piDisplay.objectID == "VizView" || piDisplay.objectID == "AlbumArtView" )
{
fShowCaptions = g_fCaptionsDetected;
}
}
g_fShowCaptions = fShowCaptions;
}
function UpdateBannerPlugin()
{
if(player.currentMedia && (player.currentmedia.getItemInfo("BannerURL") != ""))
{
g_fShowBanner = true;
}
else
{
g_fShowBanner = false;
}
}
function UpdateSettingsPlugin()
{
var settingsPreset = 0;
piSettings.objectID = mediacenter.settingsView;
piSettings.setProperty( PLUGIN_PROP_CURRENTPRESET, mediacenter.settingsPreset );
// Reset if error
if( "" == piSettings.objectID )
{
piSettings.objectID = "EQView";
}
// Sync back
settingsPreset = piSettings.getProperty( PLUGIN_PROP_CURRENTPRESET );
mediacenter.settingsView = piSettings.objectID;
mediacenter.settingsPreset = settingsPreset;
// Update spinners and text
if( 0 <= MapSettingsToIndex( mediacenter.settingsView ) )
{
btnSettingsPrev.visible = true;
txtSettingsTitle.horizontalAlignment="left";
txtSettingsTitle.left = g_nSettingsTitleLeft;
txtSettingsTitle.width = btnSettingsClose.left-txtSettingsTitle.left;
txtSettingsTitle.horizontalAlignment="stretch";
}
else
{
btnSettingsPrev.visible = false;
txtSettingsTitle.horizontalAlignment="left";
txtSettingsTitle.left = btnSettingsPrev.left;
txtSettingsTitle.width = btnSettingsClose.left-txtSettingsTitle.left;
txtSettingsTitle.horizontalAlignment="stretch";
}
}
function UpdateMetadataPlugin()
{
var metadataPreset = 0;
piMetadata.objectID = mediacenter.metadataView;
piMetadata.setProperty( PLUGIN_PROP_CURRENTPRESET, mediacenter.metadataPreset );
// Reset if error
if( "" == piMetadata.objectID )
{
piMetadata.objectID = "MediaInfoView";
mediacenter.showMetadata = false;
}
// Sync back
metadataPreset = piMetadata.getProperty( PLUGIN_PROP_CURRENTPRESET );
mediacenter.metadataView = piMetadata.objectID;
mediacenter.metadataPreset = metadataPreset;
// Update filler
UpdateFillLink();
}
function UpdateFillLink()
{
svFillLink.visible = ( ( piMetadata.objectID == "MediaInfoView" ) && ( piDisplay.objectID == "MetadataView" ) && mediacenter.showMetadata );
}
function UpdateVizControls()
{
// DVD?
if( ( "VideoView" == piDisplay.objectID ) && PlayingDVD() )
{
txtVizTitle.visible = false;
txtVizTitle2.visible = false;
btnDVDMenu.visible = ( ("videoManagerMenu" != player.dvd.domain) && ("videoTitleSetMenu" != player.dvd.domain) );
btnDVDResume.visible = !btnDVDMenu.visible;
return;
}
// No Viz or Border or Video?
if( ( ( mediacenter.showEffects == false ) && ( "VizView" == piDisplay.objectID ) ) ||
( "BorderView" == piDisplay.objectID ) || ( "VideoView" == piDisplay.objectID ) )
{
txtVizTitle.visible = false;
txtVizTitle2.visible = false;
btnDVDMenu.visible = false;
btnDVDResume.visible = false;
return;
}
// Viz or Plugin
UpdateVizTitle();
if( ( "VizView" == piDisplay.objectID ) || ( 1 < helper.viewPresetCount( piDisplay.objectID ) ) )
{
txtVizTitle2.visible = false;
btnDVDMenu.visible = false;
btnDVDResume.visible = false;
txtVizTitle.visible = true;
if( "VizView" == piDisplay.objectID )
{
btnVizPrev.upTooltip="res://wmploc/RT_STRING/#1842";
btnVizNext.upTooltip="res://wmploc/RT_STRING/#1843";
}
else
{
btnVizPrev.upTooltip="res://wmploc/RT_STRING/#1422";
btnVizNext.upTooltip="res://wmploc/RT_STRING/#1423";
}
btnVizPrev.accName = btnVizPrev.upTooltip;
btnVizNext.accName = btnVizNext.upTooltip;
}
else
{
txtVizTitle.visible = false;
btnDVDMenu.visible = false;
btnDVDResume.visible = false;
txtVizTitle2.visible = true;
}
}
function UpdateVizTitle()
{
var viewName;
var presetName;
if( "VizView" == piDisplay.objectID )
{
viewName = helper.effectFriendlyName( mediacenter.effectType );
presetName = helper.effectPresetName( mediacenter.effectType, mediacenter.effectPreset );
}
else
{
viewName = helper.viewFriendlyName( piDisplay.objectID );
presetName = helper.viewPresetName( piDisplay.objectID, mediacenter.displayPreset );
}
if (""!=presetName)
{
txtVizTitle.value = viewName + " : " + presetName;
}
else
{
txtVizTitle.value = viewName;
}
txtVizTitle2.value = txtVizTitle.value;
}
function PreviousDisplay()
{
if( "VizView" == piDisplay.objectID )
{
if (event.shiftKey)
{
mediacenter.vizRequest = VR_VIZ_PREV;
}
else
{
mediacenter.vizRequest = VR_PRESET_PREV;
}
}
else
{
var presetCount = helper.viewPresetCount( piDisplay.objectID );
var preset = mediacenter.displayPreset;
preset = preset - 1;
if( preset < 0 )
{
preset = presetCount - 1;
}
mediacenter.displayPreset = preset;
}
}
function NextDisplay()
{
if( "VizView" == piDisplay.objectID )
{
if (event.shiftKey)
{
mediacenter.vizRequest = VR_VIZ_NEXT;
}
else
{
mediacenter.vizRequest = VR_PRESET_NEXT;
}
}
else
{
var presetCount = helper.viewPresetCount( piDisplay.objectID );
var preset = mediacenter.displayPreset;
preset = preset + 1;
if( preset >= presetCount )
{
preset = 0;
}
mediacenter.displayPreset = preset;
}
}
function PreviousSettings()
{
var nIndex = MapSettingsToIndex( mediacenter.settingsView );
var nCurrentIndex = nIndex;
do
{
nIndex = nIndex - 1;
if( 0 > nIndex )
{
nIndex = g_rgSettings.length - 1;
}
mediacenter.settingsView = g_rgSettings[ nIndex ];
} while( ( MapSettingsToIndex( mediacenter.settingsView ) == nCurrentIndex ) && ( nCurrentIndex != nIndex ) );
}
function NextSettings()
{
var nIndex = MapSettingsToIndex( mediacenter.settingsView );
var nCurrentIndex = nIndex;
do
{
nIndex = nIndex + 1;
if( g_rgSettings.length <= nIndex )
{
nIndex = 0;
}
mediacenter.settingsView = g_rgSettings[ nIndex ];
} while( ( MapSettingsToIndex( mediacenter.settingsView ) == nCurrentIndex ) && ( nCurrentIndex != nIndex ) );
}
function UpdateResizeBars()
{
if( plMedia.visible && piMetadata.visible )
{
btnSResize.top = piMetadata.height;
btnSResize.height = g_SepWidth;
if( mediacenter.showResizeBars )
{
btnSResize.image = "res://wmploc/#1708";
}
else
{
btnSResize.image = "res://wmploc/#1709";
}
btnSResize.visible = true;
}
else
{
btnSResize.visible = false;
}
if( plMedia.visible || piMetadata.visible )
{
btnVResize.horizontalAlignment='left';
btnVResize.left = vMain.width - plMedia.width - g_SepWidth;
btnVResize.width = g_SepWidth;
btnVResize.horizontalAlignment='right';
if( mediacenter.showResizeBars )
{
btnVResize.image = "res://wmploc/#1706";
}
else
{
btnVResize.image = "res://wmploc/#1707";
}
btnVResize.visible = true;
}
else
{
btnVResize.visible = false;
}
if( svSettings.visible )
{
btnHResize.verticalAlignment='top';
btnHResize.top = svMain.height - g_ControlbarHeight - svSettings.height - g_SepHeight;
btnHResize.height = g_SepHeight;
btnHResize.verticalAlignment='bottom';
if( mediacenter.showResizeBars )
{
btnHResize.image = "res://wmploc/#1708";
}
else
{
btnHResize.image = "res://wmploc/#1709";
}
btnHResize.visible = true;
}
else
{
btnHResize.visible = false;
}
}
function UpdateFullScreenButton()
{
if( mediacenter.fullScreenAvailable && ( osMediaOpen == player.openState ) &&
( ( player.playState >= psPaused ) && ( player.playState <= psScanReverse ) ) )
{
btnFullScreen.enabled=true;
}
else
{
btnFullScreen.enabled=false;
}
}
function UpdateSettingsTitle()
{
var viewName = helper.viewFriendlyName( piSettings.objectID );
txtSettingsTitle.value = viewName;
}
function OnVResizeStart()
{
btnVResize.horizontalAlignment='left';
svSidebar.horizontalAlignment='left';
g_VResize=true;
}
function OnVResize(xPos)
{
var plLeft=xPos+g_SepWidth;
if(xPos<g_DisplayMinWidth)
{
xPos=g_DisplayMinWidth;
plLeft=xPos+g_SepWidth;
}
else if(vMain.width-plLeft<g_SidebarMinWidth)
{
plLeft=vMain.width-g_SidebarMinWidth;
xPos=plLeft-g_SepWidth;
}
else if(vMain.width-plLeft>g_SidebarMaxWidth)
{
plLeft=vMain.width-g_SidebarMaxWidth;
xPos=plLeft-g_SepWidth;
}
btnVResize.left = xPos;
btnVResize.width = g_SepWidth;
svMain.width = xPos;
svSidebar.left = plLeft;
svSidebar.width = vMain.width-plLeft;
vMain.updateWindow();
}
function OnVResizeEnd()
{
g_VResize=false;
btnVResize.horizontalAlignment='right';
svSidebar.horizontalAlignment='right';
mediacenter.playlistWidth=svSidebar.width;
mediacenter.metadataWidth=svSidebar.width;
}
function OnHResizeStart()
{
btnHResize.verticalAlignment='top';
svSettings.verticalAlignment='top';
g_HResize=true;
}
function OnHResize(yPos)
{
var plTop=yPos+g_SepHeight;
if(yPos<g_DisplayMinHeight)
{
yPos=g_DisplayMinHeight;
plTop=yPos+g_SepHeight;
}
else if(svMain.height-g_ControlbarHeight-plTop<g_SettingsMinHeight)
{
plTop=svMain.height-g_ControlbarHeight-g_SettingsMinHeight;
yPos=plTop-g_SepHeight;
}
else if(svMain.height-g_ControlbarHeight-plTop>g_SettingsMaxHeight)
{
plTop=svMain.height-g_ControlbarHeight-g_SettingsMaxHeight;
yPos=plTop-g_SepHeight;
}
btnHResize.top = yPos;
btnHResize.height = g_SepHeight;
svMedia.height=yPos;
svSettings.top=plTop;
svSettings.height=svMain.height-g_ControlbarHeight-plTop;
vMain.updateWindow();
}
function OnHResizeEnd()
{
g_HResize=false;
btnHResize.verticalAlignment='bottom';
svSettings.verticalAlignment='bottom';
mediacenter.settingsHeight=svSettings.height;
}
function OnSResizeStart()
{
g_SResize=true;
}
function OnSResize(yPos)
{
var plTop=yPos+g_SepHeight;
if(svSidebar.height-plTop<g_PlaylistMinHeight)
{
plTop=svSidebar.height-g_PlaylistMinHeight;
yPos=plTop-g_SepHeight;
}
if(yPos<g_MetadataMinHeight)
{
yPos=g_MetadataMinHeight;
plTop=yPos+g_SepHeight;
}
btnSResize.top = yPos;
btnSResize.height = g_SepHeight;
piMetadata.height=yPos;
plMedia.top=plTop;
plMedia.height=svSidebar.height-plTop;
vMain.updateWindow();
}
function OnSResizeEnd()
{
g_SResize=false;
mediacenter.metadataHeight=piMetadata.height;
}
function UpdateCustomize()
{
btnCustomize.enabled = mediacenter.showTitles || mediacenter.showPlaylist || mediacenter.showMetadata || mediacenter.showSettings || mediacenter.quickHide;
btnCustomize.downimage = btnCustomize.down ? "res://wmploc/#1730" : "res://wmploc/#1734";
btnCustomize.accName = btnCustomize.down ? btnCustomize.downTooltip : btnCustomize.upTooltip;
}
function CustomizeMenu()
{
mnuCustomize.top = btnCustomizeMenu.top+btnCustomizeMenu.height;
mnuCustomize.left = btnCustomizeMenu.left;
mnuCustomize.showEx( 3 );
}
function OnLinkRequest()
{
theme.CurrentViewID="vBrowser";
}
function OnBrowserLoad()
{
Browser1.SetProperty( "linkRequestParams", helper.linkRequestParams );
Browser1.SetProperty( "linkRequest", helper.linkRequest );
}
function OnBrowserBack()
{
Browser1.visible=false;
vBrowser.updateWindow();
theme.CurrentViewID="vMain";
}
function PlayingDVD()
{
return ( (player.currentPlaylist.count>0) && (player.currentPlaylist.item(0).sourceURL.indexOf("wmpdvd:")==0));
}
function MapSettingsToIndex( View )
{
for (var i = 0; i < g_rgSettings.length; i++)
{
if (View == g_rgSettings[i])
{
return( i );
}
}
return( -1 );
}