home *** CD-ROM | disk | FTP | other *** search
/ Minami 79 / MINAMI79.iso / Extra / MPSetup.exe / 1033 / RCDATA / CABINET / wmploc.DLL / 256 / 4013 < prev    next >
Text File  |  2002-12-14  |  4KB  |  139 lines

  1. // Windows Media Player  - Copyright 2000 Microsoft Corporation.
  2. //<script>
  3.  
  4. var g_tracktimeTextWidth=0;
  5. var g_kNonCaptionsHeight = 100;
  6. var g_kCaptionsHeight    = g_kNonCaptionsHeight + mediacenter.captionsHeight;
  7.  
  8. var g_SetPlayPauseFocus=false;
  9.  
  10. function Init()
  11. {
  12.     UpdateVizTitle(); 
  13.     LayoutMarquee(); 
  14.     OnOpenStateChange(player.openState); 
  15.     OnOpenStateChangeTransport(player.openState); 
  16.     OnPlayStateChangeTransport(player.playState);
  17.     ShowStatus(player.status);
  18.     if(player.dvd.isAvailable('dvd'))
  19.     {
  20.         UpdateDVDControls();
  21.     }
  22.     SyncFFWDButtonToRate(player.settings.rate);
  23. }
  24.  
  25. function OnOpenStateChange(NewState)
  26. {
  27.     if(NewState==osMediaOpen)
  28.     {
  29.         g_fCaptionsDetected=false;
  30.         txtVizTitle.visible=player.currentMedia.imageSourceHeight==0;
  31.         UpdateCaptions();
  32.         UpdateDVDControls();
  33.     }
  34. }
  35.  
  36. function PreviousDisplay()
  37. {
  38.     mediacenter.vizRequest = VR_PRESET_PREV;
  39. }
  40.  
  41. function NextDisplay()
  42. {
  43.     mediacenter.vizRequest = VR_PRESET_NEXT;
  44. }
  45.  
  46. function LayoutMarquee()
  47. {
  48.     g_tracktimeTextWidth = tracktime.textwidth;
  49.  
  50.     var margin=parseInt(theme.loadString("res://wmploc/RT_STRING/#1272"));
  51.  
  52.     tracktime.horizontalAlignment='left'; 
  53.     tracktime.left = svMarquee.width - tracktime.textwidth;
  54.     tracktime.horizontalAlignment='right';
  55.  
  56.     try
  57.     {
  58.         metadata.width = svMarquee.width - tracktime.textwidth - margin - metadata.left;
  59.     }
  60.     catch(err){}
  61. }
  62.  
  63. function dummybutton()
  64. {
  65.     this.down = false;
  66. }
  67. //main app and fullscreen have new super ffwd buttons (ffwd_multi), but they need
  68. //a dummy button to keep transport.js from freaking out
  69. var ffwd = new dummybutton();
  70.  
  71.  
  72. function UpdateVizTitle()
  73. {
  74.     var viewName = helper.effectFriendlyName( mediacenter.effectType );
  75.     var presetName = helper.effectPresetName( mediacenter.effectType, mediacenter.effectPreset );
  76.     if (""!=presetName)
  77.     {
  78.         txtVizTitle.value = viewName + " : " + presetName;
  79.     }
  80.     else
  81.     {
  82.         txtVizTitle.value = viewName;
  83.     }
  84. }
  85.  
  86. //=====================================================
  87. //  SAMI
  88. //=====================================================
  89. var g_fCaptionsDetected = mediacenter.showCaptions && helper.captionsAvailable;
  90.  
  91. function handleScriptCommand(scType, Param)
  92. {
  93.     scType = scType.toUpperCase();
  94.  
  95.     if(scType == "TEXT" ||  scType == "<SYNC" || scType == "CAPTION")
  96.     {
  97.         g_fCaptionsDetected = mediacenter.showCaptions;
  98.     }
  99. }
  100.  
  101. function UpdateCaptions()
  102. {
  103.     g_fCaptionsDetected = (mediacenter.showCaptions && helper.captionsAvailable && !PlayingDVD());
  104.     SetCaptions(g_fCaptionsDetected);
  105. }
  106.  
  107. function SetCaptions(visible)
  108. {
  109.     if (!visible) piCaptions.visible = false; 
  110.     view.height = visible ? g_kCaptionsHeight : g_kNonCaptionsHeight;
  111.     if (visible) piCaptions.visible  = true;
  112. }
  113.  
  114. function GetViewHeight()
  115. {
  116.     if (mediacenter.showCaptions && (g_fCaptionsDetected||helper.captionsAvailable) )
  117.     {
  118.         g_fCaptionsDetected=true;
  119.         return g_kCaptionsHeight;
  120.     }
  121.     return g_kNonCaptionsHeight;
  122. }
  123.  
  124. function PlayingDVD()
  125. {
  126.     return ( (player.currentPlaylist.count>0) && (player.currentPlaylist.item(0).sourceURL.indexOf("wmpdvd:")==0));
  127. }
  128.  
  129. function UpdateDVDControls()
  130. {
  131.     if (PlayingDVD())
  132.     {
  133.         txtVizTitle.visible = false;
  134.         btnDVDMenu.visible =  ( ("videoManagerMenu" != player.dvd.domain) && ("videoTitleSetMenu" != player.dvd.domain) ); 
  135.         btnDVDResume.visible = !btnDVDMenu.visible;
  136.     }
  137. }
  138.  
  139.