Print info about primary buffer format.

This commit is contained in:
Robert Reif 2005-02-10 20:26:20 +00:00 committed by Alexandre Julliard
parent 8efb8794e8
commit 50dc513b0f
4 changed files with 48 additions and 14 deletions

View file

@ -628,7 +628,7 @@ static HRESULT test_secondary(LPGUID lpGuid, int play,
LPDIRECTSOUNDBUFFER primary=NULL,secondary=NULL;
LPDIRECTSOUND3DLISTENER listener=NULL;
DSBUFFERDESC bufdesc;
WAVEFORMATEX wfx;
WAVEFORMATEX wfx, wfx1;
int ref;
/* Create the DirectSound object */
@ -659,6 +659,12 @@ static HRESULT test_secondary(LPGUID lpGuid, int play,
DXGetErrorString8(rc));
if (rc==DS_OK && primary!=NULL) {
rc=IDirectSoundBuffer_GetFormat(primary,&wfx1,sizeof(wfx1),NULL);
ok(rc==DS_OK,"IDirectSoundBuffer8_Getformat() failed: %s\n",
DXGetErrorString8(rc));
if (rc!=DS_OK)
goto EXIT1;
if (has_listener) {
rc=IDirectSoundBuffer_QueryInterface(primary,
&IID_IDirectSound3DListener,
@ -710,7 +716,8 @@ static HRESULT test_secondary(LPGUID lpGuid, int play,
bufdesc.dwBufferBytes=wfx.nAvgBytesPerSec*BUFFER_LEN/1000;
bufdesc.lpwfxFormat=&wfx;
if (winetest_interactive) {
trace(" Testing a %s%ssecondary buffer %s%s%s%sat %ldx%dx%d\n",
trace(" Testing a %s%ssecondary buffer %s%s%s%sat %ldx%dx%d "
"with a primary buffer at %ldx%dx%d\n",
has_3dbuffer?"3D ":"",
has_duplicate?"duplicated ":"",
listener!=NULL||move_sound?"with ":"",
@ -718,7 +725,8 @@ static HRESULT test_secondary(LPGUID lpGuid, int play,
listener!=NULL?"listener ":"",
listener&&move_sound?"and moving sound ":move_sound?
"moving sound ":"",
wfx.nSamplesPerSec,wfx.wBitsPerSample,wfx.nChannels);
wfx.nSamplesPerSec,wfx.wBitsPerSample,wfx.nChannels,
wfx1.nSamplesPerSec,wfx1.wBitsPerSample,wfx1.nChannels);
}
rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL);
ok(rc==DS_OK && secondary!=NULL,"IDirectSound_CreateSoundBuffer() "
@ -839,6 +847,7 @@ static HRESULT test_secondary(LPGUID lpGuid, int play,
}
}
}
EXIT1:
if (has_listener) {
ref=IDirectSound3DListener_Release(listener);
ok(ref==0,"IDirectSound3dListener_Release() listener has %d "

View file

@ -530,7 +530,7 @@ static HRESULT test_secondary8(LPGUID lpGuid, int play,
LPDIRECTSOUNDBUFFER primary=NULL,secondary=NULL;
LPDIRECTSOUND3DLISTENER listener=NULL;
DSBUFFERDESC bufdesc;
WAVEFORMATEX wfx;
WAVEFORMATEX wfx, wfx1;
int ref;
/* Create the DirectSound object */
@ -561,6 +561,12 @@ static HRESULT test_secondary8(LPGUID lpGuid, int play,
DXGetErrorString8(rc));
if (rc==DS_OK && primary!=NULL) {
rc=IDirectSoundBuffer_GetFormat(primary,&wfx1,sizeof(wfx1),NULL);
ok(rc==DS_OK,"IDirectSoundBuffer8_Getformat() failed: %s\n",
DXGetErrorString8(rc));
if (rc!=DS_OK)
goto EXIT1;
if (has_listener) {
rc=IDirectSoundBuffer_QueryInterface(primary,
&IID_IDirectSound3DListener,
@ -624,7 +630,8 @@ static HRESULT test_secondary8(LPGUID lpGuid, int play,
}
if (winetest_interactive) {
trace(" Testing a %s%ssecondary buffer %s%s%s%sat %ldx%dx%d\n",
trace(" Testing a %s%ssecondary buffer %s%s%s%sat %ldx%dx%d "
"with a primary buffer at %ldx%dx%d\n",
has_3dbuffer?"3D ":"",
has_duplicate?"duplicated ":"",
listener!=NULL||move_sound?"with ":"",
@ -632,7 +639,8 @@ static HRESULT test_secondary8(LPGUID lpGuid, int play,
listener!=NULL?"listener ":"",
listener&&move_sound?"and moving sound ":move_sound?
"moving sound ":"",
wfx.nSamplesPerSec,wfx.wBitsPerSample,wfx.nChannels);
wfx.nSamplesPerSec,wfx.wBitsPerSample,wfx.nChannels,
wfx1.nSamplesPerSec,wfx1.wBitsPerSample,wfx1.nChannels);
}
rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL);
ok(rc==DS_OK && secondary!=NULL,"IDirectSound8_CreateSoundBuffer() "
@ -753,6 +761,7 @@ static HRESULT test_secondary8(LPGUID lpGuid, int play,
}
}
}
EXIT1:
if (has_listener) {
ref=IDirectSound3DListener_Release(listener);
ok(ref==0,"IDirectSound3dListener_Release() listener has %d "

View file

@ -623,7 +623,7 @@ static HRESULT test_secondary(LPGUID lpGuid)
LPDIRECTSOUNDBUFFER primary=NULL,secondary=NULL;
DSBUFFERDESC bufdesc;
DSCAPS dscaps;
WAVEFORMATEX wfx;
WAVEFORMATEX wfx, wfx1;
DWORD f;
int ref;
@ -659,6 +659,12 @@ static HRESULT test_secondary(LPGUID lpGuid)
"%s\n",DXGetErrorString8(rc));
if (rc==DS_OK && primary!=NULL) {
rc=IDirectSoundBuffer_GetFormat(primary,&wfx1,sizeof(wfx1),NULL);
ok(rc==DS_OK,"IDirectSoundBuffer8_Getformat() failed: %s\n",
DXGetErrorString8(rc));
if (rc!=DS_OK)
goto EXIT1;
for (f=0;f<NB_FORMATS;f++) {
init_format(&wfx,WAVE_FORMAT_PCM,formats[f][0],formats[f][1],
formats[f][2]);
@ -681,8 +687,10 @@ static HRESULT test_secondary(LPGUID lpGuid)
bufdesc.dwBufferBytes=wfx.nAvgBytesPerSec*BUFFER_LEN/1000;
bufdesc.lpwfxFormat=&wfx;
if (winetest_interactive) {
trace(" Testing a secondary buffer at %ldx%dx%d\n",
wfx.nSamplesPerSec,wfx.wBitsPerSample,wfx.nChannels);
trace(" Testing a secondary buffer at %ldx%dx%d "
"with a primary buffer at %ldx%dx%d\n",
wfx.nSamplesPerSec,wfx.wBitsPerSample,wfx.nChannels,
wfx1.nSamplesPerSec,wfx1.wBitsPerSample,wfx1.nChannels);
}
rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL);
ok(rc==DS_OK && secondary!=NULL,
@ -698,7 +706,7 @@ static HRESULT test_secondary(LPGUID lpGuid)
"should have 0\n",ref);
}
}
EXIT1:
ref=IDirectSoundBuffer_Release(primary);
ok(ref==0,"IDirectSoundBuffer_Release() primary has %d references, "
"should have 0\n",ref);

View file

@ -644,7 +644,7 @@ static HRESULT test_secondary8(LPGUID lpGuid)
LPDIRECTSOUNDBUFFER primary=NULL,secondary=NULL;
DSBUFFERDESC bufdesc;
DSCAPS dscaps;
WAVEFORMATEX wfx;
WAVEFORMATEX wfx, wfx1;
DWORD f;
int ref;
@ -680,6 +680,12 @@ static HRESULT test_secondary8(LPGUID lpGuid)
"%s\n",DXGetErrorString8(rc));
if (rc==DS_OK && primary!=NULL) {
rc=IDirectSoundBuffer_GetFormat(primary,&wfx1,sizeof(wfx1),NULL);
ok(rc==DS_OK,"IDirectSoundBuffer8_Getformat() failed: %s\n",
DXGetErrorString8(rc));
if (rc!=DS_OK)
goto EXIT1;
for (f=0;f<NB_FORMATS;f++) {
init_format(&wfx,WAVE_FORMAT_PCM,formats[f][0],formats[f][1],
formats[f][2]);
@ -702,8 +708,10 @@ static HRESULT test_secondary8(LPGUID lpGuid)
bufdesc.dwBufferBytes=wfx.nAvgBytesPerSec*BUFFER_LEN/1000;
bufdesc.lpwfxFormat=&wfx;
if (winetest_interactive) {
trace(" Testing a secondary buffer at %ldx%dx%d\n",
wfx.nSamplesPerSec,wfx.wBitsPerSample,wfx.nChannels);
trace(" Testing a secondary buffer at %ldx%dx%d "
"with a primary buffer at %ldx%dx%d\n",
wfx.nSamplesPerSec,wfx.wBitsPerSample,wfx.nChannels,
wfx1.nSamplesPerSec,wfx1.wBitsPerSample,wfx1.nChannels);
}
rc=IDirectSound8_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL);
ok(rc==DS_OK && secondary!=NULL,
@ -719,7 +727,7 @@ static HRESULT test_secondary8(LPGUID lpGuid)
"should have 0\n",ref);
}
}
EXIT1:
ref=IDirectSoundBuffer_Release(primary);
ok(ref==0,"IDirectSoundBuffer_Release() primary has %d references, "
"should have 0\n",ref);