1 | /* $Id: waveoutflash.h,v 1.00 2010-02-20 12:00:00 rlwalsh Exp $ */
|
---|
2 |
|
---|
3 | /*
|
---|
4 | * Wave playback class (DART for Flash10)
|
---|
5 | *
|
---|
6 | * Copyright 1998-2001 Sander van Leeuwen (sandervl@xs4all.nl)
|
---|
7 | * Copyright 2010 Richard L Walsh (rich@e-vertise.com)
|
---|
8 | *
|
---|
9 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
10 | */
|
---|
11 |
|
---|
12 | /******************************************************************************/
|
---|
13 |
|
---|
14 | #ifndef __WAVEOUTFLASH_H__
|
---|
15 | #define __WAVEOUTFLASH_H__
|
---|
16 |
|
---|
17 | #include "waveoutbase.h"
|
---|
18 | #include "flashaudio.h"
|
---|
19 |
|
---|
20 | #ifdef OS2_ONLY
|
---|
21 | #include "winmmtype.h"
|
---|
22 | #endif
|
---|
23 |
|
---|
24 | // this should be defined in some #included .h file, but it isn't
|
---|
25 | typedef LONG (APIENTRY MIXERPROC)(ULONG ulHandle, PMCI_MIX_BUFFER pBuffer, ULONG ulFlags);
|
---|
26 |
|
---|
27 | /******************************************************************************/
|
---|
28 |
|
---|
29 | class FlashWaveOut : public WaveOut
|
---|
30 | {
|
---|
31 | public:
|
---|
32 | FlashWaveOut(LPWAVEFORMATEX pwfx, DWORD fdwOpen,
|
---|
33 | ULONG nCallback, ULONG dwInstance);
|
---|
34 | virtual ~FlashWaveOut();
|
---|
35 |
|
---|
36 | virtual MMRESULT open();
|
---|
37 | virtual MMRESULT write(LPWAVEHDR pwh, UINT cbwh);
|
---|
38 | virtual MMRESULT pause();
|
---|
39 | virtual MMRESULT stop();
|
---|
40 | virtual MMRESULT resume();
|
---|
41 | virtual MMRESULT setVolume(ULONG ulVol);
|
---|
42 | virtual MMRESULT reset();
|
---|
43 | virtual ULONG getPosition();
|
---|
44 |
|
---|
45 | protected:
|
---|
46 | BOOL getDeviceSem(BOOL get);
|
---|
47 | MMRESULT initBuffers();
|
---|
48 | void writeBuffer();
|
---|
49 | void handler(ULONG ulStatus, PMCI_MIX_BUFFER pBuffer, ULONG ulFlags);
|
---|
50 | void mciError(const char * msg, ULONG rc);
|
---|
51 |
|
---|
52 | private:
|
---|
53 | static HEV deviceSem;
|
---|
54 | USHORT deviceId;
|
---|
55 | int waveOffs;
|
---|
56 | BOOL dartBufInit;
|
---|
57 | int dartBufSize;
|
---|
58 | int dartBufCnt;
|
---|
59 | volatile int dartFreeCnt;
|
---|
60 | int dartFreeNdx;
|
---|
61 | volatile int dartPlayed;
|
---|
62 | int readyCnt;
|
---|
63 | int readyNdx;
|
---|
64 | ULONG mixHandle;
|
---|
65 | MIXERPROC * pmixWriteProc;
|
---|
66 | MCI_MIX_BUFFER * pmixBuffers;
|
---|
67 |
|
---|
68 | friend LONG APIENTRY FlashWaveOutHandler(ULONG ulStatus, PMCI_MIX_BUFFER pBuffer,
|
---|
69 | ULONG ulFlags);
|
---|
70 | };
|
---|
71 |
|
---|
72 | LONG APIENTRY FlashWaveOutHandler(ULONG ulStatus, PMCI_MIX_BUFFER pBuffer,
|
---|
73 | ULONG ulFlags);
|
---|
74 |
|
---|
75 | #endif
|
---|
76 |
|
---|
77 | /******************************************************************************/
|
---|
78 |
|
---|