source: trunk/src/winmm/waveinoutbase.h@ 6502

Last change on this file since 6502 was 5358, checked in by sandervl, 24 years ago

Rewrite for DirectAudio interface

File size: 1.7 KB
Line 
1/* $Id: waveinoutbase.h,v 1.1 2001-03-23 16:23:45 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
18#ifdef OS2_ONLY
19#include "winmmtype.h"
20#endif
21#include <vmutex.h>
22
23class WaveInOut
24{
25public:
26 WaveInOut(LPWAVEFORMATEX pwfx, DWORD fdwOpen, ULONG nCallback, ULONG dwInstance);
27 virtual ~WaveInOut();
28
29 int getState() { return State; };
30 MMRESULT getError() { return ulError; };
31 ULONG getSampleRate() { return SampleRate; };
32 ULONG getBitsPerSample() { return BitsPerSample; };
33 ULONG getnumChannels() { return nChannels; };
34 ULONG getAvgBytesPerSecond() { return (BitsPerSample/8) * nChannels * SampleRate; };
35
36 static BOOL find(WaveInOut *wave);
37
38protected:
39
40 ULONG ulError, State;
41
42 int SampleRate;
43 int BitsPerSample;
44 int nChannels;
45
46 int queuedbuffers;
47
48 // callback interface
49 void callback(UINT uMessage, DWORD dw1, DWORD dw2);
50
51 DWORD fdwOpen;
52 DWORD dwCallback;
53 DWORD dwInstance;
54
55 WAVEHDR *wavehdr,
56 *curhdr;
57
58 VMutex wmutex;
59 // Linked list management
60 WaveInOut *next; // Next wave class
61 static WaveInOut *wave; // List of wave classes
62
63private:
64
65};
66
67#endif
Note: See TracBrowser for help on using the repository browser.