Last change
on this file since 10367 was 9671, checked in by sandervl, 23 years ago |
Delete all wave object on unload; fix linked list synchronization
|
File size:
1.8 KB
|
Line | |
---|
1 | /* $Id: waveinoutbase.h,v 1.3 2003-01-14 19:38:38 sandervl Exp $ */
|
---|
2 |
|
---|
3 | /*
|
---|
4 | * Wave playback & recording base class
|
---|
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 __WAVEINOUTBASE_H__
|
---|
11 | #define __WAVEINOUTBASE_H__
|
---|
12 |
|
---|
13 | #define STATE_STOPPED 0
|
---|
14 | #define STATE_PLAYING 1
|
---|
15 | #define STATE_PAUSED 2
|
---|
16 | #define STATE_RECORDING 3
|
---|
17 | #define STATE_POSTPONE_RECORDING 4
|
---|
18 |
|
---|
19 | #ifdef OS2_ONLY
|
---|
20 | #include "winmmtype.h"
|
---|
21 | #endif
|
---|
22 | #include <vmutex.h>
|
---|
23 |
|
---|
24 | class WaveInOut
|
---|
25 | {
|
---|
26 | public:
|
---|
27 | WaveInOut(LPWAVEFORMATEX pwfx, DWORD fdwOpen, ULONG nCallback, ULONG dwInstance);
|
---|
28 | virtual ~WaveInOut();
|
---|
29 |
|
---|
30 | int getState() { return State; };
|
---|
31 | MMRESULT getError() { return ulError; };
|
---|
32 | ULONG getSampleRate() { return SampleRate; };
|
---|
33 | ULONG getBitsPerSample() { return BitsPerSample; };
|
---|
34 | ULONG getnumChannels() { return nChannels; };
|
---|
35 | ULONG getAvgBytesPerSecond() { return (BitsPerSample/8) * nChannels * SampleRate; };
|
---|
36 |
|
---|
37 | static BOOL find(WaveInOut *wave);
|
---|
38 | static void shutdown();
|
---|
39 |
|
---|
40 | protected:
|
---|
41 |
|
---|
42 | ULONG ulError, State;
|
---|
43 |
|
---|
44 | int SampleRate;
|
---|
45 | int BitsPerSample;
|
---|
46 | int nChannels;
|
---|
47 |
|
---|
48 | int queuedbuffers;
|
---|
49 |
|
---|
50 | // callback interface
|
---|
51 | void callback(UINT uMessage, DWORD dw1, DWORD dw2);
|
---|
52 |
|
---|
53 | DWORD fdwOpen;
|
---|
54 | DWORD dwCallback;
|
---|
55 | DWORD dwInstance;
|
---|
56 |
|
---|
57 | WAVEHDR *wavehdr,
|
---|
58 | *curhdr;
|
---|
59 |
|
---|
60 | VMutex wmutex;
|
---|
61 |
|
---|
62 | private:
|
---|
63 | // Linked list management
|
---|
64 | WaveInOut *next; // Next wave class
|
---|
65 | static WaveInOut *head; // List of wave classes
|
---|
66 | };
|
---|
67 |
|
---|
68 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.