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