home *** CD-ROM | disk | FTP | other *** search
- /*
- Company: Sensaura Ltd
- Copyright: (C) 2000
-
- File Name: buffer.h
- File Description: Header file for declaration of Buffer class for a DirectSound buffer with
- ZoomFX support
- Author: Adam Philp
- Last Update: 04-JAN-00
-
- Target Compiler: Microsoft Visual C++ Version 5.0
- */
-
- #ifndef __buffer_h // Sentry, use file only if it's not already included
- #define __buffer_h
-
- /////////////////////// Included files ////////////////////////////////////////////////////////////
-
- #include <dsound.h>
- #include "wavefile.h" // WAVE file support object declaration
- #include "zoomfx.h" // ZoomFX API declaration
-
- class Buffer
- {
- public: // Public constructor & destructor
- Buffer();
- ~Buffer();
-
- public: // Public member functions
- bool Create(const char*, LPDIRECTSOUND);
- virtual void Destroy();
-
- bool IsPlaying();
- bool Play(bool bLooping = false);
- bool Stop();
- bool Rewind();
- // IDirectSoundBuffer/IDirectSound3DBuffer wrappers
- bool GetCaps(LPDSBCAPS);
- bool GetCurrentPosition(DWORD* pdwPlayCursor = NULL, DWORD* pdwWriteCursor = NULL);
- bool GetFormat(LPWAVEFORMATEX);
- bool GetFrequency(DWORD*);
- bool GetVolume(long*);
-
- bool GetAllParameters(LPDS3DBUFFER);
-
- bool SetFrequency(DWORD);
- bool SetVolume(long);
-
- bool SetAllParameters(LPCDS3DBUFFER, DWORD);
- bool SetConeAngles(DWORD, DWORD, DWORD);
- bool SetConeOutsideVolume(LONG, DWORD);
- bool SetMinDistance(D3DVALUE, DWORD);
- bool SetMaxDistance(D3DVALUE, DWORD);
- bool SetMode(DWORD, DWORD);
- bool SetPosition(D3DVALUE, D3DVALUE, D3DVALUE, DWORD);
- bool SetVelocity(D3DVALUE, D3DVALUE, D3DVALUE, DWORD);
-
- bool CanDoZoomFX();
-
- bool GetAllZoomFX(ZOOMFX_BUFFERPROPERTIES*);
- bool GetZoomFXExtent(ZOOMFX_BOX*);
- bool GetZoomFXOrientation(ZOOMFX_ORIENTATION*);
-
- bool SetAllZoomFX(const ZOOMFX_BUFFERPROPERTIES*);
- bool SetZoomFXExtent(const ZOOMFX_BOX*);
- bool SetZoomFXOrientation(const ZOOMFX_ORIENTATION*);
-
- protected: // Protected member functions
- bool GetZoomFXProperty(ULONG, PVOID, ULONG);
- bool SetZoomFXProperty(ULONG, PVOID, ULONG);
-
- protected: // Protected data members
- LPDIRECTSOUNDBUFFER m_pBuffer;
- LPDIRECTSOUND3DBUFFER m_p3dBuffer;
- LPKSPROPERTYSET m_pKsPropertySet;
-
- WaveFile m_File;
- };
-
- #endif // End of sentry __buffer_h
-