|
Last change
on this file since 5620 was 5608, checked in by sandervl, 25 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 |
|
|---|
| 23 | class DAudioWaveOut
|
|---|
| 24 | {
|
|---|
| 25 | public:
|
|---|
| 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 |
|
|---|
| 45 | protected:
|
|---|
| 46 |
|
|---|
| 47 | private:
|
|---|
| 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.