]> git.saurik.com Git - wxWidgets.git/blob - utils/wxMMedia2/lib/sndcpcm.h
Moved wxMMedia to contrib/src/mmedia
[wxWidgets.git] / utils / wxMMedia2 / lib / sndcpcm.h
1 // --------------------------------------------------------------------------
2 // Name: sndcpcm.h
3 // Purpose:
4 // Date: 08/11/1999
5 // Author: Guilhem Lavaux <lavaux@easynet.fr> (C) 1999
6 // CVSID: $Id$
7 // --------------------------------------------------------------------------
8 #ifndef _WX_SNDCPCM_H
9 #define _WX_SNDCPCM_H
10
11 #ifdef __GNUG__
12 #pragma interface "sndcpcm.h"
13 #endif
14
15 #include <stddef.h>
16 #include "sndcodec.h"
17
18 //
19 // PCM converter class
20 //
21
22 class wxSoundStreamPcm: public wxSoundStreamCodec {
23 public:
24 typedef void (*ConverterType)(const void *buf_in, void *buf_out,
25 wxUint32 len);
26
27 wxSoundStreamPcm(wxSoundStream& sndio);
28 ~wxSoundStreamPcm();
29
30 wxSoundStream& Read(void *buffer, wxUint32 len);
31 wxSoundStream& Write(const void *buffer, wxUint32 len);
32
33 bool SetSoundFormat(const wxSoundFormatBase& format);
34
35 wxUint32 GetBestSize() const;
36
37 protected:
38 wxUint32 GetReadSize(wxUint32 len) const;
39 wxUint32 GetWriteSize(wxUint32 len) const;
40
41 protected:
42 ConverterType m_function_out, m_function_in;
43
44 // Static temporary buffer
45 char *m_prebuffer;
46 wxUint32 m_prebuffer_size;
47 // Estimated best size to fit into the static buffer
48 wxUint32 m_best_size;
49 // Multiplier for IO buffer size
50 float m_multiplier_in, m_multiplier_out;
51 };
52
53 #endif