source: cmedia/trunk/Drv16/wavestrm.hpp@ 577

Last change on this file since 577 was 354, checked in by stevenhl, 18 years ago

Import untested baseline cmedia sources, work products and binaries
Binaries and work products should be deleted from repository.
once new builds are verified to work.

File size: 3.2 KB
Line 
1/* $Id: wavestrm.hpp,v 1.5 2001/04/30 21:08:00 sandervl Exp $ */
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
37extern "C" void ProcessHookStub(void);
38
39
40class WAVESTREAM : public STREAM {
41
42public:
43 void Process(void); // called every timer interrupt
44 virtual ULONG GetCurrentTime(void);
45 virtual ULONG GetCurrentPos(void);
46 virtual ULONG GetCurrentWritePos(void);
47 virtual void SetCurrentTime(ULONG time);
48 virtual ULONG Register(PDDCMDREGISTER);
49 virtual ULONG Read(PSTREAMBUF, unsigned);
50 virtual ULONG Write(PSTREAMBUF, ULONG, BOOL fLooping = 0);
51 ULONG Write(PSTREAMBUFFER);
52 virtual ULONG StartStream(void);
53 virtual ULONG StopStream(PCONTROL_PARM);
54 virtual ULONG PauseStream(PCONTROL_PARM);
55 virtual ULONG ResumeStream(void);
56 WAVESTREAM(USHORT streamtype, LPMCI_AUDIO_INIT pinit, USHORT filesysnum);
57 virtual ~WAVESTREAM();
58
59 virtual BOOL SetProperty(int type, ULONG value, ULONG reserved = 0);
60 virtual ULONG GetProperty(int type);
61
62 inline USHORT GetNumChannels(void) { return _configinfo.usNumChannels; };
63
64 void ArmProcessHook(void);
65
66 BOOL IsEverythingOk() { return hProcessHook != 0; };
67
68protected:
69
70 ULONG _ulAudioBufSz; // size of the audio buffer
71 WaveConfigInfo _configinfo; // configuration info shared with the hardware
72 ULONG _ulBytesProcessed; // number of bytes consumed or produces
73 ULONG _ulTimeBase; // value in ms. MMPM sends for stream time
74 ULONG fragsize;
75 USHORT _vRealignBuffer(ULONG FAR *endpos, PSTREAMBUFFER pbuffer);
76 void _vRealignPausedBuffers(ULONG endpos = 0);
77 virtual void AddBuffers(BOOL fFirst); // Initialize the audio buffer object
78 ULONG AddBuffer(ULONG space); // write one buffer to the audio buffer
79 BOOL _vReadAudioBuf(void); // read data from the audio buffer
80
81 BOOL fUnderrun;
82
83 ULONG hProcessHook;
84};
85typedef WAVESTREAM *PWAVESTREAM;
86
87#endif
Note: See TracBrowser for help on using the repository browser.