2004-06-18 01:03:11 +02:00
|
|
|
/*
|
|
|
|
* Unit tests for dsound functions
|
|
|
|
*
|
|
|
|
* Copyright (c) 2004 Francois Gouget
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2004-06-18 01:03:11 +02:00
|
|
|
*/
|
|
|
|
|
2004-10-22 21:51:54 +02:00
|
|
|
static const unsigned int formats[][4]={
|
|
|
|
{ 8000, 8, 1, 0 },
|
|
|
|
{ 8000, 8, 2, 0 },
|
|
|
|
{ 8000, 16, 1, 0 },
|
|
|
|
{ 8000, 16, 2, 0 },
|
|
|
|
{11025, 8, 1, WAVE_FORMAT_1M08 },
|
|
|
|
{11025, 8, 2, WAVE_FORMAT_1S08 },
|
|
|
|
{11025, 16, 1, WAVE_FORMAT_1M16 },
|
|
|
|
{11025, 16, 2, WAVE_FORMAT_1S16 },
|
|
|
|
{22050, 8, 1, WAVE_FORMAT_2M08 },
|
|
|
|
{22050, 8, 2, WAVE_FORMAT_2S08 },
|
|
|
|
{22050, 16, 1, WAVE_FORMAT_2M16 },
|
|
|
|
{22050, 16, 2, WAVE_FORMAT_2S16 },
|
|
|
|
{44100, 8, 1, WAVE_FORMAT_4M08 },
|
|
|
|
{44100, 8, 2, WAVE_FORMAT_4S08 },
|
|
|
|
{44100, 16, 1, WAVE_FORMAT_4M16 },
|
|
|
|
{44100, 16, 2, WAVE_FORMAT_4S16 },
|
|
|
|
{48000, 8, 1, WAVE_FORMAT_48M08 },
|
|
|
|
{48000, 8, 2, WAVE_FORMAT_48S08 },
|
|
|
|
{48000, 16, 1, WAVE_FORMAT_48M16 },
|
|
|
|
{48000, 16, 2, WAVE_FORMAT_48S16 },
|
|
|
|
{96000, 8, 1, WAVE_FORMAT_96M08 },
|
|
|
|
{96000, 8, 2, WAVE_FORMAT_96S08 },
|
|
|
|
{96000, 16, 1, WAVE_FORMAT_96M16 },
|
|
|
|
{96000, 16, 2, WAVE_FORMAT_96S16 }
|
2004-06-18 01:03:11 +02:00
|
|
|
};
|
|
|
|
#define NB_FORMATS (sizeof(formats)/sizeof(*formats))
|
|
|
|
|
|
|
|
/* The time slice determines how often we will service the buffer */
|
2004-07-17 01:42:32 +02:00
|
|
|
#define TIME_SLICE 31
|
|
|
|
#define BUFFER_LEN 400
|
2004-06-18 01:03:11 +02:00
|
|
|
|
|
|
|
extern char* wave_generate_la(WAVEFORMATEX*,double,DWORD*);
|
2004-12-13 22:19:01 +01:00
|
|
|
extern HWND get_hwnd(void);
|
2004-06-18 01:03:11 +02:00
|
|
|
extern void init_format(WAVEFORMATEX*,int,int,int,int);
|
2006-01-06 12:16:41 +01:00
|
|
|
extern void test_buffer(LPDIRECTSOUND,LPDIRECTSOUNDBUFFER*,
|
2004-06-18 01:03:11 +02:00
|
|
|
BOOL,BOOL,LONG,BOOL,LONG,BOOL,double,BOOL,
|
2005-02-25 20:17:11 +01:00
|
|
|
LPDIRECTSOUND3DLISTENER,BOOL,BOOL,BOOL,DWORD);
|
2006-01-06 12:16:41 +01:00
|
|
|
extern void test_buffer8(LPDIRECTSOUND8,LPDIRECTSOUNDBUFFER*,
|
2004-07-30 20:42:51 +02:00
|
|
|
BOOL,BOOL,LONG,BOOL,LONG,BOOL,double,BOOL,
|
|
|
|
LPDIRECTSOUND3DLISTENER,BOOL,BOOL);
|
2004-08-25 04:09:00 +02:00
|
|
|
extern const char * getDSBCAPS(DWORD xmask);
|
2005-02-16 17:09:02 +01:00
|
|
|
extern int align(int length, int align);
|
2005-03-05 11:49:08 +01:00
|
|
|
extern const char * get_file_version(const char * file_name);
|
2005-11-18 13:04:36 +01:00
|
|
|
extern const char * get_format_str(WORD format);
|
|
|
|
extern const char * format_string(const WAVEFORMATEX* wfx);
|