-- Disclaimer: -- This binding has been generated by hand. It needs further checking. In -- particular the size and offsets of the components of CWaveSoundRead.Object -- should be checked. This can be done by checking the size and offset -- attributes from C++ against those from Ada. Note that different versions -- of the C++ compiler may generate different link names. --//----------------------------------------------------------------------------- --// File: WavRead.h --// --// Desc: Support for loading and playing Wave files using DirectSound sound --// buffers. --// --// Copyright (c) 1999 Microsoft Corp. All rights reserved. --//----------------------------------------------------------------------------- --#ifndef WAVE_READ_H --#define WAVE_READ_H -- -- --#include --#include -- -- --//----------------------------------------------------------------------------- --// Name: class CWaveSoundRead --// Desc: A class to read in sound data from a Wave file --//----------------------------------------------------------------------------- --class CWaveSoundRead -- JSW convention is to encapsulate the class in an Ada package, if possible with VC, WinAPI; package CWaveSoundRead is -- JSW convention is to declare a class record called Object -- this includes the non-static member variables -- and must match the layout of the C++ class type Object is record --{ --public: -- WAVEFORMATEX* m_pwfx; // Pointer to WAVEFORMATEX structure -- HMMIO m_hmmioIn; // MM I/O handle for the WAVE -- MMCKINFO m_ckIn; // Multimedia RIFF chunk -- MMCKINFO m_ckInRiff; // Use in opening a WAVE file m_pwfx : WinAPI.AddressOfWAVEFORMATEX; -- Pointer to WAVEFORMATEX structure m_hmmioIn : WinAPI.HMMIO; -- MM I/O handle for the WAVE m_ckIn : WinAPI.MMCKINFO; -- Multimedia RIFF chunk m_ckInRiff : WinAPI.MMCKINFO; -- Use in opening a WAVE file end record; for Object use record m_pwfx at 0 range 0 .. 31; m_hmmioIn at 4 range 0 .. 31; m_ckIn at 8 range 0 .. 159; m_ckInRiff at 28 range 0 .. 159; end record; -- JSW convention is to declare an access to the class record called Pointer type Pointer is access all Object; --public: -- CWaveSoundRead(); -- JSW convention is to declare constructors with name Constructor. -- Both function and procedure forms may be useful. -- These are non-static member functions. -- The first parameter, implicit in C++, is a pointer to the class object. -- The Visual C++ default calling convention for non-static member functions is thiscall. function Constructor (This : Pointer) return Pointer; procedure Constructor (This : Pointer); pragma Import (thiscall, Constructor, Link_Name=>"??0CWaveSoundRead@@QAE@XZ"); -- ~CWaveSoundRead(); -- JSW convention is to declare destructors with name Destructor. -- These are non-static member functions. -- The first parameter, implicit in C++, is a pointer to the class object. -- The Visual C++ default calling convention for non-static member functions is thiscall. procedure Destructor (This : Pointer); pragma Import (thiscall, Destructor, Link_Name=>"??1CWaveSoundRead@@QAE@XZ"); -- HRESULT Open( CHAR* strFilename ); -- HRESULT Reset(); -- HRESULT Read( UINT nSizeToRead, BYTE* pbData, UINT* pnSizeRead ); -- HRESULT Close(); -- These are non-static member functions. -- The first parameter, implicit in C++, is a pointer to the class object. -- The Visual C++ default calling convention for non-static member functions is thiscall. function Open ( This : Pointer; strFilename : VC.AddressOfChar) return WinAPI.HRESULT; pragma Import (thiscall, Open, Link_Name=>"?Open@CWaveSoundRead@@QAEJPAD@Z"); function Reset (This : Pointer) return WinAPI.HRESULT; pragma Import (thiscall, Reset, Link_Name=>"?Reset@CWaveSoundRead@@QAEJXZ"); function Read ( This : Pointer; nSizeToRead : WinAPI.UINT; pbData : WinAPI.AddressOfBYTE; pnSizeRead : WinAPI.AddressOfUINT) return WinAPI.HRESULT; pragma Import (thiscall, Read, Link_Name=>"?Read@CWaveSoundRead@@QAEJIPAEPAI@Z"); function Close (This : Pointer) return WinAPI.HRESULT; pragma Import (thiscall, Close, Link_Name=>"?Close@CWaveSoundRead@@QAEJXZ"); -- To find the link names compile wavread.cpp using Visual C++ as follows: -- cl -c wavread.cpp -- dumpbin /symbols wavread.obj >wavread.sym -- Then look in wavread.sym for the functions specs and their link names -- --}; end CWaveSoundRead; -- -- --#endif WAVE_READ_H