2004-06-17 23:03:11 +00: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 12:49:52 +00:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2004-06-17 23:03:11 +00:00
|
|
|
*/
|
|
|
|
|
2004-10-22 19:51:54 +00:00
|
|
|
static const unsigned int formats[][4]={
|
|
|
|
{ 8000, 8, 1, 0 },
|
|
|
|
{ 8000, 8, 2, 0 },
|
|
|
|
{ 8000, 16, 1, 0 },
|
|
|
|
{ 8000, 16, 2, 0 },
|
2007-11-05 22:23:28 +00:00
|
|
|
{ 8000, 24, 1, 0 },
|
|
|
|
{ 8000, 24, 2, 0 },
|
|
|
|
{ 8000, 32, 1, 0 },
|
|
|
|
{ 8000, 32, 2, 0 },
|
2004-10-22 19:51:54 +00:00
|
|
|
{11025, 8, 1, WAVE_FORMAT_1M08 },
|
|
|
|
{11025, 8, 2, WAVE_FORMAT_1S08 },
|
|
|
|
{11025, 16, 1, WAVE_FORMAT_1M16 },
|
|
|
|
{11025, 16, 2, WAVE_FORMAT_1S16 },
|
2007-11-05 22:23:28 +00:00
|
|
|
{11025, 24, 1, 0 },
|
|
|
|
{11025, 24, 2, 0 },
|
|
|
|
{11025, 32, 1, 0 },
|
|
|
|
{11025, 32, 2, 0 },
|
2004-10-22 19:51:54 +00:00
|
|
|
{22050, 8, 1, WAVE_FORMAT_2M08 },
|
|
|
|
{22050, 8, 2, WAVE_FORMAT_2S08 },
|
|
|
|
{22050, 16, 1, WAVE_FORMAT_2M16 },
|
|
|
|
{22050, 16, 2, WAVE_FORMAT_2S16 },
|
2007-11-05 22:23:28 +00:00
|
|
|
{22050, 24, 1, 0 },
|
|
|
|
{22050, 24, 2, 0 },
|
|
|
|
{22050, 32, 1, 0 },
|
|
|
|
{22050, 32, 2, 0 },
|
2004-10-22 19:51:54 +00:00
|
|
|
{44100, 8, 1, WAVE_FORMAT_4M08 },
|
|
|
|
{44100, 8, 2, WAVE_FORMAT_4S08 },
|
|
|
|
{44100, 16, 1, WAVE_FORMAT_4M16 },
|
|
|
|
{44100, 16, 2, WAVE_FORMAT_4S16 },
|
2007-11-05 22:23:28 +00:00
|
|
|
{44100, 24, 1, 0 },
|
|
|
|
{44100, 24, 2, 0 },
|
|
|
|
{44100, 32, 1, 0 },
|
|
|
|
{44100, 32, 2, 0 },
|
2004-10-22 19:51:54 +00:00
|
|
|
{48000, 8, 1, WAVE_FORMAT_48M08 },
|
|
|
|
{48000, 8, 2, WAVE_FORMAT_48S08 },
|
|
|
|
{48000, 16, 1, WAVE_FORMAT_48M16 },
|
|
|
|
{48000, 16, 2, WAVE_FORMAT_48S16 },
|
2007-11-05 22:23:28 +00:00
|
|
|
{48000, 24, 1, 0 },
|
|
|
|
{48000, 24, 2, 0 },
|
|
|
|
{48000, 32, 1, 0 },
|
|
|
|
{48000, 32, 2, 0 },
|
2004-10-22 19:51:54 +00:00
|
|
|
{96000, 8, 1, WAVE_FORMAT_96M08 },
|
|
|
|
{96000, 8, 2, WAVE_FORMAT_96S08 },
|
|
|
|
{96000, 16, 1, WAVE_FORMAT_96M16 },
|
2007-11-05 22:23:28 +00:00
|
|
|
{96000, 16, 2, WAVE_FORMAT_96S16 },
|
|
|
|
{96000, 24, 1, 0 },
|
|
|
|
{96000, 24, 2, 0 },
|
|
|
|
{96000, 32, 1, 0 },
|
|
|
|
{96000, 32, 2, 0 }
|
2004-06-17 23:03:11 +00:00
|
|
|
};
|
|
|
|
#define NB_FORMATS (sizeof(formats)/sizeof(*formats))
|
|
|
|
|
|
|
|
/* The time slice determines how often we will service the buffer */
|
2004-07-16 23:42:32 +00:00
|
|
|
#define TIME_SLICE 31
|
|
|
|
#define BUFFER_LEN 400
|
2004-06-17 23:03:11 +00:00
|
|
|
|
|
|
|
extern char* wave_generate_la(WAVEFORMATEX*,double,DWORD*);
|
2004-12-13 21:19:01 +00:00
|
|
|
extern HWND get_hwnd(void);
|
2004-06-17 23:03:11 +00:00
|
|
|
extern void init_format(WAVEFORMATEX*,int,int,int,int);
|
2006-01-06 11:16:41 +00:00
|
|
|
extern void test_buffer(LPDIRECTSOUND,LPDIRECTSOUNDBUFFER*,
|
2004-06-17 23:03:11 +00:00
|
|
|
BOOL,BOOL,LONG,BOOL,LONG,BOOL,double,BOOL,
|
2005-02-25 19:17:11 +00:00
|
|
|
LPDIRECTSOUND3DLISTENER,BOOL,BOOL,BOOL,DWORD);
|
2006-01-06 11:16:41 +00:00
|
|
|
extern void test_buffer8(LPDIRECTSOUND8,LPDIRECTSOUNDBUFFER*,
|
2004-07-30 18:42:51 +00:00
|
|
|
BOOL,BOOL,LONG,BOOL,LONG,BOOL,double,BOOL,
|
|
|
|
LPDIRECTSOUND3DLISTENER,BOOL,BOOL);
|
2004-08-25 02:09:00 +00:00
|
|
|
extern const char * getDSBCAPS(DWORD xmask);
|
2005-02-16 16:09:02 +00:00
|
|
|
extern int align(int length, int align);
|
2005-03-05 10:49:08 +00:00
|
|
|
extern const char * get_file_version(const char * file_name);
|
2005-11-18 12:04:36 +00:00
|
|
|
extern const char * format_string(const WAVEFORMATEX* wfx);
|