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

Last change on this file since 8889 was 8572, checked in by sandervl, 23 years ago

Postpone recording when waveInStart called without any buffers in the queue. Start in during next waveInAddBuffer call

File size: 1.8 KB
Line 
1/* $Id: waveinoutbase.h,v 1.2 2002-06-05 11:05:56 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
24class WaveInOut
25{
26public:
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
39protected:
40
41 ULONG ulError, State;
42
43 int SampleRate;
44 int BitsPerSample;
45 int nChannels;
46
47 int queuedbuffers;
48
49 // callback interface
50 void callback(UINT uMessage, DWORD dw1, DWORD dw2);
51
52 DWORD fdwOpen;
53 DWORD dwCallback;
54 DWORD dwInstance;
55
56 WAVEHDR *wavehdr,
57 *curhdr;
58
59 VMutex wmutex;
60 // Linked list management
61 WaveInOut *next; // Next wave class
62 static WaveInOut *wave; // List of wave classes
63
64private:
65
66};
67
68#endif
Note: See TracBrowser for help on using the repository browser.