]> git.saurik.com Git - wxWidgets.git/blob - contrib/include/wx/mmedia/sndcpcm.h
#include markup fixes.
[wxWidgets.git] / contrib / include / wx / mmedia / 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 // License: wxWindows license
8 // --------------------------------------------------------------------------
9 #ifndef _WX_SNDCPCM_H
10 #define _WX_SNDCPCM_H
11
12 #include "wx/defs.h"
13 #include "wx/mmedia/defs.h"
14 #include "wx/mmedia/sndbase.h"
15 #include "wx/mmedia/sndcodec.h"
16
17 //
18 // PCM converter class
19 //
20
21 class WXDLLIMPEXP_MMEDIA wxSoundStreamPcm: public wxSoundStreamCodec {
22 public:
23 typedef void (*ConverterType)(const void *buf_in, void *buf_out,
24 wxUint32 len);
25
26 wxSoundStreamPcm(wxSoundStream& sndio);
27 ~wxSoundStreamPcm();
28
29 wxSoundStream& Read(void *buffer, wxUint32 len);
30 wxSoundStream& Write(const void *buffer, wxUint32 len);
31
32 bool SetSoundFormat(const wxSoundFormatBase& format);
33
34 wxUint32 GetBestSize() const;
35
36 protected:
37 wxUint32 GetReadSize(wxUint32 len) const;
38 wxUint32 GetWriteSize(wxUint32 len) const;
39
40 protected:
41 ConverterType m_function_out, m_function_in;
42
43 // Static temporary buffer
44 char *m_prebuffer;
45 wxUint32 m_prebuffer_size;
46 // Estimated best size to fit into the static buffer
47 wxUint32 m_best_size;
48 // Multiplier for IO buffer size
49 float m_multiplier_in, m_multiplier_out;
50 };
51
52 #endif