home *** CD-ROM | disk | FTP | other *** search
/ Mind Games (Tessera) / MindGames.iso / files / main.dxr / Internal_4_sound manager object.ls < prev    next >
Encoding:
Text File  |  2002-11-25  |  933 b   |  49 lines

  1. property mySoundTrack, mySoundTrackChannel
  2.  
  3. on new me, aSoundTrack
  4.   mySoundTrackChannel = 1
  5.   sound(mySoundTrackChannel).volume = 250
  6.   if not voidp(aSoundTrack) then
  7.     getSoundTrack(me, aSoundTrack)
  8.   end if
  9.   return me
  10. end
  11.  
  12. on getSoundTrack me, aSoundFile
  13.   mySoundTrack = aSoundFile
  14.   sound playFile mySoundTrackChannel, mySoundTrack
  15. end
  16.  
  17. on stepFrame me
  18.   if not soundBusy(mySoundTrackChannel) then
  19.     if not voidp(mySoundTrack) then
  20.       getSoundTrack(me, mySoundTrack)
  21.     end if
  22.   end if
  23. end
  24.  
  25. on makeFX me, aMember
  26.   aChannel = me.emptyChannel()
  27.   sound(aChannel).volume = 100
  28.   puppetSound(aChannel, aMember)
  29.   return aChannel
  30. end
  31.  
  32. on emptyChannel me
  33.   channel = 2
  34.   repeat with channel = 1 to 7
  35.     if not soundBusy(channel + 1) then
  36.       channel = channel + 1
  37.       exit repeat
  38.     end if
  39.   end repeat
  40.   return channel
  41. end
  42.  
  43. on reset me
  44.   myChannel = VOID
  45.   repeat with n = 1 to 8
  46.     sound(n).stop()
  47.   end repeat
  48. end
  49.