123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190 |
- Strict
- Import Pub.Win32
- Import "dsound.cpp"
- Const DIRECTSOUND_VERSION=$0700
- Const DSSCL_NORMAL=$00000001
- Const DSSCL_PRIORITY=$00000002
- Const DSSCL_EXCLUSIVE=$00000003
- Const DSSCL_WRITEPRIMARY=$00000004
- Const DSCAPS_PRIMARYMONO=$00000001
- Const DSCAPS_PRIMARYSTEREO=$00000002
- Const DSCAPS_PRIMARY8BIT=$00000004
- Const DSCAPS_PRIMARY16BIT=$00000008
- Const DSCAPS_CONTINUOUSRATE=$00000010
- Const DSCAPS_EMULDRIVER=$00000020
- Const DSCAPS_CERTIFIED=$00000040
- Const DSCAPS_SECONDARYMONO=$00000100
- Const DSCAPS_SECONDARYSTEREO=$00000200
- Const DSCAPS_SECONDARY8BIT=$00000400
- Const DSCAPS_SECONDARY16BIT=$00000800
- Const DSSPEAKER_HEADPHONE=$00000001
- Const DSSPEAKER_MONO=$00000002
- Const DSSPEAKER_QUAD=$00000003
- Const DSSPEAKER_STEREO=$00000004
- Const DSSPEAKER_SURROUND=$00000005
- Const DSSPEAKER_5POINT1=$00000006
- Const DSSPEAKER_GEOMETRY_MIN=$00000005
- Const DSSPEAKER_GEOMETRY_NARROW=$0000000A
- Const DSSPEAKER_GEOMETRY_WIDE=$00000014
- Const DSSPEAKER_GEOMETRY_MAX=$000000B4
- Const DSBCAPS_PRIMARYBUFFER=$00000001
- Const DSBCAPS_STATIC=$00000002
- Const DSBCAPS_LOCHARDWARE=$00000004
- Const DSBCAPS_LOCSOFTWARE=$00000008
- Const DSBCAPS_CTRL3D=$00000010
- Const DSBCAPS_CTRLFREQUENCY=$00000020
- Const DSBCAPS_CTRLPAN=$00000040
- Const DSBCAPS_CTRLVOLUME=$00000080
- Const DSBCAPS_CTRLPOSITIONNOTIFY=$00000100
- Const DSBCAPS_STICKYFOCUS=$00004000
- Const DSBCAPS_GLOBALFOCUS=$00008000
- Const DSBCAPS_GETCURRENTPOSITION2=$00010000
- Const DSBCAPS_MUTE3DATMAXDISTANCE=$00020000
- Const DSBCAPS_LOCDEFER=$00040000
- Const DSBPLAY_LOOPING=$00000001
- Const DSBPLAY_LOCHARDWARE=$00000002
- Const DSBPLAY_LOCSOFTWARE=$00000004
- Const DSBPLAY_TERMINATEBY_TIME=$00000008
- Const DSBPLAY_TERMINATEBY_DISTANCE=$000000010
- Const DSBPLAY_TERMINATEBY_PRIORITY=$000000020
- Const DSBSTATUS_PLAYING=$00000001
- Const DSBSTATUS_BUFFERLOST=$00000002
- Const DSBSTATUS_LOOPING=$00000004
- Const DSBSTATUS_LOCHARDWARE=$00000008
- Const DSBSTATUS_LOCSOFTWARE=$00000010
- Const DSBSTATUS_TERMINATED=$00000020
- Const DSBLOCK_FROMWRITECURSOR=$00000001
- Const DSBLOCK_ENTIREBUFFER=$00000002
- ?disabled
- Type DSCAPS
- Field dwSize
- Field dwFlags
- Field dwMinSecondarySampleRate
- Field dwMaxSecondarySampleRate
- Field dwPrimaryBuffers
- Field dwMaxHwMixingAllBuffers
- Field dwMaxHwMixingStaticBuffers
- Field dwMaxHwMixingStreamingBuffers
- Field dwFreeHwMixingAllBuffers
- Field dwFreeHwMixingStaticBuffers
- Field dwFreeHwMixingStreamingBuffers
- Field dwMaxHw3DAllBuffers
- Field dwMaxHw3DStaticBuffers
- Field dwMaxHw3DStreamingBuffers
- Field dwFreeHw3DAllBuffers
- Field dwFreeHw3DStaticBuffers
- Field dwFreeHw3DStreamingBuffers
- Field dwTotalHwMemBytes
- Field dwFreeHwMemBytes
- Field dwMaxContigFreeHwMemBytes
- Field dwUnlockTransferRateHwBuffers
- Field dwPlayCpuOverheadSwBuffers
- Field dwReserved1
- Field dwReserved2
- End Type
- Type DSBCAPS
- Field dwSize
- Field dwFlags
- Field dwBufferBytes
- Field dwUnlockTransferRate
- Field dwPlayCpuOverhead
- End Type
- Type WAVEFORMATEX
- Field wFormatTag:Short
- Field nChannels:Short
- Field nSamplesPerSec
- Field nAvgBytesPerSec
- Field nBlockAlign:Short
- Field wBitsPerSample:Short
- Field cbSize:Short
- End Type
- Type DSBUFFERDESC
- Field dwSize
- Field dwFlags
- Field dwBufferBytes
- Field dwReserved
- Field lpwfxFormat:Byte Ptr
- Field guid3DAlgorithm0
- Field guid3DAlgorithm1
- Field guid3DAlgorithm2
- Field guid3DAlgorithm3
- End Type
- Extern "win32"
- Type IDirectSound Extends IUnknown
- Method CreateSoundBuffer( desc:Byte Ptr,buf:IDirectSoundBuffer Var,unk:Byte Ptr )
- Method GetCaps( caps:Byte Ptr )
- Method DuplicateSoundBuffer( in:IDirectSoundBuffer,out:IDirectSoundBuffer Var )
- Method SetCooperativeLevel( hwnd,coop )
- Method Compact()
- Method GetSpeakerConfig( config Var )
- Method SetSpeakerConfig( config )
- Method Initialize( guid:Byte Ptr )
- End Type
- Type IDirectSoundBuffer Extends IUnknown
- Method GetCaps( caps:Byte Ptr )
- Method GetCurrentPosition( pos Var,writePos Var )
- Method GetFormat( format:WAVEFORMATEX,sizein,sizeout Var )
- Method GetVolume( volume Var )
- Method GetPan( pan Var )
- Method GetFrequency( freq Var )
- Method GetStatus( status Var )
- Method Initialize( dsound:IDirectSound,desc:Byte Ptr )
- Method Lock( writeCursor,writeBytes,ptr1:Byte Ptr Var,bytes1 Var,ptr2:Byte Ptr Var,bytes2 Var,flags )
- Method Play( reserved,priority,flags )
- Method SetCurrentPosition( pos )
- Method SetFormat( format:WAVEFORMATEX )
- Method SetVolume( volume )
- Method SetPan( pan )
- Method SetFrequency( freq )
- Method Stop()
- Method Unlock( ptr1:Byte Ptr,bytes1,ptr2:Byte Ptr,bytes2 )
- Method Restore()
- End Type
- End Extern
- ?
- Extern
- Function bmx_directsound_IDirectSound_release:Int(handle:Byte Ptr)
- Function bmx_directsound_IDirectSound_create:Int(dsound:Byte Ptr Ptr)
- Function bmx_directsound_IDirectSound_setcooperativeLevel:Int(handle:Byte Ptr, hwnd:Byte Ptr, flags:Int)
- Function bmx_directsound_IDirectSound_duplicatesoundbuffer:Int(handle:Byte Ptr, buffer:Byte Ptr, buf:Byte Ptr Ptr)
- Function bmx_directsound_IDirectSound_createsoundbuffer:Int(handle:Byte Ptr, buf:Byte Ptr Ptr, length:Int, hertz:Int, format:Int, chans:Int, bps:Int, size:Int, flags:Int, _mode:Int)
- Function bmx_directsound_IDirectSoundBuffer_release:Int(handle:Byte Ptr)
- Function bmx_directsound_IDirectSoundBuffer_stop:Int(handle:Byte Ptr)
- Function bmx_directsound_IDirectSoundBuffer_play:Int(handle:Byte Ptr, res:Int, priority:Int, flags:Int)
- Function bmx_directsound_IDirectSoundBuffer_setvolume:Int(handle:Byte Ptr, volume:Int)
- Function bmx_directsound_IDirectSoundBuffer_setpan:Int(handle:Byte Ptr, pan:Int)
- Function bmx_directsound_IDirectSoundBuffer_setfrequency:Int(handle:Byte Ptr, freq:Int)
- Function bmx_directsound_IDirectSoundBuffer_setcurrentposition:Int(handle:Byte Ptr, pos:Int)
- Function bmx_directsound_IDirectSoundBuffer_lock:Int(handle:Byte Ptr, offset:Int, size:Int, ptr1:Byte Ptr Ptr, bytes1:Int Ptr, ptr2:Byte Ptr Ptr, bytes2:Int Ptr, flags:Int )
- Function bmx_directsound_IDirectSoundBuffer_unlock:Int(handle:Byte Ptr, ptr1:Byte Ptr,bytes1:Int,ptr2:Byte Ptr,bytes2:Int)
- Function bmx_directsound_IDirectSoundBuffer_getstatus:Int(handle:Byte Ptr, status:Int Ptr)
-
- End Extern
- Private
- Global _ds=LoadLibraryA( "dsound" )
- Public
- Global DirectSoundCreate( guid:Byte Ptr,dsound:Byte Ptr,unk:Byte Ptr )"win32"=GetProcAddress( _ds,"DirectSoundCreate" )
|