home *** CD-ROM | disk | FTP | other *** search
- var g_kTrackerHeight = 19;
- var g_kControlsHeight= 26;
- var g_kGotoBarHeight = 29;
- var g_kDisplayHeight = 74;
- var g_kStatusHeight = 24;
- var g_kCaptioningHeight = 89;
-
- var g_kTotalHeight = g_kTrackerHeight+g_kControlsHeight+g_kGotoBarHeight+g_kDisplayHeight+g_kStatusHeight+g_kCaptioningHeight;
-
- var g_kMinVolumeWidth_NoPositionControls = 91;
- var g_kMinVolumeWidth_PositionControls = 222;
-
- function DetermineAudioVisible()
- {
- if (!ScriptObjects.wmpdxm.ShowAudioControls) return false;
- if (ScriptObjects.wmpdxm.ShowPositionControls)
- {
- return (view.width >= g_kMinVolumeWidth_PositionControls);
- }
- else
- {
- return (view.width >= g_kMinVolumeWidth_NoPositionControls);
- }
- }
-
- function CalculateAudioLeft()
- {
- if (PositionControls.visible)
- {
- return Math.max (PositionControls.left + PositionControls.width + 1, view.width-AudioControls.width);
- }
- else
- {
- return Math.max (TransportControls.width + 1, view.width-AudioControls.width);
- }
- }
-
- function UpdateUI()
- {
- var dxm = ScriptObjects.wmpdxm;
- var hideVideo = ( dxm.TransparentAtStart && ((player.playState==psStopped)||(player.playState==psUndefined)));
- vid.visible = !hideVideo;
- view.backgroundColor = hideVideo ? "none" : "#000000";
- Tracker.visible = dxm.ShowControls && dxm.ShowTracker;
- seek.enabled = dxm.EnableTracker;
- ControlsParent.visible = dxm.ShowControls;
- GotoBar.visible = dxm.ShowGotoBar;
- Display.visible = dxm.ShowDisplay;
- Status.visible = dxm.ShowStatusBar;
- PositionControls.visible= dxm.ShowPositionControls;
- AudioControls.visible = DetermineAudioVisible();
- AudioControls.left = CalculateAudioLeft();
- Captioning.visible = dxm.ShowCaptioning;
-
- var originalVideoHeight = view.height - AllControls.height;
- AllControls.visible = false;
- AllControls.height = g_kTotalHeight;
- var accumulatedHeight = 0;
-
- if (Captioning.visible) accumulatedHeight += g_kCaptioningHeight;
-
- Tracker.top = accumulatedHeight;
- if (Tracker.visible) accumulatedHeight += g_kTrackerHeight;
-
- ControlsParent.top = accumulatedHeight;
- if (ControlsParent.visible) accumulatedHeight += g_kControlsHeight;
-
- GotoBar.top = accumulatedHeight;
- if (GotoBar.visible) accumulatedHeight += g_kGotoBarHeight;
-
- Display.top = accumulatedHeight;
- if (Display.visible) accumulatedHeight += g_kDisplayHeight;
-
- Status.top = accumulatedHeight;
- if (Status.visible) accumulatedHeight += g_kStatusHeight;
-
- AllControls.height=accumulatedHeight;
- VideoSubview.height = Math.max( 0, (view.height-accumulatedHeight));
- AllControls.top = (view.height-accumulatedHeight);
- AllControls.visible=true;
-
- view.height = originalVideoHeight + AllControls.height;
- }
- function OnWMPDXMOpenStateChange(NewState)
- {
- if (NewState==osMediaOpen)
- {
- UpdateDisplay();
-
- if (player.currentMedia.ImageSourceWidth > 0)
- {
- // Resize layout to match the video size
- view.height = player.currentMedia.ImageSourceHeight + AllControls.height;
-
- // clip to the transport controls width
- if ((0 == AllControls.width) || (player.currentMedia.ImageSourceWidth > view.width))
- {
- view.width = player.currentMedia.ImageSourceWidth;
- }
- }
- else
- {
- view.height = AllControls.height;
- view.width = AllControls.width;
- }
- }
- }
-
- function UpdateDisplay()
- {
- show.value=player.currentPlaylist.name;
- title.value=player.currentMedia.getItemInfo("Title");
- author.value=player.currentMedia.getItemInfo("Author");
- copyright.value=player.currentMedia.getItemInfo("Copyright");
- }
-
- //BUGBUGBUG -- DEBUG DEBUG DEBUG REMOVE REMOVE REMOVE-------//|
- if (theme.loadPreference("debug")=="RockOn") //|
- { //|
- freak(); //|
- var f=0; //|
- } //|
- else //|
- { //|
- theme.savePreference("debug","Not Rocking Onward"); //|
- } //|
- //DEBUG DEBUG DEBUG REMOVE REMOVE REMOVE BEFORE SHIPPING----//|
-
-
-
- function PlayButtonClick(event)
- {
- if( (player.playState==psPaused) && (event.ctrlKey) && player.controls.isAvailable('step') )
- {
- if (event.shiftKey)
- {
- player.controls.step(-1);
- }
- else
- {
- player.controls.step(1);
- }
- }
- else
- {
- g_SetPlayPauseFocus=true;
- player.controls.play();
- }
- }
-
- var g_lastVolume=0;
-
- function Init()
- {
- ScriptObjects.OnUpdateUI = UpdateUI;
- UpdateUI();
- OnOpenStateChangeTransport(player.openState);
- OnPlayStateChangeTransport(player.playState);
- OnStatusChangeTransport(player.status);
- OnWMPDXMOpenStateChange(player.openState);
- g_lastVolume = player.settings.volume;
- }
-
- function GetOffsetPositionText()
- {
- if (player.controls.currentPositionString=="") return "";
-
- var offset = ScriptObjects.StartTime;
- var ps = ScriptObjects.getTimeString(offset + player.controls.currentPosition);
-
- var ds = "";
-
- if (player.openState==osMediaOpen)
- {
- var dur = player.currentMedia.duration + offset;
- if (dur>0)
- {
- ds = ScriptObjects.getTimeString(dur);
- }
- }
-
- var newvalue;
- if (ds != "")
- {
- var args = new Array(ps,ds);
- newvalue = g_kPositionFormatString.sprintf(g_kPositionFormatString,args);
- }
- else
- {
- newvalue = ps;
- }
- return newvalue;
- }
-
-