ReactOS 0.4.15-dev-8092-ge0ba2f3
dsound_test.h
Go to the documentation of this file.
1/*
2 * Unit tests for dsound functions
3 *
4 * Copyright (c) 2004 Francois Gouget
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21#ifndef _DSOUND_TEST_H_
22#define _DSOUND_TEST_H_
23
24#include <math.h>
25
26#define WIN32_NO_STATUS
27#define _INC_WINDOWS
28#define COM_NO_WINDOWS_H
29#define COBJMACROS
30
31#include <wine/test.h>
32
33#include <wingdi.h>
34#include <mmreg.h>
35#include <mmsystem.h>
36#include <dsound.h>
37#include <dsconf.h>
38#include <ks.h>
39#include <ksmedia.h>
40
41static const unsigned int formats[][4]={
42 { 8000, 8, 1, 0 },
43 { 8000, 8, 2, 0 },
44 { 8000, 16, 1, 0 },
45 { 8000, 16, 2, 0 },
46 { 8000, 24, 1, 0 },
47 { 8000, 24, 2, 0 },
48 { 8000, 32, 1, 0 },
49 { 8000, 32, 2, 0 },
50 {11025, 8, 1, WAVE_FORMAT_1M08 },
51 {11025, 8, 2, WAVE_FORMAT_1S08 },
52 {11025, 16, 1, WAVE_FORMAT_1M16 },
53 {11025, 16, 2, WAVE_FORMAT_1S16 },
54 {11025, 24, 1, 0 },
55 {11025, 24, 2, 0 },
56 {11025, 32, 1, 0 },
57 {11025, 32, 2, 0 },
58 {22050, 8, 1, WAVE_FORMAT_2M08 },
59 {22050, 8, 2, WAVE_FORMAT_2S08 },
60 {22050, 16, 1, WAVE_FORMAT_2M16 },
61 {22050, 16, 2, WAVE_FORMAT_2S16 },
62 {22050, 24, 1, 0 },
63 {22050, 24, 2, 0 },
64 {22050, 32, 1, 0 },
65 {22050, 32, 2, 0 },
66 {44100, 8, 1, WAVE_FORMAT_4M08 },
67 {44100, 8, 2, WAVE_FORMAT_4S08 },
68 {44100, 16, 1, WAVE_FORMAT_4M16 },
69 {44100, 16, 2, WAVE_FORMAT_4S16 },
70 {44100, 24, 1, 0 },
71 {44100, 24, 2, 0 },
72 {44100, 32, 1, 0 },
73 {44100, 32, 2, 0 },
74 {48000, 8, 1, WAVE_FORMAT_48M08 },
75 {48000, 8, 2, WAVE_FORMAT_48S08 },
76 {48000, 16, 1, WAVE_FORMAT_48M16 },
77 {48000, 16, 2, WAVE_FORMAT_48S16 },
78 {48000, 24, 1, 0 },
79 {48000, 24, 2, 0 },
80 {48000, 32, 1, 0 },
81 {48000, 32, 2, 0 },
82 {96000, 8, 1, WAVE_FORMAT_96M08 },
83 {96000, 8, 2, WAVE_FORMAT_96S08 },
84 {96000, 16, 1, WAVE_FORMAT_96M16 },
85 {96000, 16, 2, WAVE_FORMAT_96S16 },
86 {96000, 24, 1, 0 },
87 {96000, 24, 2, 0 },
88 {96000, 32, 1, 0 },
89 {96000, 32, 2, 0 }
90};
91#define NB_FORMATS (sizeof(formats)/sizeof(*formats))
92
93static const unsigned int format_tags[] = {WAVE_FORMAT_PCM, WAVE_FORMAT_IEEE_FLOAT};
94#define NB_TAGS (sizeof(format_tags)/sizeof(*format_tags))
95
96/* The time slice determines how often we will service the buffer */
97#define TIME_SLICE 31
98#define BUFFER_LEN 400
99
100extern char* wave_generate_la(WAVEFORMATEX*,double,DWORD*,BOOL);
101extern HWND get_hwnd(void);
102extern void init_format(WAVEFORMATEX*,int,int,int,int);
104 BOOL,BOOL,LONG,BOOL,LONG,BOOL,double,BOOL,
107 BOOL,BOOL,LONG,BOOL,LONG,BOOL,double,BOOL,
109extern const char * getDSBCAPS(DWORD xmask);
110extern int align(int length, int align);
111extern const char * format_string(const WAVEFORMATEX* wfx);
112
113#endif /* !_DSOUND_TEST_H_ */
static TCHAR test_buffer[TEST_BUFFER_SIZE]
Definition: _tfileio.c:53
#define WAVE_FORMAT_PCM
Definition: constants.h:425
struct IDirectSoundBuffer * LPDIRECTSOUNDBUFFER
Definition: dsound.h:76
struct IDirectSound3DListener * LPDIRECTSOUND3DLISTENER
Definition: dsound.h:86
struct IDirectSound * LPDIRECTSOUND
Definition: dsound.h:70
struct IDirectSound8 * LPDIRECTSOUND8
Definition: dsound.h:73
HWND get_hwnd(void)
Definition: ds3d.c:146
void test_buffer8(LPDIRECTSOUND8, LPDIRECTSOUNDBUFFER *, BOOL, BOOL, LONG, BOOL, LONG, BOOL, double, BOOL, LPDIRECTSOUND3DLISTENER, BOOL, BOOL)
Definition: ds3d8.c:167
static const unsigned int formats[][4]
Definition: dsound_test.h:41
void init_format(WAVEFORMATEX *, int, int, int, int)
Definition: ds3d.c:154
static const unsigned int format_tags[]
Definition: dsound_test.h:93
const char * format_string(const WAVEFORMATEX *wfx)
Definition: capture.c:84
int align(int length, int align)
Definition: dsound8.c:36
char * wave_generate_la(WAVEFORMATEX *, double, DWORD *, BOOL)
Definition: ds3d.c:35
const char * getDSBCAPS(DWORD xmask)
Definition: ds3d.c:106
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
#define WAVE_FORMAT_IEEE_FLOAT
Definition: mmreg.h:97
#define WAVE_FORMAT_2S08
Definition: mmsystem.h:211
#define WAVE_FORMAT_1M08
Definition: mmsystem.h:206
#define WAVE_FORMAT_2M08
Definition: mmsystem.h:210
#define WAVE_FORMAT_2M16
Definition: mmsystem.h:212
#define WAVE_FORMAT_4S08
Definition: mmsystem.h:215
#define WAVE_FORMAT_1S08
Definition: mmsystem.h:207
#define WAVE_FORMAT_4M16
Definition: mmsystem.h:216
#define WAVE_FORMAT_1S16
Definition: mmsystem.h:209
#define WAVE_FORMAT_4M08
Definition: mmsystem.h:214
#define WAVE_FORMAT_4S16
Definition: mmsystem.h:217
#define WAVE_FORMAT_1M16
Definition: mmsystem.h:208
#define WAVE_FORMAT_2S16
Definition: mmsystem.h:213
long LONG
Definition: pedump.c:60
#define WAVE_FORMAT_48S16
Definition: winmm_test.h:23
#define WAVE_FORMAT_48M16
Definition: winmm_test.h:22
#define WAVE_FORMAT_96S08
Definition: winmm_test.h:25
#define WAVE_FORMAT_96M16
Definition: winmm_test.h:26
#define WAVE_FORMAT_96S16
Definition: winmm_test.h:27
#define WAVE_FORMAT_48M08
Definition: winmm_test.h:20
#define WAVE_FORMAT_48S08
Definition: winmm_test.h:21
#define WAVE_FORMAT_96M08
Definition: winmm_test.h:24