home *** CD-ROM | disk | FTP | other *** search
/ ATComputers Catalog / AutoCont+ATcomp.bin / Data / Funktion.dcr / 00005_Multimedia.ls < prev    next >
Encoding:
Text File  |  2001-08-16  |  3.0 KB  |  128 lines

  1. on HdleAudioExt AName, Kanal, DLaut
  2.   global _Audiopath, _Lautstaerke, _Audioticks
  3.   AudioDatei = _Audiopath & AName
  4.   _Audioticks = EMPTY
  5.   if Kanal = 1 then
  6.     _Audioticks = the ticks
  7.   end if
  8.   if not baFileExists(AudioDatei) then
  9.     alert("Die Datei " & AudioDatei & " wurde nicht gefunden!")
  10.     exit
  11.   end if
  12.   anz = AName.chars.count
  13.   if AName.char[anz - 2..anz] = "swa" then
  14.     member("SWASound").url = AudioDatei
  15.     PreLoadBuffer(member("SWASound"))
  16.     member("SWASound").volume = _Lautstaerke + DLaut
  17.     play frame member("SWASound")
  18.     updateStage()
  19.     if the runMode = "Author" then
  20.       if member("SWASound").State = 9 then
  21.         alert("Die SWA-Datei: " & AudioDatei & " hat scheinbar einen Defekt.")
  22.       end if
  23.     end if
  24.   else
  25.     set the volume of sound Kanal to _Lautstaerke + DLaut
  26.     sound playFile Kanal, AudioDatei
  27.     updateStage()
  28.     if the runMode = "Author" then
  29.       if (soundBusy(1) = 0) and (soundBusy(2) = 0) then
  30.         alert("Die Sound-Datei: " & _Audiopath & AName & " wurde nicht gefunden!")
  31.       end if
  32.     end if
  33.   end if
  34. end
  35.  
  36. on HdleAudioInt AName, Kanal, DLaut
  37.   global _Lautstaerke, _Audioticks
  38.   anz = AName.chars.count
  39.   _Audioticks = EMPTY
  40.   if Kanal = 1 then
  41.     _Audioticks = the ticks
  42.   end if
  43.   tell the stage
  44.     if AName.char[anz - 2..anz] = "swa" then
  45.       member(AName).volume = _Lautstaerke + DLaut
  46.       play frame member(AName)
  47.     else
  48.       set the volume of sound Kanal to _Lautstaerke + DLaut
  49.       puppetSound(Kanal, AName)
  50.     end if
  51.   end tell
  52. end
  53.  
  54. on HdleAudioStream
  55.   if member("SWASound").State = 1 then
  56.     tell the stage
  57.       go(the frame)
  58.     end tell
  59.   end if
  60. end
  61.  
  62. on HdleAudioSchleife
  63.   status = member("SWASound").State
  64.   if soundBusy(1) or ((status > 0) and (status <= 3)) then
  65.     tell the stage
  66.       go(the frame)
  67.     end tell
  68.   end if
  69. end
  70.  
  71. on HdleAudioStop
  72.   stop(member("SWASound"))
  73.   tell the stage
  74.     repeat with i = 1 to 4
  75.       sound stop i
  76.       puppetSound(i, 0)
  77.     end repeat
  78.     repeat while soundBusy(1)
  79.       nothing()
  80.     end repeat
  81.   end tell
  82. end
  83.  
  84. on HdleVideoPlay VName, Kanal, DLaut, StartP, EndP
  85.   global _Abspieldauer, _VKanal, _Pegel
  86.   _VKanal = Kanal
  87.   tell the stage
  88.     if StartP <> 0 then
  89.       sprite(_VKanal).movieTime = StartP
  90.     else
  91.       sprite(_VKanal).movieTime = 1
  92.     end if
  93.     if EndP = 0 then
  94.       _Abspieldauer = member(VName).duration
  95.     else
  96.       _Abspieldauer = EndP
  97.     end if
  98.     preloadMember(member(VName).number)
  99.     updateStage()
  100.     sprite(_VKanal).movieRate = 1
  101.     sprite(_VKanal).volume = _Pegel + DLaut
  102.   end tell
  103. end
  104.  
  105. on HdleVideoSchleife
  106.   global _Abspieldauer, _VKanal
  107.   tell the stage
  108.     aktZeit = sprite(_VKanal).movieTime
  109.     if aktZeit < _Abspieldauer then
  110.       go(the frame)
  111.     else
  112.       sprite(_VKanal).movieRate = 0
  113.       updateStage()
  114.       _Abspieldauer = 0
  115.     end if
  116.   end tell
  117. end
  118.  
  119. on HdleVideostop
  120.   global _Abspieldauer, _VKanal
  121.   tell the stage
  122.     if _Abspieldauer > 0 then
  123.       sprite(_VKanal).movieRate = 0
  124.       _Abspieldauer = 0
  125.     end if
  126.   end tell
  127. end
  128.