| 1 | /* $Id: OS2SNDBUFFER.CPP,v 1.3 1999-06-10 17:09:30 phaller Exp $ */
|
|---|
| 2 |
|
|---|
| 3 | /*
|
|---|
| 4 | * DirectSound SoundBuffer class
|
|---|
| 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 |
|
|---|
| 13 | /*@Const************************************************************************
|
|---|
| 14 | * Defined Constants *
|
|---|
| 15 | *******************************************************************************/
|
|---|
| 16 | #define INCL_DOSMEMMGR
|
|---|
| 17 | #define INCL_DIRECTSOUNDBUFFER_GUID
|
|---|
| 18 | #define WIN32SDK_NOPOSTWRAPPER
|
|---|
| 19 |
|
|---|
| 20 | /*@Header***********************************************************************
|
|---|
| 21 | * Header Files *
|
|---|
| 22 | *******************************************************************************/
|
|---|
| 23 | #include <os2.h>
|
|---|
| 24 | #include <stdlib.h>
|
|---|
| 25 | #include <string.h>
|
|---|
| 26 |
|
|---|
| 27 | #include "no.h" /* NO* defines for windows.h */
|
|---|
| 28 | #include <w_windows.h>
|
|---|
| 29 | #include <dsound.h>
|
|---|
| 30 | #include <Win32SDKPostWrapper.h>
|
|---|
| 31 |
|
|---|
| 32 | #include "os2dsound.h"
|
|---|
| 33 | #include "os2sndbuffer.h"
|
|---|
| 34 | #include "misc.h"
|
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 | /* KSO Apr 19 1999: Set correct interface. *
|
|---|
| 38 | * (INTERFACE is used in the THIS and THIS_ macros) */
|
|---|
| 39 | #undef INTERFACE
|
|---|
| 40 | #define INTERFACE IDirectSoundBuffer
|
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 |
|
|---|
| 44 | //******************************************************************************
|
|---|
| 45 | //******************************************************************************
|
|---|
| 46 | OS2IDirectSoundBuffer::OS2IDirectSoundBuffer(const DSBUFFERDESC *lpDSBufferDesc) //KSO Apr 13 1999: const, SDK changes
|
|---|
| 47 | : Referenced(0), lastError(DS_OK)
|
|---|
| 48 | {
|
|---|
| 49 | APIRET rc;
|
|---|
| 50 |
|
|---|
| 51 | lpVtbl = &Vtbl;
|
|---|
| 52 | Vtbl.AddRef = SoundBufAddRef;
|
|---|
| 53 | Vtbl.Release = SoundBufRelease;
|
|---|
| 54 | Vtbl.QueryInterface = SoundBufQueryInterface;
|
|---|
| 55 | Vtbl.GetCaps = SoundBufGetCaps;
|
|---|
| 56 | Vtbl.GetFormat = SoundBufGetFormat;
|
|---|
| 57 | Vtbl.GetVolume = SoundBufGetVolume;
|
|---|
| 58 | Vtbl.GetStatus = SoundBufGetStatus;
|
|---|
| 59 | Vtbl.GetCurrentPosition = SoundBufGetCurrentPosition;
|
|---|
| 60 | Vtbl.GetPan = SoundBufGetPan;
|
|---|
| 61 | Vtbl.Initialize = SoundBufInitialize;
|
|---|
| 62 | Vtbl.Restore = SoundBufRestore;
|
|---|
| 63 | Vtbl.SetFormat = SoundBufSetFormat;
|
|---|
| 64 | Vtbl.SetVolume = SoundBufSetVolume;
|
|---|
| 65 | Vtbl.SetCurrentPosition = SoundBufSetCurrentPosition;
|
|---|
| 66 | Vtbl.SetPan = SoundBufSetPan;
|
|---|
| 67 | Vtbl.Lock = SoundBufLock;
|
|---|
| 68 | Vtbl.Unlock = SoundBufUnlock;
|
|---|
| 69 | Vtbl.Stop = SoundBufStop;
|
|---|
| 70 | Vtbl.Play = SoundBufPlay;
|
|---|
| 71 |
|
|---|
| 72 | pan = 0;
|
|---|
| 73 | writepos = 0;
|
|---|
| 74 | playpos = 0;
|
|---|
| 75 | frequency = 22050;
|
|---|
| 76 | status = 0;;
|
|---|
| 77 | fLocked = FALSE;
|
|---|
| 78 | volume = 0;
|
|---|
| 79 | lpfxFormat= NULL;
|
|---|
| 80 | lpBuffer = NULL;
|
|---|
| 81 |
|
|---|
| 82 | memcpy(&bufferdesc, lpDSBufferDesc, sizeof(DSBUFFERDESC));
|
|---|
| 83 | if(!(bufferdesc.dwFlags & DSBCAPS_PRIMARYBUFFER)) {
|
|---|
| 84 | if(bufferdesc.lpwfxFormat == NULL || bufferdesc.dwBufferBytes == 0) {
|
|---|
| 85 | dprintf(("bufferdesc not valid!"));
|
|---|
| 86 | lastError = DSERR_INVALIDPARAM;
|
|---|
| 87 | return;
|
|---|
| 88 | }
|
|---|
| 89 | lpfxFormat = (WAVEFORMATEX *)malloc(bufferdesc.lpwfxFormat->cbSize + sizeof(WAVEFORMATEX));
|
|---|
| 90 | memcpy(lpfxFormat, bufferdesc.lpwfxFormat, bufferdesc.lpwfxFormat->cbSize + sizeof(WAVEFORMATEX));
|
|---|
| 91 |
|
|---|
| 92 | rc = DosAllocMem((PPVOID)&lpBuffer, bufferdesc.dwBufferBytes, PAG_READ|PAG_WRITE|PAG_COMMIT);
|
|---|
| 93 | if(rc) {
|
|---|
| 94 | dprintf(("DosAllocMem returned %d", rc));
|
|---|
| 95 | lpBuffer = NULL;
|
|---|
| 96 | lastError = DSERR_OUTOFMEMORY;
|
|---|
| 97 | return;
|
|---|
| 98 | }
|
|---|
| 99 | }
|
|---|
| 100 | else {//todo: primary buffer
|
|---|
| 101 | }
|
|---|
| 102 | }
|
|---|
| 103 | //******************************************************************************
|
|---|
| 104 | //******************************************************************************
|
|---|
| 105 | OS2IDirectSoundBuffer::~OS2IDirectSoundBuffer()
|
|---|
| 106 | {
|
|---|
| 107 | if(lpBuffer)
|
|---|
| 108 | DosFreeMem(lpBuffer);
|
|---|
| 109 | if(lpfxFormat)
|
|---|
| 110 | free(lpfxFormat);
|
|---|
| 111 |
|
|---|
| 112 | }
|
|---|
| 113 | //******************************************************************************
|
|---|
| 114 | //******************************************************************************
|
|---|
| 115 | HRESULT WIN32API SoundBufQueryInterface(THIS, REFIID riid, LPVOID FAR * ppvObj)
|
|---|
| 116 | {
|
|---|
| 117 | dprintf(("OS2IDirectSoundBuffer::QueryInterface\n"));
|
|---|
| 118 | if(This == NULL) {
|
|---|
| 119 | return DSERR_INVALIDPARAM;
|
|---|
| 120 | }
|
|---|
| 121 | *ppvObj = NULL;
|
|---|
| 122 |
|
|---|
| 123 | if(!IsEqualGUID(riid, IID_IDirectSoundBuffer))
|
|---|
| 124 | return E_NOINTERFACE;
|
|---|
| 125 |
|
|---|
| 126 | *ppvObj = This;
|
|---|
| 127 |
|
|---|
| 128 | SoundBufAddRef(This);
|
|---|
| 129 | return(DS_OK);
|
|---|
| 130 | }
|
|---|
| 131 | //******************************************************************************
|
|---|
| 132 | //******************************************************************************
|
|---|
| 133 | ULONG WIN32API SoundBufAddRef(THIS)
|
|---|
| 134 | {
|
|---|
| 135 | OS2IDirectSoundBuffer *me = (OS2IDirectSoundBuffer *)This;
|
|---|
| 136 |
|
|---|
| 137 | dprintf(("OS2IDirectSoundBuffer::AddRef %d\n", me->Referenced+1));
|
|---|
| 138 | if(me == NULL) {
|
|---|
| 139 | return 0;
|
|---|
| 140 | }
|
|---|
| 141 | return ++me->Referenced;
|
|---|
| 142 | }
|
|---|
| 143 | //******************************************************************************
|
|---|
| 144 | //******************************************************************************
|
|---|
| 145 | ULONG WIN32API SoundBufRelease(THIS)
|
|---|
| 146 | {
|
|---|
| 147 | OS2IDirectSoundBuffer *me = (OS2IDirectSoundBuffer *)This;
|
|---|
| 148 |
|
|---|
| 149 | dprintf((" OS2IDirectSoundBuffer::Release %d\n", me->Referenced-1));
|
|---|
| 150 | if(me == NULL) {
|
|---|
| 151 | return 0;
|
|---|
| 152 | }
|
|---|
| 153 | if(me->Referenced) {
|
|---|
| 154 | me->Referenced--;
|
|---|
| 155 | if(me->Referenced == 0) {
|
|---|
| 156 | delete me;
|
|---|
| 157 | return(0);
|
|---|
| 158 | }
|
|---|
| 159 | else return me->Referenced;
|
|---|
| 160 | }
|
|---|
| 161 | else return(0);
|
|---|
| 162 | }
|
|---|
| 163 | //******************************************************************************
|
|---|
| 164 | //******************************************************************************
|
|---|
| 165 | HRESULT __stdcall SoundBufGetCaps(THIS_ LPDSBCAPS lpDSCaps)
|
|---|
| 166 | {
|
|---|
| 167 | OS2IDirectSoundBuffer *me = (OS2IDirectSoundBuffer *)This;
|
|---|
| 168 |
|
|---|
| 169 | dprintf(("SoundBufGetCaps"));
|
|---|
| 170 | if(me == NULL || lpDSCaps == NULL) {
|
|---|
| 171 | return DSERR_INVALIDPARAM;
|
|---|
| 172 | }
|
|---|
| 173 | return DS_OK;
|
|---|
| 174 | }
|
|---|
| 175 | //******************************************************************************
|
|---|
| 176 | //******************************************************************************
|
|---|
| 177 | HRESULT __stdcall SoundBufGetCurrentPosition(THIS_ LPDWORD lpdwCurrentPlayCursor,
|
|---|
| 178 | LPDWORD lpdwCurrentWriteCursor)
|
|---|
| 179 | {
|
|---|
| 180 | OS2IDirectSoundBuffer *me = (OS2IDirectSoundBuffer *)This;
|
|---|
| 181 |
|
|---|
| 182 | dprintf(("SoundBufGetCurrentPosition"));
|
|---|
| 183 | if(me == NULL || lpdwCurrentPlayCursor == NULL || lpdwCurrentWriteCursor == NULL) {
|
|---|
| 184 | return DSERR_INVALIDPARAM;
|
|---|
| 185 | }
|
|---|
| 186 | *lpdwCurrentPlayCursor = me->playpos;
|
|---|
| 187 | *lpdwCurrentWriteCursor = me->writepos;
|
|---|
| 188 | return DS_OK;
|
|---|
| 189 | }
|
|---|
| 190 | //******************************************************************************
|
|---|
| 191 | //******************************************************************************
|
|---|
| 192 | HRESULT __stdcall SoundBufGetFormat(THIS_ LPWAVEFORMATEX lpwfxFormat,
|
|---|
| 193 | DWORD ddwSizeAllocated, LPDWORD lpdwSizeWritten)
|
|---|
| 194 | {
|
|---|
| 195 | OS2IDirectSoundBuffer *me = (OS2IDirectSoundBuffer *)This;
|
|---|
| 196 | int copysize;
|
|---|
| 197 |
|
|---|
| 198 | dprintf(("SoundBufGetFormat"));
|
|---|
| 199 | if(me == NULL || lpwfxFormat == NULL || ddwSizeAllocated == 0) {
|
|---|
| 200 | return DSERR_INVALIDPARAM;
|
|---|
| 201 | }
|
|---|
| 202 | copysize = min(ddwSizeAllocated, (me->lpfxFormat->cbSize + sizeof(WAVEFORMATEX)));
|
|---|
| 203 | memcpy(lpwfxFormat, me->lpfxFormat, copysize);
|
|---|
| 204 |
|
|---|
| 205 | if(lpdwSizeWritten) {
|
|---|
| 206 | *lpdwSizeWritten = copysize;
|
|---|
| 207 | }
|
|---|
| 208 | return DS_OK;
|
|---|
| 209 | }
|
|---|
| 210 | //******************************************************************************
|
|---|
| 211 | //******************************************************************************
|
|---|
| 212 | HRESULT __stdcall SoundBufGetVolume(THIS_ LPLONG lplVolume)
|
|---|
| 213 | {
|
|---|
| 214 | OS2IDirectSoundBuffer *me = (OS2IDirectSoundBuffer *)This;
|
|---|
| 215 |
|
|---|
| 216 | dprintf(("SoundBufGetVolume"));
|
|---|
| 217 | if(me == NULL || lplVolume == NULL) {
|
|---|
| 218 | return DSERR_INVALIDPARAM;
|
|---|
| 219 | }
|
|---|
| 220 | *lplVolume = me->volume;
|
|---|
| 221 | return DS_OK;
|
|---|
| 222 | }
|
|---|
| 223 | //******************************************************************************
|
|---|
| 224 | //******************************************************************************
|
|---|
| 225 | HRESULT __stdcall SoundBufGetPan(THIS_ LPLONG lplPan)
|
|---|
| 226 | {
|
|---|
| 227 | OS2IDirectSoundBuffer *me = (OS2IDirectSoundBuffer *)This;
|
|---|
| 228 |
|
|---|
| 229 | dprintf(("SoundBufGetPan"));
|
|---|
| 230 | if(me == NULL || lplPan == NULL) {
|
|---|
| 231 | return DSERR_INVALIDPARAM;
|
|---|
| 232 | }
|
|---|
| 233 | *lplPan = me->pan;
|
|---|
| 234 | return DS_OK;
|
|---|
| 235 | }
|
|---|
| 236 | //******************************************************************************
|
|---|
| 237 | //******************************************************************************
|
|---|
| 238 | HRESULT __stdcall SoundBufGetFrequency(THIS_ LPDWORD lpdwFrequency)
|
|---|
| 239 | {
|
|---|
| 240 | OS2IDirectSoundBuffer *me = (OS2IDirectSoundBuffer *)This;
|
|---|
| 241 |
|
|---|
| 242 | dprintf(("SoundBufGetFrequency"));
|
|---|
| 243 | if(me == NULL || lpdwFrequency == NULL) {
|
|---|
| 244 | return DSERR_INVALIDPARAM;
|
|---|
| 245 | }
|
|---|
| 246 | *lpdwFrequency = me->frequency;
|
|---|
| 247 | return DS_OK;
|
|---|
| 248 | }
|
|---|
| 249 | //******************************************************************************
|
|---|
| 250 | //******************************************************************************
|
|---|
| 251 | HRESULT __stdcall SoundBufGetStatus(THIS_ LPDWORD lpdwStatus)
|
|---|
| 252 | {
|
|---|
| 253 | OS2IDirectSoundBuffer *me = (OS2IDirectSoundBuffer *)This;
|
|---|
| 254 |
|
|---|
| 255 | dprintf(("SoundBufGetStatus"));
|
|---|
| 256 | if(me == NULL || lpdwStatus == NULL) {
|
|---|
| 257 | return DSERR_INVALIDPARAM;
|
|---|
| 258 | }
|
|---|
| 259 | *lpdwStatus = me->status;
|
|---|
| 260 | return DS_OK;
|
|---|
| 261 | }
|
|---|
| 262 | //******************************************************************************
|
|---|
| 263 | //******************************************************************************
|
|---|
| 264 | #if 0 //KSO Apr 19 1999: some parameter incompabilities between newer and older SDKs.
|
|---|
| 265 | HRESULT __stdcall SoundBufInitialize(THIS_ LPDIRECTSOUND, LPDSBUFFERDESC )
|
|---|
| 266 | #else
|
|---|
| 267 | HRESULT __stdcall SoundBufInitialize(THIS_ LPDIRECTSOUND, LPCDSBUFFERDESC )
|
|---|
| 268 | #endif
|
|---|
| 269 | {
|
|---|
| 270 | OS2IDirectSoundBuffer *me = (OS2IDirectSoundBuffer *)This;
|
|---|
| 271 |
|
|---|
| 272 | dprintf(("SoundBufInitialize"));
|
|---|
| 273 | if(me == NULL) {
|
|---|
| 274 | return DSERR_INVALIDPARAM;
|
|---|
| 275 | }
|
|---|
| 276 | return DSERR_ALREADYINITIALIZED; //todo: for future extensions (dx5/6 ??)
|
|---|
| 277 | }
|
|---|
| 278 | //******************************************************************************
|
|---|
| 279 | //******************************************************************************
|
|---|
| 280 | #if 0 //KSO Apr 19 1999: some parameter incompabilities between newer and older SDKs.
|
|---|
| 281 | HRESULT __stdcall SoundBufLock(THIS_ DWORD dwWriteCursor, DWORD dwWriteBytes,
|
|---|
| 282 | LPVOID lplpvAudioPtr1, LPDWORD lpdwAudioBytes1,
|
|---|
| 283 | LPVOID lplpvAudioPtr2, LPDWORD lpdwAudioBytes2,
|
|---|
| 284 | DWORD dwFlags)
|
|---|
| 285 | #else
|
|---|
| 286 | HRESULT __stdcall SoundBufLock(THIS_ DWORD dwWriteCursor, DWORD dwWriteBytes,
|
|---|
| 287 | LPVOID *lplpvAudioPtr1, LPDWORD lpdwAudioBytes1,
|
|---|
| 288 | LPVOID *lplpvAudioPtr2, LPDWORD lpdwAudioBytes2,
|
|---|
| 289 | DWORD dwFlags)
|
|---|
| 290 | #endif
|
|---|
| 291 | {
|
|---|
| 292 | OS2IDirectSoundBuffer *me = (OS2IDirectSoundBuffer *)This;
|
|---|
| 293 |
|
|---|
| 294 | dprintf(("SoundBufLock"));
|
|---|
| 295 | if(me == NULL || !lplpvAudioPtr1 || !lpdwAudioBytes1) {
|
|---|
| 296 | return(DSERR_INVALIDPARAM);
|
|---|
| 297 | }
|
|---|
| 298 | //not sure if this is an error, but it's certainly a smart thing to do (cond. == true)
|
|---|
| 299 | if(dwWriteBytes > me->bufferdesc.dwBufferBytes) {
|
|---|
| 300 | dprintf(("SoundBufLock: dwWriteBytes > me->bufferdesc.dwBufferBytes"));
|
|---|
| 301 | return(DSERR_INVALIDPARAM);
|
|---|
| 302 | }
|
|---|
| 303 | if(dwFlags & DSBLOCK_FROMWRITECURSOR) {
|
|---|
| 304 | dwWriteCursor = me->writepos;
|
|---|
| 305 | }
|
|---|
| 306 | if(dwWriteCursor + dwWriteBytes > me->bufferdesc.dwBufferBytes ) {
|
|---|
| 307 | *(DWORD *)lplpvAudioPtr1 = (DWORD)(me->lpBuffer + dwWriteCursor);
|
|---|
| 308 | *lpdwAudioBytes1 = me->bufferdesc.dwBufferBytes - dwWriteCursor;
|
|---|
| 309 | if(lplpvAudioPtr2 && lpdwAudioBytes2) {
|
|---|
| 310 | *(DWORD *)lplpvAudioPtr2 = (DWORD)me->lpBuffer;
|
|---|
| 311 | *lpdwAudioBytes2 = dwWriteBytes - *lpdwAudioBytes1;
|
|---|
| 312 | }
|
|---|
| 313 | }
|
|---|
| 314 | else {
|
|---|
| 315 | *(DWORD *)lplpvAudioPtr1 = (DWORD)(me->lpBuffer + dwWriteCursor);
|
|---|
| 316 | *lpdwAudioBytes1 = dwWriteBytes;
|
|---|
| 317 | if(lplpvAudioPtr2 && lpdwAudioBytes2) {
|
|---|
| 318 | *(DWORD *)lplpvAudioPtr2 = 0;
|
|---|
| 319 | *lpdwAudioBytes2 = 0;
|
|---|
| 320 | }
|
|---|
| 321 | }
|
|---|
| 322 | me->fLocked = TRUE;
|
|---|
| 323 | return DS_OK;
|
|---|
| 324 | }
|
|---|
| 325 | //******************************************************************************
|
|---|
| 326 | //******************************************************************************
|
|---|
| 327 | HRESULT __stdcall SoundBufPlay(THIS_ DWORD,DWORD,DWORD )
|
|---|
| 328 | {
|
|---|
| 329 | OS2IDirectSoundBuffer *me = (OS2IDirectSoundBuffer *)This;
|
|---|
| 330 |
|
|---|
| 331 | dprintf(("SoundBufPlay"));
|
|---|
| 332 | if(me == NULL) {
|
|---|
| 333 | return DSERR_INVALIDPARAM;
|
|---|
| 334 | }
|
|---|
| 335 | return DS_OK;
|
|---|
| 336 | }
|
|---|
| 337 | //******************************************************************************
|
|---|
| 338 | //******************************************************************************
|
|---|
| 339 | HRESULT __stdcall SoundBufSetCurrentPosition(THIS_ DWORD dwNewPosition)
|
|---|
| 340 | {
|
|---|
| 341 | OS2IDirectSoundBuffer *me = (OS2IDirectSoundBuffer *)This;
|
|---|
| 342 |
|
|---|
| 343 | dprintf(("SoundBufSetCurrentPosition"));
|
|---|
| 344 | if(me == NULL) {
|
|---|
| 345 | return DSERR_INVALIDPARAM;
|
|---|
| 346 | }
|
|---|
| 347 | //todo: check for primary buffer (can't do it with those)
|
|---|
| 348 | me->playpos = dwNewPosition;
|
|---|
| 349 | me->writepos = dwNewPosition;
|
|---|
| 350 | return DS_OK;
|
|---|
| 351 | }
|
|---|
| 352 | //******************************************************************************
|
|---|
| 353 | //******************************************************************************
|
|---|
| 354 | #if 0 //KSO Apr 19 1999: some parameter incompabilities between newer and older SDKs.
|
|---|
| 355 | HRESULT __stdcall SoundBufSetFormat(THIS_ LPWAVEFORMATEX )
|
|---|
| 356 | #else
|
|---|
| 357 | HRESULT __stdcall SoundBufSetFormat(THIS_ LPCWAVEFORMATEX )
|
|---|
| 358 | #endif
|
|---|
| 359 | {
|
|---|
| 360 | OS2IDirectSoundBuffer *me = (OS2IDirectSoundBuffer *)This;
|
|---|
| 361 |
|
|---|
| 362 | dprintf(("SoundBufSetFormat"));
|
|---|
| 363 | if(me == NULL) {
|
|---|
| 364 | return DSERR_INVALIDPARAM;
|
|---|
| 365 | }
|
|---|
| 366 | return DS_OK;
|
|---|
| 367 | }
|
|---|
| 368 | //******************************************************************************
|
|---|
| 369 | //******************************************************************************
|
|---|
| 370 | HRESULT __stdcall SoundBufSetVolume(THIS_ LONG lVolume)
|
|---|
| 371 | {
|
|---|
| 372 | OS2IDirectSoundBuffer *me = (OS2IDirectSoundBuffer *)This;
|
|---|
| 373 |
|
|---|
| 374 | dprintf(("SoundBufSetVolume"));
|
|---|
| 375 | if(me == NULL) {
|
|---|
| 376 | return DSERR_INVALIDPARAM;
|
|---|
| 377 | }
|
|---|
| 378 | me->volume = lVolume;
|
|---|
| 379 | return DS_OK;
|
|---|
| 380 | }
|
|---|
| 381 | //******************************************************************************
|
|---|
| 382 | //******************************************************************************
|
|---|
| 383 | HRESULT __stdcall SoundBufSetPan(THIS_ LONG lPan)
|
|---|
| 384 | {
|
|---|
| 385 | OS2IDirectSoundBuffer *me = (OS2IDirectSoundBuffer *)This;
|
|---|
| 386 |
|
|---|
| 387 | dprintf(("SoundBufSetPan"));
|
|---|
| 388 | if(me == NULL) {
|
|---|
| 389 | return DSERR_INVALIDPARAM;
|
|---|
| 390 | }
|
|---|
| 391 | me->pan = lPan;
|
|---|
| 392 | return DS_OK;
|
|---|
| 393 | }
|
|---|
| 394 | //******************************************************************************
|
|---|
| 395 | //******************************************************************************
|
|---|
| 396 | HRESULT __stdcall SoundBufSetFrequency(THIS_ DWORD dwFrequency)
|
|---|
| 397 | {
|
|---|
| 398 | OS2IDirectSoundBuffer *me = (OS2IDirectSoundBuffer *)This;
|
|---|
| 399 |
|
|---|
| 400 | dprintf(("SoundBufSetFrequency"));
|
|---|
| 401 | if(me == NULL) {
|
|---|
| 402 | return DSERR_INVALIDPARAM;
|
|---|
| 403 | }
|
|---|
| 404 | me->frequency = dwFrequency;
|
|---|
| 405 | return DS_OK;
|
|---|
| 406 | }
|
|---|
| 407 | //******************************************************************************
|
|---|
| 408 | //******************************************************************************
|
|---|
| 409 | HRESULT __stdcall SoundBufStop(THIS )
|
|---|
| 410 | {
|
|---|
| 411 | OS2IDirectSoundBuffer *me = (OS2IDirectSoundBuffer *)This;
|
|---|
| 412 |
|
|---|
| 413 | dprintf(("SoundBufStop"));
|
|---|
| 414 | if(me == NULL) {
|
|---|
| 415 | return DSERR_INVALIDPARAM;
|
|---|
| 416 | }
|
|---|
| 417 | return DS_OK;
|
|---|
| 418 | }
|
|---|
| 419 | //******************************************************************************
|
|---|
| 420 | //******************************************************************************
|
|---|
| 421 | HRESULT __stdcall SoundBufUnlock(THIS_ LPVOID,DWORD,LPVOID,DWORD )
|
|---|
| 422 | {
|
|---|
| 423 | OS2IDirectSoundBuffer *me = (OS2IDirectSoundBuffer *)This;
|
|---|
| 424 |
|
|---|
| 425 | dprintf(("SoundBufUnlock"));
|
|---|
| 426 | if(me == NULL) {
|
|---|
| 427 | return DSERR_INVALIDPARAM;
|
|---|
| 428 | }
|
|---|
| 429 | return DS_OK;
|
|---|
| 430 | }
|
|---|
| 431 | //******************************************************************************
|
|---|
| 432 | //******************************************************************************
|
|---|
| 433 | HRESULT __stdcall SoundBufRestore(THIS )
|
|---|
| 434 | {
|
|---|
| 435 | OS2IDirectSoundBuffer *me = (OS2IDirectSoundBuffer *)This;
|
|---|
| 436 |
|
|---|
| 437 | dprintf(("SoundBufRestore"));
|
|---|
| 438 | if(me == NULL) {
|
|---|
| 439 | return DSERR_INVALIDPARAM;
|
|---|
| 440 | }
|
|---|
| 441 | return DS_OK;
|
|---|
| 442 | }
|
|---|
| 443 | //******************************************************************************
|
|---|
| 444 | //******************************************************************************
|
|---|