source: trunk/src/dsound/OS2SNDBUFFER.H@ 2013

Last change on this file since 2013 was 1744, checked in by hugh, 26 years ago

Implemented fake soundcard
The Bufferpos will be advanced based on the elapsed time
since start playing

File size: 4.1 KB
Line 
1/* $Id: OS2SNDBUFFER.H,v 1.5 1999-11-14 22:12:15 hugh 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#ifndef __OS2SNDBUFFER_H__
12#define __OS2SNDBUFFER_H__
13
14#include <mmsystem.h>
15
16#undef THIS
17#define THIS VOID*This
18
19#undef THIS_
20#define THIS_ VOID*This,
21
22class OS2IDirectSoundBuffer
23{
24 public:
25 //this one has to go first!
26 IDirectSoundBufferVtbl *lpVtbl;
27 IDirectSoundBufferVtbl Vtbl;
28
29 OS2IDirectSoundBuffer(const DSBUFFERDESC *lpDSBufferDesc);//KSO Apr 13 1999: const, SDK changes
30 ~OS2IDirectSoundBuffer();
31
32 int Referenced;
33 inline HRESULT GetLastError() { return lastError; };
34
35 private:
36
37 protected:
38 HRESULT lastError;
39
40 LONG pan;
41 ULONG writepos, playpos;
42 ULONG frequency;
43 WAVEFORMATEX *lpfxFormat;
44 ULONG status;
45 ULONG fLocked;
46 LONG volume;
47 BOOL fPlaying,fLoop;
48 DSBUFFERDESC bufferdesc;
49 // for NIL Emulation
50 ULONG newWritePos;
51 DWORD LastTickCnt;
52
53 char *lpBuffer;
54
55 // Linked list management
56 OS2IDirectSoundBuffer* next; // Next OS2IDirectSound
57 static OS2IDirectSoundBuffer* dsound; // List of OS2IDirectSound
58
59 friend HRESULT __stdcall SoundBufQueryInterface(THIS, REFIID riid, LPVOID * ppvObj);
60 friend ULONG __stdcall SoundBufAddRef(THIS);
61 friend ULONG __stdcall SoundBufRelease(THIS);
62 friend HRESULT __stdcall SoundBufGetCaps(THIS_ LPDSBCAPS );
63 friend HRESULT __stdcall SoundBufGetCurrentPosition(THIS_ LPDWORD,LPDWORD ) ;
64 friend HRESULT __stdcall SoundBufGetFormat(THIS_ LPWAVEFORMATEX, DWORD, LPDWORD ) ;
65 friend HRESULT __stdcall SoundBufGetVolume(THIS_ LPLONG ) ;
66 friend HRESULT __stdcall SoundBufGetPan(THIS_ LPLONG ) ;
67 friend HRESULT __stdcall SoundBufGetFrequency(THIS_ LPDWORD ) ;
68 friend HRESULT __stdcall SoundBufGetStatus(THIS_ LPDWORD ) ;
69 friend HRESULT __stdcall SoundBufInitialize(THIS_ LPDIRECTSOUND, LPDSBUFFERDESC ) ;
70 friend HRESULT __stdcall SoundBufLock(THIS_ DWORD,DWORD,LPVOID,LPDWORD,LPVOID,LPDWORD,DWORD ) ;
71 friend HRESULT __stdcall SoundBufPlay(THIS_ DWORD,DWORD,DWORD ) ;
72 friend HRESULT __stdcall SoundBufSetCurrentPosition(THIS_ DWORD ) ;
73 friend HRESULT __stdcall SoundBufSetFormat(THIS_ LPWAVEFORMATEX ) ;
74 friend HRESULT __stdcall SoundBufSetVolume(THIS_ LONG ) ;
75 friend HRESULT __stdcall SoundBufSetPan(THIS_ LONG ) ;
76 friend HRESULT __stdcall SoundBufSetFrequency(THIS_ DWORD ) ;
77 friend HRESULT __stdcall SoundBufStop(THIS ) ;
78 friend HRESULT __stdcall SoundBufUnlock(THIS_ LPVOID,DWORD,LPVOID,DWORD ) ;
79 friend HRESULT __stdcall SoundBufRestore(THIS ) ;
80};
81//******************************************************************************
82//******************************************************************************
83HRESULT __stdcall SoundBufQueryInterface(THIS, REFIID riid, LPVOID * ppvObj);
84ULONG __stdcall SoundBufAddRef(THIS);
85ULONG __stdcall SoundBufRelease(THIS);
86HRESULT __stdcall SoundBufGetCaps(THIS_ LPDSBCAPS );
87HRESULT __stdcall SoundBufGetCurrentPosition(THIS_ LPDWORD,LPDWORD ) ;
88HRESULT __stdcall SoundBufGetFormat(THIS_ LPWAVEFORMATEX, DWORD, LPDWORD ) ;
89HRESULT __stdcall SoundBufGetVolume(THIS_ LPLONG ) ;
90HRESULT __stdcall SoundBufGetPan(THIS_ LPLONG ) ;
91HRESULT __stdcall SoundBufGetFrequency(THIS_ LPDWORD ) ;
92HRESULT __stdcall SoundBufGetStatus(THIS_ LPDWORD ) ;
93HRESULT __stdcall SoundBufInitialize(THIS_ LPDIRECTSOUND, LPDSBUFFERDESC ) ;
94HRESULT __stdcall SoundBufLock(THIS_ DWORD,DWORD,LPVOID,LPDWORD,LPVOID,LPDWORD,DWORD ) ;
95HRESULT __stdcall SoundBufPlay(THIS_ DWORD,DWORD,DWORD ) ;
96HRESULT __stdcall SoundBufSetCurrentPosition(THIS_ DWORD ) ;
97HRESULT __stdcall SoundBufSetFormat(THIS_ LPWAVEFORMATEX ) ;
98HRESULT __stdcall SoundBufSetVolume(THIS_ LONG ) ;
99HRESULT __stdcall SoundBufSetPan(THIS_ LONG ) ;
100HRESULT __stdcall SoundBufSetFrequency(THIS_ DWORD ) ;
101HRESULT __stdcall SoundBufStop(THIS ) ;
102HRESULT __stdcall SoundBufUnlock(THIS_ LPVOID,DWORD,LPVOID,DWORD ) ;
103HRESULT __stdcall SoundBufRestore(THIS ) ;
104
105#endif
Note: See TracBrowser for help on using the repository browser.