source: trunk/src/dsound/waveoutdaud.h@ 5611

Last change on this file since 5611 was 5608, checked in by sandervl, 24 years ago

preliminary code for directaudio interface

File size: 1.4 KB
Line 
1/* $Id: waveoutdaud.h,v 1.1 2001-04-27 17:39:49 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
23class DAudioWaveOut
24{
25public:
26 DAudioWaveOut(LPWAVEFORMATEX pwfx);
27 ~DAudioWaveOut();
28
29 MMRESULT write(LPWAVEHDR pwh, UINT cbwh);
30 MMRESULT pause();
31 MMRESULT stop();
32 MMRESULT restart();
33 MMRESULT setVolume(ULONG ulVol);
34 ULONG getPosition();
35
36 int getState() { return State; };
37 MMRESULT getError() { return ulError; };
38
39 static BOOL queryFormat(ULONG formatTag, ULONG nChannels,
40 ULONG nSamplesPerSec, ULONG sampleSize);
41
42
43 static BOOL isDirectAudioAvailable();
44
45protected:
46
47private:
48 MMRESULT resume();
49 BOOL handler();
50 MMRESULT sendIOCTL(ULONG cmd, DAUDIO_CMD *pDataPacket);
51
52 ULONG volume; // Volume state
53 ULONG ulError;
54 ULONG State;
55
56 BOOL fUnderrun;
57
58 HFILE hDAudioDrv;
59};
60
61#endif
Note: See TracBrowser for help on using the repository browser.