Line | |
---|
1 | /* $Id: waveoutdaud.h,v 1.2 2001-04-30 21:06:38 sandervl Exp $ */
|
---|
2 |
|
---|
3 | /*
|
---|
4 | * Wave playback class (DirectAudio)
|
---|
5 | *
|
---|
6 | * Copyright 2001 Sander van Leeuwen (sandervl@xs4all.nl)
|
---|
7 | *
|
---|
8 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
9 | */
|
---|
10 | #ifndef __DWAVEOUTEX_H__
|
---|
11 | #define __DWAVEOUTEX_H__
|
---|
12 |
|
---|
13 | #ifdef OS2_ONLY
|
---|
14 | #include "winmmtype.h"
|
---|
15 | #endif
|
---|
16 | #include <daudio.h>
|
---|
17 |
|
---|
18 | #define STATE_STOPPED 0
|
---|
19 | #define STATE_PLAYING 1
|
---|
20 | #define STATE_PAUSED 2
|
---|
21 | #define STATE_RECORDING 3
|
---|
22 |
|
---|
23 | #define SECTION_WINMM "WINMM"
|
---|
24 | #define KEY_DIRECTAUDIO "DirectAudio"
|
---|
25 |
|
---|
26 | class DAudioWaveOut
|
---|
27 | {
|
---|
28 | public:
|
---|
29 | DAudioWaveOut(LPWAVEFORMATEX pwfx);
|
---|
30 | ~DAudioWaveOut();
|
---|
31 |
|
---|
32 | MMRESULT write(LPVOID lpBuffer, UINT ulSize);
|
---|
33 | MMRESULT pause();
|
---|
34 | MMRESULT stop();
|
---|
35 | MMRESULT restart();
|
---|
36 | MMRESULT setVolume(ULONG ulVol);
|
---|
37 | ULONG getPosition(PULONG pulWritePos);
|
---|
38 |
|
---|
39 | MMRESULT setProperty(int type, ULONG value);
|
---|
40 |
|
---|
41 | int getState() { return State; };
|
---|
42 | MMRESULT getError() { return ulError; };
|
---|
43 |
|
---|
44 | static BOOL queryFormat(ULONG formatTag, ULONG nChannels,
|
---|
45 | ULONG nSamplesPerSec, ULONG sampleSize);
|
---|
46 |
|
---|
47 |
|
---|
48 | static BOOL isDirectAudioAvailable();
|
---|
49 |
|
---|
50 | protected:
|
---|
51 |
|
---|
52 | private:
|
---|
53 | MMRESULT resume();
|
---|
54 | BOOL handler();
|
---|
55 | MMRESULT sendIOCTL(ULONG cmd, DAUDIO_CMD *pDataPacket);
|
---|
56 |
|
---|
57 | ULONG volume; // Volume state
|
---|
58 | ULONG ulError;
|
---|
59 | ULONG State;
|
---|
60 |
|
---|
61 | BOOL fUnderrun;
|
---|
62 |
|
---|
63 | HFILE hDAudioDrv;
|
---|
64 | };
|
---|
65 |
|
---|
66 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.