[142] | 1 | /* $Id: wavestrm.hpp 178 2001-04-30 21:08:00Z sandervl $ */
|
---|
| 2 |
|
---|
| 3 | /* SCCSID = %W% %E% */
|
---|
| 4 | /****************************************************************************
|
---|
| 5 | * *
|
---|
| 6 | * Copyright (c) IBM Corporation 1994 - 1997. *
|
---|
| 7 | * *
|
---|
| 8 | * The following IBM OS/2 source code is provided to you solely for the *
|
---|
| 9 | * the purpose of assisting you in your development of OS/2 device drivers. *
|
---|
| 10 | * You may use this code in accordance with the IBM License Agreement *
|
---|
| 11 | * provided in the IBM Device Driver Source Kit for OS/2. *
|
---|
| 12 | * *
|
---|
| 13 | ****************************************************************************/
|
---|
| 14 | /**@internal %W%
|
---|
| 15 | * Defines, class definations and prototypes for
|
---|
| 16 | * @version %I%
|
---|
| 17 | * @context Unless otherwise noted, all interfaces are Ring-0, 16-bit,
|
---|
| 18 | * <stack context>.
|
---|
| 19 | * @history
|
---|
| 20 | *
|
---|
| 21 | */
|
---|
| 22 | #ifndef WAVESTREAM_INCLUDED
|
---|
| 23 | #define WAVESTREAM_INCLUDED
|
---|
| 24 |
|
---|
| 25 | #ifndef OS2_INCLUDED
|
---|
| 26 | #define INCL_NOPMAPI
|
---|
| 27 | #include <os2.h>
|
---|
| 28 | #include <os2medef.h>
|
---|
| 29 | #include <audio.h>
|
---|
| 30 | #endif
|
---|
| 31 |
|
---|
| 32 | #include "stream.hpp"
|
---|
| 33 | #include "waudio.hpp"
|
---|
| 34 | #include "strmbuff.hpp"
|
---|
| 35 |
|
---|
| 36 | class WAVESTREAM : public STREAM {
|
---|
| 37 |
|
---|
| 38 | public:
|
---|
| 39 | void Process(void); // called every timer interrupt
|
---|
| 40 | virtual ULONG GetCurrentTime(void);
|
---|
[166] | 41 | virtual ULONG GetCurrentPos(void);
|
---|
[178] | 42 | virtual ULONG GetCurrentWritePos(void);
|
---|
[142] | 43 | virtual void SetCurrentTime(ULONG time);
|
---|
| 44 | virtual ULONG Read(PSTREAMBUF, unsigned);
|
---|
[178] | 45 | virtual ULONG Write(PSTREAMBUF, ULONG, BOOL fLooping = 0);
|
---|
[166] | 46 | ULONG Write(PSTREAMBUFFER);
|
---|
[142] | 47 | virtual ULONG StartStream(void);
|
---|
| 48 | virtual ULONG StopStream(PCONTROL_PARM);
|
---|
| 49 | virtual ULONG PauseStream(PCONTROL_PARM);
|
---|
| 50 | virtual ULONG ResumeStream(void);
|
---|
| 51 | WAVESTREAM(ULONG streamtype, LPMCI_AUDIO_INIT pinit, USHORT filesysnum);
|
---|
| 52 | virtual ~WAVESTREAM();
|
---|
| 53 |
|
---|
[178] | 54 | virtual BOOL SetProperty(int type, ULONG value, ULONG reserved = 0);
|
---|
| 55 | virtual ULONG GetProperty(int type);
|
---|
[142] | 56 |
|
---|
[178] | 57 | protected:
|
---|
[160] | 58 |
|
---|
[142] | 59 | ULONG _ulAudioBufSz; // size of the audio buffer
|
---|
| 60 | WaveConfigInfo _configinfo; // configuration info shared with the hardware
|
---|
| 61 | ULONG _ulBytesProcessed; // number of bytes consumed or produces
|
---|
| 62 | ULONG _ulTimeBase; // value in ms. MMPM sends for stream time
|
---|
[178] | 63 | ULONG fragsize;
|
---|
[142] | 64 | USHORT _vRealignBuffer(ULONG FAR *endpos, PSTREAMBUFFER pbuffer);
|
---|
| 65 | void _vRealignPausedBuffers(ULONG endpos = 0);
|
---|
[178] | 66 | virtual void AddBuffers(BOOL fFirst); // Initialize the audio buffer object
|
---|
[152] | 67 | ULONG AddBuffer(ULONG space); // write one buffer to the audio buffer
|
---|
[142] | 68 | BOOL _vReadAudioBuf(void); // read data from the audio buffer
|
---|
| 69 |
|
---|
| 70 | BOOL fUnderrun;
|
---|
| 71 | };
|
---|
| 72 | typedef WAVESTREAM *PWAVESTREAM;
|
---|
| 73 |
|
---|
| 74 | #endif
|
---|