1 | /* $Id: DSOUND.CPP,v 1.6 1999-11-14 22:12:14 hugh Exp $ */
|
---|
2 |
|
---|
3 | /*
|
---|
4 | * DirectSound exported APIs
|
---|
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 |
|
---|
12 | /*@Header***********************************************************************
|
---|
13 | * Header Files *
|
---|
14 | *******************************************************************************/
|
---|
15 | #include <os2win.h>
|
---|
16 | #include <stdlib.h>
|
---|
17 | #include <string.h>
|
---|
18 |
|
---|
19 | #define INITGUID
|
---|
20 | #include <dsound.h>
|
---|
21 | #include "os2dsound.h"
|
---|
22 |
|
---|
23 | #include <misc.h>
|
---|
24 |
|
---|
25 | //******************************************************************************
|
---|
26 | //******************************************************************************
|
---|
27 | HRESULT WIN32API OS2DirectSoundCreate(const GUID *lpGUID,
|
---|
28 | LPDIRECTSOUND * ppDS,
|
---|
29 | IUnknown *pUnkOuter)
|
---|
30 | {
|
---|
31 | OS2IDirectSound *newsound = new OS2IDirectSound(lpGUID);
|
---|
32 | HRESULT rc;
|
---|
33 |
|
---|
34 | dprintf(("DirectSoundCreate %X %X %X\n", lpGUID, ppDS, pUnkOuter));
|
---|
35 | if(newsound == NULL)
|
---|
36 | return(DSERR_OUTOFMEMORY);
|
---|
37 |
|
---|
38 | rc = newsound->GetLastError();
|
---|
39 | if(rc != DS_OK) {
|
---|
40 | *ppDS = NULL;
|
---|
41 | delete newsound;
|
---|
42 | }
|
---|
43 | else
|
---|
44 | *ppDS = (LPDIRECTSOUND)newsound;
|
---|
45 | return(rc);
|
---|
46 | }
|
---|
47 | //******************************************************************************
|
---|
48 | //******************************************************************************
|
---|
49 | HRESULT WIN32API OS2DirectSoundEnumerateA(LPDSENUMCALLBACKA lpCallback,
|
---|
50 | LPVOID lpContext)
|
---|
51 | {
|
---|
52 | dprintf(("DirectSoundEnumerateA\n"));
|
---|
53 |
|
---|
54 | lpCallback(NULL, "DART DirectSound for OS/2", "DirectSound/2 v0.1",
|
---|
55 | lpContext);
|
---|
56 | return(DS_OK);
|
---|
57 | }
|
---|
58 | //******************************************************************************
|
---|
59 | //******************************************************************************
|
---|