| 1 | /* $Id: OS2DSOUND.H,v 1.6 2000-05-18 20:37:08 mike Exp $ */
|
|---|
| 2 |
|
|---|
| 3 | /*
|
|---|
| 4 | * DirectSound main class
|
|---|
| 5 | *
|
|---|
| 6 | * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl)
|
|---|
| 7 | *
|
|---|
| 8 | * Project Odin Software License can be found in LICENSE.TXT
|
|---|
| 9 | *
|
|---|
| 10 | */
|
|---|
| 11 | #ifndef __OS2DSOUND_H__
|
|---|
| 12 | #define __OS2DSOUND_H__
|
|---|
| 13 |
|
|---|
| 14 | #undef THIS
|
|---|
| 15 | #define THIS VOID*This
|
|---|
| 16 |
|
|---|
| 17 | #undef THIS_
|
|---|
| 18 | #define THIS_ VOID*This,
|
|---|
| 19 |
|
|---|
| 20 | // A forward declaration is need here!
|
|---|
| 21 | class OS2PrimBuff;
|
|---|
| 22 |
|
|---|
| 23 | class OS2IDirectSound
|
|---|
| 24 | {
|
|---|
| 25 | public:
|
|---|
| 26 | //this one has to go first!
|
|---|
| 27 | IDirectSoundVtbl *lpVtbl;
|
|---|
| 28 | IDirectSoundVtbl Vtbl;
|
|---|
| 29 |
|
|---|
| 30 | OS2IDirectSound(const GUID *lpGUID);
|
|---|
| 31 | ~OS2IDirectSound();
|
|---|
| 32 |
|
|---|
| 33 | int Referenced;
|
|---|
| 34 |
|
|---|
| 35 | static BOOL fDSExists;
|
|---|
| 36 | inline HRESULT GetLastError() { return lastError; };
|
|---|
| 37 | inline DWORD GetCoopLevel() { return CoopLevel; };
|
|---|
| 38 |
|
|---|
| 39 | OS2PrimBuff* primary; // Primary Buffer..Created on construct of DSound (KL)
|
|---|
| 40 | // (Public so that the Secondary buffer instances can access this.. Maybe a GetPrimary function would eb better?)
|
|---|
| 41 |
|
|---|
| 42 | private:
|
|---|
| 43 |
|
|---|
| 44 | protected:
|
|---|
| 45 | HRESULT lastError;
|
|---|
| 46 |
|
|---|
| 47 | DWORD speakerConfig;
|
|---|
| 48 | DWORD CoopLevel;
|
|---|
| 49 | HWND hwndClient;
|
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 | // Linked list management
|
|---|
| 53 | OS2IDirectSound* next; // Next OS2IDirectSound
|
|---|
| 54 | static OS2IDirectSound* dsound; // List of OS2IDirectSound
|
|---|
| 55 |
|
|---|
| 56 | friend HRESULT __stdcall SoundQueryInterface(THIS, REFIID riid, LPVOID * ppvObj);
|
|---|
| 57 | friend ULONG __stdcall SoundAddRef(THIS);
|
|---|
| 58 | friend ULONG __stdcall SoundRelease(THIS);
|
|---|
| 59 | friend HRESULT __stdcall SoundCreateSoundBuffer(THIS_ LPDSBUFFERDESC, LPDIRECTSOUNDBUFFER*,LPUNKNOWN);
|
|---|
| 60 | friend HRESULT __stdcall SoundGetCaps(THIS_ LPDSCAPS );
|
|---|
| 61 | friend HRESULT __stdcall SoundDuplicateSoundBuffer(THIS_ LPDIRECTSOUNDBUFFER, LPLPDIRECTSOUNDBUFFER );
|
|---|
| 62 | friend HRESULT __stdcall SoundSetCooperativeLevel(THIS_ HWND, DWORD );
|
|---|
| 63 | friend HRESULT __stdcall SoundCompact(THIS );
|
|---|
| 64 | friend HRESULT __stdcall SoundGetSpeakerConfig(THIS_ LPDWORD );
|
|---|
| 65 | friend HRESULT __stdcall SoundSetSpeakerConfig(THIS_ DWORD );
|
|---|
| 66 | friend HRESULT __stdcall SoundInitialize(THIS_ LPGUID);
|
|---|
| 67 | };
|
|---|
| 68 | //******************************************************************************
|
|---|
| 69 | //******************************************************************************
|
|---|
| 70 | HRESULT __stdcall SoundQueryInterface(THIS, REFIID riid, LPVOID * ppvObj);
|
|---|
| 71 | ULONG __stdcall SoundAddRef(THIS);
|
|---|
| 72 | ULONG __stdcall SoundRelease(THIS);
|
|---|
| 73 | HRESULT __stdcall SoundCreateSoundBuffer(THIS_ LPDSBUFFERDESC, LPDIRECTSOUNDBUFFER*,LPUNKNOWN);
|
|---|
| 74 | HRESULT __stdcall SoundGetCaps(THIS_ LPDSCAPS );
|
|---|
| 75 | HRESULT __stdcall SoundDuplicateSoundBuffer(THIS_ LPDIRECTSOUNDBUFFER, LPLPDIRECTSOUNDBUFFER );
|
|---|
| 76 | HRESULT __stdcall SoundSetCooperativeLevel(THIS_ HWND, DWORD );
|
|---|
| 77 | HRESULT __stdcall SoundCompact(THIS );
|
|---|
| 78 | HRESULT __stdcall SoundGetSpeakerConfig(THIS_ LPDWORD );
|
|---|
| 79 | HRESULT __stdcall SoundSetSpeakerConfig(THIS_ DWORD );
|
|---|
| 80 | HRESULT __stdcall SoundInitialize(THIS_ LPGUID);
|
|---|
| 81 |
|
|---|
| 82 | #endif
|
|---|