home *** CD-ROM | disk | FTP | other *** search
/ The VPRO Digital Guide 1994 / vpro.iso / vpro1 / shared.dir / 01702_QTControl.ls < prev    next >
Encoding:
Text File  |  1994-08-28  |  13.7 KB  |  495 lines

  1. on MediaControl
  2.   global gMediaType
  3.   if gMediaType = "Moov" then
  4.     set the visible of sprite 46 to 0
  5.     QTControl()
  6.   else
  7.     if gMediaType = "AIFF" then
  8.       set the visible of sprite 46 to 1
  9.       SoundControl()
  10.     else
  11.       alert("Sorry er is niets te zien of te horen")
  12.     end if
  13.   end if
  14. end
  15.  
  16. on QTControl
  17.   global ToParse, Chars1and2, Chars1to3, Char3, Chars4and5, gMedConOffsetH, gMedConOffsetV, gSpecNav, gHelper, QTVolume, CurMoovSprite, volSliderMin, volSliderScale
  18.   set H to the mouseH - gMedConOffsetH
  19.   set V to the mouseV - gMedConOffsetV
  20.   if (the movieName <> "ZP.DIR") and (the movieName <> "KL.DIR") and (the movieName <> "MD.DIR") then
  21.     gettheMarker()
  22.   end if
  23.   set gHelper to 0
  24.   if V < 30 then
  25.     if H < 30 then
  26.       playMoovFW()
  27.       exit
  28.     end if
  29.     if (H > 30) and (H < 50) then
  30.       pauseMoov()
  31.       exit
  32.     end if
  33.     if H > 50 then
  34.       ToggleQTLoop()
  35.       exit
  36.     end if
  37.   else
  38.     if (V > 30) and (V < 60) then
  39.       if H < 22 then
  40.         PlayMoovBWFast()
  41.         exit
  42.       end if
  43.       if (H > 22) and (H < 40) then
  44.         stepMoovBW()
  45.         exit
  46.       end if
  47.       if (H > 40) and (H < 58) then
  48.         stepMoovFW()
  49.         exit
  50.       end if
  51.       if H > 58 then
  52.         playMoovFF()
  53.         exit
  54.       end if
  55.     else
  56.       UpdateVolume()
  57.     end if
  58.   end if
  59. end
  60.  
  61. on InitQTcontrol
  62.   global moovLength, sliderStart, sliderEnd, moovSliderScale, VolSliderMax, volSliderMin, QTVolume, volSliderScale, CurMoovSprite, gMediaType
  63.   set gMediaType to "Moov"
  64.   set moovLength to the duration of cast the castNum of sprite integer(CurMoovSprite)
  65.   set sliderStart to the left of sprite 44 + 2
  66.   set sliderEnd to the right of sprite 44 - 5
  67.   set moovSliderScale to moovLength / (sliderEnd - sliderStart)
  68.   set VolSliderMax to the right of sprite 44 - 3
  69.   set volSliderMin to the left of sprite 44 + 4
  70.   set volSliderScale to 255.0 / (VolSliderMax - volSliderMin)
  71.   set the constraint of sprite 45 to 44
  72.   set the locV of sprite 45 to 472
  73.   set the locH of sprite 45 to VolSliderMax - 3
  74.   set QTVolume to the locH of sprite 45
  75.   updateStage()
  76. end
  77.  
  78. on QTEnterFrameScript
  79.   global moovLength, QTVolume, gMediaType
  80.   puppetSprite(45, 1)
  81.   DispQTControls()
  82.   set the constraint of sprite 45 to 44
  83.   if not (the controlDown) then
  84.     set the locH of sprite 45 to QTVolume
  85.   else
  86.     updateVidShuttle()
  87.   end if
  88.   if moovLength = EMPTY then
  89.     InitQTcontrol()
  90.   end if
  91. end
  92.  
  93. on QTFaderScriptMouseDown
  94.   repeat while the stillDown
  95.     if the controlDown then
  96.       ShuttleSlider()
  97.       next repeat
  98.     end if
  99.     VolumeControl()
  100.   end repeat
  101. end
  102.  
  103. on QTFaderScriptMouseUp
  104.   global CurMoovSprite, volSliderMin, volSliderScale
  105.   if not (the controlDown) then
  106.     set the volume of sprite integer(CurMoovSprite) to (the locH of sprite 45 - volSliderMin) * volSliderScale
  107.   end if
  108. end
  109.  
  110. on UpdateVolume
  111.   global QTVolume, CurMoovSprite, volSliderMin, volSliderScale
  112.   if the mouseH > 637 then
  113.     set the locH of sprite 45 to 637
  114.   else
  115.     if the mouseH < 565 then
  116.       set the locH of sprite 45 to 564
  117.     else
  118.       set the locH of sprite 45 to the mouseH
  119.     end if
  120.   end if
  121.   set QTVolume to the locH of sprite 45
  122.   set the locV of sprite 45 to 472
  123.   updateStage()
  124.   set the volume of sprite integer(CurMoovSprite) to (the locH of sprite 45 - volSliderMin) * volSliderScale
  125. end
  126.  
  127. on updateVidShuttle
  128.   global moovLength, sliderStart, moovSliderScale, CurMoovSprite
  129.   set sliderMover to (the movieTime of sprite integer(CurMoovSprite) / moovSliderScale) + sliderStart
  130.   if sliderMover > 637 then
  131.     set sliderMover to 637
  132.   else
  133.     set the locH of sprite 45 to sliderMover
  134.   end if
  135.   set the locV of sprite 45 to 472
  136.   updateStage()
  137. end
  138.  
  139. on stepMoovBW
  140.   global CurMoovSprite
  141.   if voidp(CurMoovSprite) or (CurMoovSprite = EMPTY) then
  142.     set CurMoovSprite to 30
  143.   end if
  144.   set the movieRate of sprite integer(CurMoovSprite) to 0
  145.   set the movieTime of sprite integer(CurMoovSprite) to the movieTime of sprite integer(CurMoovSprite) - 10
  146. end
  147.  
  148. on playMoovBW
  149.   global CurMoovSprite
  150.   if voidp(CurMoovSprite) or (CurMoovSprite = EMPTY) then
  151.     set CurMoovSprite to 30
  152.   end if
  153.   set the movieRate of sprite integer(CurMoovSprite) to -1
  154. end
  155.  
  156. on PlayMoovBWFast
  157.   global CurMoovSprite
  158.   if voidp(CurMoovSprite) or (CurMoovSprite = EMPTY) then
  159.     set CurMoovSprite to 30
  160.   end if
  161.   set the movieRate of sprite integer(CurMoovSprite) to -2
  162. end
  163.  
  164. on pauseMoov
  165.   global CurMoovSprite
  166.   if (the castNum of sprite integer(CurMoovSprite) <> 0) and (the castNum of sprite integer(CurMoovSprite) <> -1) then
  167.     if the castType of cast the castNum of sprite integer(CurMoovSprite) = #digitalVideo then
  168.       set the movieRate of sprite integer(CurMoovSprite) to 0
  169.     end if
  170.   end if
  171. end
  172.  
  173. on playMoovFW
  174.   global CurMoovSprite
  175.   if voidp(CurMoovSprite) or (CurMoovSprite = EMPTY) then
  176.     set CurMoovSprite to 30
  177.   end if
  178.   set CurMoovSprite to integer(CurMoovSprite)
  179.   if (the castNum of sprite CurMoovSprite <> 0) and (the castNum of sprite CurMoovSprite <> -1) then
  180.     if the castType of cast the castNum of sprite CurMoovSprite = #digitalVideo then
  181.       if the movieTime of sprite CurMoovSprite = the stopTime of sprite CurMoovSprite then
  182.         set the movieTime of sprite CurMoovSprite to the startTime of sprite CurMoovSprite
  183.       end if
  184.       if chars(the movieName, 1, 2) = "JG" then
  185.         set the volume of sprite 30 to 255
  186.       end if
  187.       if the movieRate of sprite CurMoovSprite <> 1 then
  188.         set the movieRate of sprite CurMoovSprite to 1
  189.       end if
  190.     end if
  191.   end if
  192. end
  193.  
  194. on playMoovFF
  195.   global CurMoovSprite
  196.   if voidp(CurMoovSprite) or (CurMoovSprite = EMPTY) then
  197.     set CurMoovSprite to 30
  198.   end if
  199.   set the movieRate of sprite integer(CurMoovSprite) to 2
  200. end
  201.  
  202. on stepMoovFW
  203.   global CurMoovSprite
  204.   if voidp(CurMoovSprite) or (CurMoovSprite = EMPTY) then
  205.     set CurMoovSprite to 30
  206.   end if
  207.   set the movieRate of sprite integer(CurMoovSprite) to 0
  208.   set the movieTime of sprite integer(CurMoovSprite) to the movieTime of sprite integer(CurMoovSprite) + 12
  209. end
  210.  
  211. on ToggleQTLoop
  212.   global CurMoovSprite
  213.   if voidp(CurMoovSprite) or (CurMoovSprite = EMPTY) then
  214.     set CurMoovSprite to 30
  215.   end if
  216.   set the loop of cast the castNum of sprite integer(CurMoovSprite) to not (the loop of cast the castNum of sprite integer(CurMoovSprite))
  217. end
  218.  
  219. on ShuttleSlider
  220.   global moovLength, sliderStart, sliderEnd, moovSliderScale, CurMoovSprite
  221.   repeat while the mouseDown and the controlDown
  222.     set originalMovieRate to the movieRate of sprite integer(CurMoovSprite)
  223.     set the movieRate of sprite integer(CurMoovSprite) to 0
  224.     repeat while the stillDown
  225.       if the mouseH > 637 then
  226.         set the locH of sprite 45 to 637
  227.       else
  228.         if the mouseH < 565 then
  229.           set the locH of sprite 45 to 564
  230.         else
  231.           set the locH of sprite 45 to the mouseH
  232.         end if
  233.       end if
  234.       set the movieTime of sprite integer(CurMoovSprite) to (the locH of sprite 45 - sliderStart) * moovSliderScale
  235.       updateStage()
  236.     end repeat
  237.   end repeat
  238.   set the movieRate of sprite integer(CurMoovSprite) to originalMovieRate
  239. end
  240.  
  241. on VolumeControl
  242.   global volSliderScale, volSliderMin, QTVolume, CurMoovSprite
  243.   puppetSprite(45, 1)
  244.   set the castNum of sprite 45 to the number of cast "fader"
  245.   set the locH of sprite 45 to QTVolume
  246.   updateStage()
  247.   repeat while the stillDown
  248.     UpdateVolume()
  249.   end repeat
  250.   updateStage()
  251.   set QTVolume to the locH of sprite 45
  252. end
  253.  
  254. on SoundControl
  255.   global curSoundName, SoundVolume, gMediaType, gMedConOffsetH, gMedConOffsetV, gSpecNav, volSliderMin, volSliderScale, gSoundLoop
  256.   set H to the mouseH - gMedConOffsetH
  257.   set V to the mouseV - gMedConOffsetV
  258.   set gHelper to 0
  259.   if V < 30 then
  260.     if H < 30 then
  261.       if the number of cast curSoundName = -1 then
  262.         sound playFile 1, curSoundName
  263.         exit
  264.       else
  265.         puppetSound(curSoundName)
  266.         exit
  267.       end if
  268.     end if
  269.     if (H > 30) and (H < 50) then
  270.       if soundBusy(1) then
  271.         sound stop 1
  272.       end if
  273.       puppetSound(0)
  274.       set gSoundLoop to 0
  275.       exit
  276.     end if
  277.     if H > 50 then
  278.       ToggleSoundLoop()
  279.       exit
  280.     end if
  281.   else
  282.     UpdateSoundLevel()
  283.   end if
  284. end
  285.  
  286. on InitSoundControl
  287.   global sliderStart, sliderEnd, VolSliderMax, volSliderMin, SoundVolume, volSliderScale, curSoundName, gMediaType
  288.   set gMediaType to "AIFF"
  289.   set VolSliderMax to the right of sprite 44 - 3
  290.   set volSliderMin to the left of sprite 44 + 4
  291.   set volSliderScale to 255.0 / (VolSliderMax - volSliderMin)
  292.   set the constraint of sprite 45 to 44
  293.   set the locV of sprite 45 to 472
  294.   set the locH of sprite 45 to VolSliderMax - 3
  295.   set SoundVolume to the locH of sprite 45
  296.   set the visible of sprite 46 to 1
  297.   puppetSprite(45, 1)
  298.   updateStage()
  299. end
  300.  
  301. on SoundEnterFrameScript
  302.   global curSoundName, SoundVolume, gMediaType, gSoundLoop
  303.   set gMediaType to "AIFF"
  304.   puppetSprite(45, 1)
  305.   set the constraint of sprite 45 to 44
  306.   set the locH of sprite 45 to SoundVolume
  307.   set the locV of sprite 45 to 472
  308.   DispAudioControls()
  309.   if (gSoundLoop = 1) and (soundBusy(1) = 0) then
  310.     if the number of cast curSoundName = -1 then
  311.       sound playFile 1, curSoundName
  312.       exit
  313.     else
  314.       puppetSound(curSoundName)
  315.       exit
  316.     end if
  317.   end if
  318.   if voidp(curSoundName) then
  319.     InitSoundControl()
  320.   end if
  321. end
  322.  
  323. on SoundFaderMouseDown
  324.   repeat while the stillDown
  325.     SoundLevelControl()
  326.   end repeat
  327. end
  328.  
  329. on SoundFaderMouseUp
  330.   global curSoundName, volSliderMin, volSliderScale
  331.   set the volume of sound 1 to (the locH of sprite 45 - volSliderMin) * volSliderScale
  332. end
  333.  
  334. on SoundLevelControl
  335.   global volSliderScale, volSliderMin, curSoundName, SoundVolume, FaderCastNum
  336.   puppetSprite(45, 1)
  337.   set the castNum of sprite 45 to FaderCastNum
  338.   set the locH of sprite 45 to SoundVolume
  339.   updateStage()
  340.   repeat while the stillDown
  341.     UpdateSoundLevel()
  342.   end repeat
  343.   updateStage()
  344.   puppetSprite(45, 0)
  345.   set SoundVolume to the locH of sprite 45
  346. end
  347.  
  348. on UpdateSoundLevel
  349.   global curSoundName, volSliderMin, volSliderScale, SoundVolume
  350.   if the mouseH > 637 then
  351.     set the locH of sprite 45 to 637
  352.   else
  353.     if the mouseH < 565 then
  354.       set the locH of sprite 45 to 564
  355.     else
  356.       set the locH of sprite 45 to the mouseH
  357.     end if
  358.   end if
  359.   set SoundVolume to the locH of sprite 45
  360.   set the locV of sprite 45 to 472
  361.   updateStage()
  362.   set the volume of sound 1 to (the locH of sprite 45 - volSliderMin) * volSliderScale
  363. end
  364.  
  365. on ToggleSoundLoop
  366.   global gSoundLoop, curSoundName
  367.   if gSoundLoop = 1 then
  368.     set gSoundLoop to 0
  369.     sound stop 1
  370.   else
  371.     set gSoundLoop to 1
  372.   end if
  373. end
  374.  
  375. on CycleNextMoov
  376.   global MoreMoovs, gNext, CurMoovSprite, GignorRest, nowPlaying, gReturnList, gMediaType
  377.   set CurMoovSprite to integer(CurMoovSprite) + 1
  378.   if the castNum of sprite CurMoovSprite <> 0 then
  379.     if the castType of cast the castNum of sprite CurMoovSprite = #digitalVideo then
  380.       DispQTControls()
  381.       set GignorRest to 1
  382.       set gNext to 0
  383.       set the movieRate of sprite (CurMoovSprite - 1) to 0
  384.       set the visible of sprite (CurMoovSprite - 1) to 0
  385.       set the visible of sprite 29 to 1
  386.       set the visible of sprite CurMoovSprite to 1
  387.       set the volume of sprite CurMoovSprite to 255
  388.       updateStage()
  389.       set nowPlaying to 1
  390.       if the movieRate of sprite CurMoovSprite <> 1 then
  391.         playMoovFW()
  392.       end if
  393.     end if
  394.   else
  395.     HideRandoms()
  396.     set MoreMoovs to EMPTY
  397.     set GignorRest to EMPTY
  398.     set gNext to 0
  399.     gettheMarker()
  400.     LocalUp()
  401.   end if
  402. end
  403.  
  404. on ExitVideoThirty
  405.   if the castNum of sprite 30 <> 0 then
  406.     if the castType of cast the castNum of sprite 30 = #digitalVideo then
  407.       set the visible of sprite 30 to 0
  408.       HideAudioControls()
  409.       puppetSprite(30, 0)
  410.       set the movieRate of sprite 30 to 0
  411.       set the movieTime of sprite 30 to 0
  412.       set the loop of cast the castNum of sprite 30 to 0
  413.     end if
  414.   end if
  415.   if the castNum of sprite 29 <> 0 then
  416.     set the visible of sprite 29 to 0
  417.   end if
  418. end
  419.  
  420. on reWindAllMoovs
  421.   repeat with i = 30 to 33
  422.     if (the castNum of sprite i <> 0) and (the castNum of sprite i <> -1) then
  423.       if the castType of cast the castNum of sprite i = #digitalVideo then
  424.         set the movieTime of sprite i to 0
  425.       end if
  426.     end if
  427.   end repeat
  428. end
  429.  
  430. on StopAllMoovs
  431.   repeat with i = 30 to 33
  432.     if (the castNum of sprite i <> 0) and (the castNum of sprite i <> -1) then
  433.       if the castType of cast the castNum of sprite i = #digitalVideo then
  434.         set the movieRate of sprite i to 0
  435.       end if
  436.     end if
  437.   end repeat
  438. end
  439.  
  440. on ToggleLoopAllMoovs
  441.   repeat with i = 30 to 33
  442.     if (the castNum of sprite i <> 0) and (the castNum of sprite i <> -1) then
  443.       if the castType of cast the castNum of sprite i = #digitalVideo then
  444.         set the loop of cast the castNum of sprite i to 0
  445.       end if
  446.     end if
  447.   end repeat
  448. end
  449.  
  450. on hideAllMoovs
  451.   if the castNum of sprite 29 <> 0 then
  452.     set the visible of sprite 29 to 0
  453.   end if
  454.   repeat with i = 30 to 33
  455.     if (the castNum of sprite i <> 0) and (the castNum of sprite i <> -1) then
  456.       if the castType of cast the castNum of sprite i = #digitalVideo then
  457.         set the visible of sprite i to 0
  458.       end if
  459.     end if
  460.   end repeat
  461. end
  462.  
  463. on CleanVidExit
  464.   set the visible of sprite 29 to 0
  465.   repeat with i = 30 to 33
  466.     if (the castNum of sprite i <> 0) and (the castNum of sprite i <> -1) then
  467.       if the castType of cast the castNum of sprite i = #digitalVideo then
  468.         set the visible of sprite i to 0
  469.         set the movieRate of sprite i to 0
  470.         set the movieTime of sprite i to 0
  471.         set the loop of cast the castNum of sprite i to 0
  472.       end if
  473.       next repeat
  474.     end if
  475.     exit
  476.   end repeat
  477. end
  478.  
  479. on MultiMediaEnterFrameScript
  480.   global nowPlaying, gMediaType
  481.   ToggleControls()
  482.   if nowPlaying = 1 then
  483.     if gMediaType = "moov" then
  484.       DispQTControls()
  485.       QTEnterFrameScript()
  486.     end if
  487.     if gMediaType = "AIFF" then
  488.       DispAudioControls()
  489.       SoundEnterFrameScript()
  490.     end if
  491.   else
  492.     HideAudioControls()
  493.   end if
  494. end
  495.