Sha256: a5607c0438174304a0a93aded60a161d34bec1213a51373f917309875916eb56

Contents?: true

Size: 1.74 KB

Versions: 19

Compression:

Stored size: 1.74 KB

Contents

##############################################################################
# sound.rb
#
# Includes the following functions:
#
# Beep()
# PlaySound()
# WaveOutSetVolume()
# WaveOutGetVolume()
#
# Defines the following constants:
# 
# SND_APPLICATION
# SND_ALIAS
# SND_ALIAS_ID
# SND_ASYNC
# SND_FILENAME
# SND_LOOP
# SND_MEMORY
# SND_NODEFAULT
# SND_NOSTOP
# SND_NOWAIT
# SND_PURGE
# SND_RESOURCE
# SND_SYNC
##############################################################################
require 'Win32API'

module Windows  
   module Sound
      SND_SYNC          = 0x0000  # play synchronously (default)
      SND_ASYNC         = 0x0001  # play asynchronously
      SND_NODEFAULT     = 0x0002  # silence (!default) if sound not found
      SND_MEMORY        = 0x0004  # pszSound points to a memory file
      SND_LOOP          = 0x0008  # loop the sound until next sndPlaySound
      SND_NOSTOP        = 0x0010  # don't stop any currently playing sound 

      SND_NOWAIT        = 8192    # don't wait if the driver is busy
      SND_ALIAS         = 65536   # name is a registry alias
      SND_ALIAS_ID      = 1114112 # alias is a predefined ID
      SND_FILENAME      = 131072  # name is file name
      SND_RESOURCE      = 262148  # name is resource name or atom

      SND_PURGE         = 0x0040  # purge non-static events for task
      SND_APPLICATION   = 0x0080  # look for application specific association
      
      Beep             = Win32API.new('kernel32', 'Beep', 'LL', 'I')
      PlaySound        = Win32API.new('winmm', 'PlaySound', 'PPL', 'I')
      WaveOutSetVolume = Win32API.new('winmm', 'waveOutSetVolume', 'PL', 'I')
      WaveOutGetVolume = Win32API.new('winmm', 'waveOutGetVolume', 'IP', 'I')
   end
end

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
IOWA-1.0.3 external/windows-pr/lib/windows/sound.rb
IOWA-1.0.2 external/windows-pr/lib/windows/sound.rb
IOWA-1.0.0 external/windows-pr/lib/windows/sound.rb
windows-pr-0.5.2-mswin32 lib/windows/sound.rb
windows-pr-0.5.1-mswin32 lib/windows/sound.rb
windows-pr-0.5.0-mswin32 lib/windows/sound.rb
windows-pr-0.4.0-mswin32 lib/windows/sound.rb
windows-pr-0.3.0-mswin32 lib/windows/sound.rb
windows-pr-0.5.3 lib/windows/sound.rb
windows-pr-0.2.0 lib/windows/sound.rb
windows-pr-0.1.0 lib/windows/sound.rb
windows-pr-0.6.5 lib/windows/sound.rb
windows-pr-0.6.3 lib/windows/sound.rb
windows-pr-0.5.5 lib/windows/sound.rb
windows-pr-0.6.2 lib/windows/sound.rb
windows-pr-0.5.4 lib/windows/sound.rb
windows-pr-0.6.0 lib/windows/sound.rb
windows-pr-0.6.4 lib/windows/sound.rb
windows-pr-0.6.6 lib/windows/sound.rb