| 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 | // GUID for the only device we provide (DART DirectSound for OS/2)
|
|---|
| 24 | DEFINE_GUID(GUID_DirectSound_DART, 0x03BC8FA8, 0x3460, 0x11E0, 0x99, 0x51, 0x49, 0xC1, 0xDF, 0xD7, 0x20, 0x85 );
|
|---|
| 25 |
|
|---|
| 26 | class OS2IDirectSound
|
|---|
| 27 | {
|
|---|
| 28 | public:
|
|---|
| 29 | //this one has to go first!
|
|---|
| 30 | IDirectSoundVtbl *lpVtbl;
|
|---|
| 31 | IDirectSoundVtbl Vtbl;
|
|---|
| 32 |
|
|---|
| 33 | OS2IDirectSound(const GUID *lpGUID);
|
|---|
| 34 | ~OS2IDirectSound();
|
|---|
| 35 |
|
|---|
| 36 | int Referenced;
|
|---|
| 37 |
|
|---|
| 38 | static BOOL fDSExists;
|
|---|
| 39 | inline HRESULT GetLastError() { return lastError; };
|
|---|
| 40 | inline DWORD GetCoopLevel() { return CoopLevel; };
|
|---|
| 41 |
|
|---|
| 42 | OS2PrimBuff* primary; // Primary Buffer..Created on construct of DSound (KL)
|
|---|
| 43 | // (Public so that the Secondary buffer instances can access this.. Maybe a GetPrimary function would eb better?)
|
|---|
| 44 |
|
|---|
| 45 | private:
|
|---|
| 46 |
|
|---|
| 47 | protected:
|
|---|
| 48 | HRESULT lastError;
|
|---|
| 49 |
|
|---|
| 50 | DWORD speakerConfig;
|
|---|
| 51 | DWORD CoopLevel;
|
|---|
| 52 | HWND hwndClient;
|
|---|
| 53 |
|
|---|
| 54 |
|
|---|
| 55 | // Linked list management
|
|---|
| 56 | OS2IDirectSound* next; // Next OS2IDirectSound
|
|---|
| 57 | static OS2IDirectSound* dsound; // List of OS2IDirectSound
|
|---|
| 58 |
|
|---|
| 59 | friend HRESULT __stdcall SoundQueryInterface(THIS, REFIID riid, LPVOID * ppvObj);
|
|---|
| 60 | friend ULONG __stdcall SoundAddRef(THIS);
|
|---|
| 61 | friend ULONG __stdcall SoundRelease(THIS);
|
|---|
| 62 | friend HRESULT __stdcall SoundCreateSoundBuffer(THIS_ LPDSBUFFERDESC, LPDIRECTSOUNDBUFFER*,LPUNKNOWN);
|
|---|
| 63 | friend HRESULT __stdcall SoundGetCaps(THIS_ LPDSCAPS );
|
|---|
| 64 | friend HRESULT __stdcall SoundDuplicateSoundBuffer(THIS_ LPDIRECTSOUNDBUFFER, LPLPDIRECTSOUNDBUFFER );
|
|---|
| 65 | friend HRESULT __stdcall SoundSetCooperativeLevel(THIS_ HWND, DWORD );
|
|---|
| 66 | friend HRESULT __stdcall SoundCompact(THIS );
|
|---|
| 67 | friend HRESULT __stdcall SoundGetSpeakerConfig(THIS_ LPDWORD );
|
|---|
| 68 | friend HRESULT __stdcall SoundSetSpeakerConfig(THIS_ DWORD );
|
|---|
| 69 | friend HRESULT __stdcall SoundInitialize(THIS_ LPGUID);
|
|---|
| 70 | };
|
|---|
| 71 | //******************************************************************************
|
|---|
| 72 | //******************************************************************************
|
|---|
| 73 | HRESULT __stdcall SoundQueryInterface(THIS, REFIID riid, LPVOID * ppvObj);
|
|---|
| 74 | ULONG __stdcall SoundAddRef(THIS);
|
|---|
| 75 | ULONG __stdcall SoundRelease(THIS);
|
|---|
| 76 | HRESULT __stdcall SoundCreateSoundBuffer(THIS_ LPDSBUFFERDESC, LPDIRECTSOUNDBUFFER*,LPUNKNOWN);
|
|---|
| 77 | HRESULT __stdcall SoundGetCaps(THIS_ LPDSCAPS );
|
|---|
| 78 | HRESULT __stdcall SoundDuplicateSoundBuffer(THIS_ LPDIRECTSOUNDBUFFER, LPLPDIRECTSOUNDBUFFER );
|
|---|
| 79 | HRESULT __stdcall SoundSetCooperativeLevel(THIS_ HWND, DWORD );
|
|---|
| 80 | HRESULT __stdcall SoundCompact(THIS );
|
|---|
| 81 | HRESULT __stdcall SoundGetSpeakerConfig(THIS_ LPDWORD );
|
|---|
| 82 | HRESULT __stdcall SoundSetSpeakerConfig(THIS_ DWORD );
|
|---|
| 83 | HRESULT __stdcall SoundInitialize(THIS_ LPGUID);
|
|---|
| 84 |
|
|---|
| 85 | #endif
|
|---|