home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2002 September (Special)
/
Chip-Special_2002-09_Digitalni-Video.bin
/
servis
/
wm9
/
mpsetupXP.exe
/
RCDATA
/
CABINET
/
wmploc.DLL
/
256
/
136
< prev
next >
Wrap
Text File
|
2002-08-19
|
11KB
|
479 lines
// Windows Media Player - Copyright 2000 Microsoft Corporation.
//<script>
var g_kAlphaToTime = 330;
var g_kAlphaDisabled = 0x80;
var g_kSplineTensionMedium = 3;
var g_kSplineTensionTight = 9;
function InitEQ()
{
if (PlayingDVD())
{
nextPreset.enabled=false;
eqOnOffButton.enabled=false;
}
else
{
eqOnOffButton.enabled=true;
UpdateEQOnOff();
}
}
function UpdateEQOnOff()
{
if (eq.bypass == true)
{
nextPreset.enabled=false;
eqOnOffLabel.value="res://wmploc.dll/RT_STRING/#1851";
}
else
{
nextPreset.enabled=true;
eqOnOffLabel.value="res://wmploc.dll/RT_STRING/#1846";
}
}
function InitSRS()
{
if (PlayingDVD())
{
nextSpeakerSize.enabled=false;
srsOnOffButton.enabled=false;
}
else
{
srsOnOffButton.enabled=true;
UpdateSRSOnOff();
}
}
function UpdateSRSOnOff()
{
if (eq.enhancedAudio == true)
{
nextSpeakerSize.enabled=true;
srsOnOffLabel.value="res://wmploc.dll/RT_STRING/#1846";
}
else
{
nextSpeakerSize.enabled=false;
srsOnOffLabel.value="res://wmploc.dll/RT_STRING/#1851";
}
}
function NextSpeakerSize()
{
var index = eq.speakerSize;
index++;
if (index > 2)
index = 0;
eq.speakerSize = index;
}
function ResetVideoSettings()
{
vs.brightness=0;
vs.contrast=0;
vs.hue=0;
vs.saturation=0;
}
function InitMetaDataDisplay()
{
var MediaInfoURL;
if(player.isOnline)
{
if(player.OpenState == osMediaOpen)
{
MediaInfoURL = mediacenter.getNamedString("NPMetaDataURL_ONLINE");
var TOC = player.currentMedia.GetItemInfo("TOC");
if(TOC)
{
MediaInfoURL = MediaInfoURL + TOC;
}
}
else
{
MediaInfoURL = "about:<body bgcolor=black scroll=no>";
}
}
else
{
MediaInfoURL = mediacenter.getNamedString("NPMetaDataURL_OFFLINE");
}
Browser1.URL = MediaInfoURL;
}
function CaptionsView_OnOpenStateChangeEvent()
{
switch (player.OpenState)
{
case osMediaChanging:
ClearSamiDisplay();
break;
}
}
function LyricsView_OnOpenStateChangeEvent()
{
switch (player.openState)
{
case osMediaOpen:
var Lyrics = player.currentMedia.GetItemInfo("Lyrics");
ShowLyrics(Lyrics);
break;
case osMediaChanging:
ShowLyrics("");
break;
}
}
function ShowLyrics(Param)
{
Browser1.showLyrics(Param);
}
function MetaDataView_OnOpenStateChangeEvent()
{
switch (player.OpenState)
{
case osMediaOpen:
InitMetaDataDisplay();
break;
}
}
function SwitchView(viewID)
{
mediacenter.settingsView = viewID; // tell media center about the change
theme.CurrentViewID = viewID; // switch to this view
}
function InitSamiDisplay()
{
Browser1.loadSpecialPage("SAMI");
}
function InitLyricsDisplay()
{
Browser1.loadSpecialPage("Lyrics");
}
function ClearSamiDisplay()
{
handleScriptCommand("Text", "");
}
function handleScriptCommand(scType, Param)
{
scType = scType.toUpperCase();
if(scType == "TEXT" || scType == "<SYNC" || scType == "CAPTION")
{
Browser1.showSAMIText(Param);
}
}
function InitVideoSettingsView()
{
if ( PlayingDVD() )
{
videoResetButton.enabled = false;
videoResetButton.alphaBlendTo(0x80,330);
}
else
{
videoResetButton.enabled = true;
videoResetButton.alphaBlendTo(0xff,330);
}
}
function OnOpenStateChangeEvent(NewState, pfnHandler)
{
switch (NewState)
{
case osPlaylistOpenNoMedia:
case osMediaOpen:
pfnHandler();
break;
}
}
var g_SRSViewTitle = theme.loadString("res://wmploc.dll/RT_STRING/#1827");
var g_EQViewTitle = theme.loadString("res://wmploc.dll/RT_STRING/#1848");
var g_VideoSettingsTitle = theme.loadString("res://wmploc.dll/RT_STRING/#1849");
var g_WindowsMediaInfoTitle = theme.loadString("res://wmploc.dll/RT_STRING/#1821");
var g_CaptionsTitle = theme.loadString("res://wmploc.dll/RT_STRING/#1850");
var g_LyricsTitle = theme.loadString("res://wmploc.dll/RT_STRING/#1867");
var g_AdvancedVideoSettingsTitle = theme.loadString("res://wmploc.dll/RT_STRING/#1852");
function InitViewSelectionPopup()
{
ViewSelectPopup.appendItem(g_SRSViewTitle);
ViewSelectPopup.appendItem(g_EQViewTitle);
ViewSelectPopup.appendItem(g_VideoSettingsTitle);
ViewSelectPopup.appendItem(g_WindowsMediaInfoTitle);
ViewSelectPopup.appendItem(g_CaptionsTitle);
ViewSelectPopup.appendItem(g_LyricsTitle);
if ( player.DVD.isAvailable("DVDDecoder") )
{
ViewSelectPopup.appendItem(g_AdvancedVideoSettingsTitle);
}
}
var g_viewNames = new Array
(
"SRSView",
"EQView",
"VideoSettingsView",
"MetaDataView",
"CaptionsView",
"LyricsView",
"AdvancedVideoSettingsView"
);
function ViewPopupSelect(index)
{
if (g_viewNames[index]=="MetaDataView")
{
if((false==player.isOnline) || PlayingDVD())
{
SwitchView("OfflineMetaDataView");
return;
}
}
SwitchView(g_viewNames[index]);
}
function InitEQSelectionPopup()
{
var max = eq.presetCount;
for (var index=0; index<max; index++)
{
EQSelectPopup.appendItem(eq.presetTitle(index));
}
}
function EQPopupSelect(index)
{
eq.currentPreset = index;
}
function CheckForDVD()
{
if (PlayingDVD())
{
BtnNextFrame.enabled=true;
JogShuttleSubTransport.enabled=true;
JogShuttleSlider.passThrough=false;
NextFrameSub.alphaBlend=0xFF;
JogShuttleSub.alphaBlend=0xFF;
}
else
{
BtnNextFrame.enabled=false;
JogShuttleSubTransport.enabled=false;
JogShuttleSlider.passThrough=true;
NextFrameSub.alphaBlend=0x80;
JogShuttleSub.alphaBlend=0x80;
}
}
var g_kMaxDVDRate=16;
function GetNonlinearRate(sliderval)
{
var temp = sliderval * sliderval * sliderval * g_kMaxDVDRate;
return temp;
}
function SetSlider(rate)
{
var sign = (rate<0) ? -1 : 1;
JogShuttleSlider.value = sign * Math.pow(Math.abs(rate/g_kMaxDVDRate),1/3);
JogShuttleSlider.toolTip = rate;
}
function GetSliderTooltip(sliderval)
{
var floatval = GetNonlinearRate(sliderval);
if ( (0.8<floatval)&&(floatval<1.2) )
{
return "1.0";
}
var stringval = floatval.toString();
var decimalPosition = stringval.indexOf(".");
if(decimalPosition!=-1)
{
var sigfigs = (Math.abs(floatval) > 0.2) ? 2 : 4;
stringval = stringval.slice(0,decimalPosition+sigfigs);
}
return stringval;
}
function SetRate(sliderval)
{
var stringval = GetSliderTooltip(sliderval);
var floatval = parseFloat(stringval);
if (floatval)
{
player.settings.rate = floatval;
}
else SetSlider(player.settings.rate);
}
var g_Zoom50 = theme.loadString("res://wmploc.dll/RT_STRING/#1134");
var g_Zoom100 = theme.loadString("res://wmploc.dll/RT_STRING/#1135");
var g_Zoom200 = theme.loadString("res://wmploc.dll/RT_STRING/#1136");
var g_ZoomCustom = theme.loadString("res://wmploc.dll/RT_STRING/#1133");
function InitZoomPopup()
{
ZoomPopup.appendItem(g_Zoom50);
ZoomPopup.appendItem(g_Zoom100);
ZoomPopup.appendItem(g_Zoom200);
ZoomPopup.appendItem(g_ZoomCustom);
}
function ZoomPopupSelect(index)
{
if (index==3)
{
mediacenter.videoStretchToFit=true;
}
else
{
mediacenter.videoStretchToFit=false;
switch (index)
{
case 0:
mediacenter.videoZoom=50;
break;
case 1:
mediacenter.videoZoom=100;
break;
case 2:
mediacenter.videoZoom=200;
break;
}
}
}
function getZoomText()
{
if (mediacenter.videoStretchToFit)
{
return g_ZoomCustom;
}
else
{
switch (mediacenter.videoZoom)
{
case 50:
return g_Zoom50;
case 100:
return g_Zoom100;
case 200:
return g_Zoom200;
default:
return g_ZoomCustom;
}
}
}
function PersistSettings()
{
if (eq.enableSplineTension)
{
theme.savePreference('splineTension',eq.splineTension);
}
else
{
theme.savePreference('splineTension','disabled');
}
}
function InitPersistedSettings()
{
var st = theme.loadPreference('splineTension');
if (st=='--')
{
eq.enableSplineTension=true;
eq.splineTension=g_kSplineTensionMedium;
}
else
{
if (st=="disabled")
{
eq.enableSplineTension=false;
}
else
{
eq.enableSplineTension=true;
eq.splineTension=parseInt(st);
}
}
stDisable.down = !eq.enableSplineTension;
stMedium.down = (eq.enableSplineTension) && (eq.splineTension == g_kSplineTensionMedium);
stTight.down = (eq.enableSplineTension) && (eq.splineTension == g_kSplineTensionTight);
}
function UpdateSplineTensionButtons()
{
with (eq)
{
stDisable.down = !enableSplineTension;
if (!enableSplineTension)
{
stMedium.down=false;
stTight.down=false;
}
else
{
stMedium.down = (splineTension==g_kSplineTensionMedium);
stTight.down = (splineTension==g_kSplineTensionTight);
}
}
}
function DoShiftSensitiveEQ(level,newVal)
{
if (eq.enableSplineTension && event.shiftKey)
{
eq.enableSplineTension=false;
eq.gainLevels(level) = newVal;
eq.enableSplineTension=true;
}
}
function SwitchToOfflineIfNecessary()
{
if ( (false==player.isOnline) || (PlayingDVD()) )
{
SwitchView("OfflineMetaDataView");
}
}
function PlayingDVD()
{
return ( (player.currentPlaylist.count>0) && (player.currentPlaylist.item(0).sourceURL.indexOf("wmpdvd:")==0));
}