]>
Commit | Line | Data |
---|---|---|
e8482f24 GL |
1 | // -------------------------------------------------------------------------- |
2 | // Name: sndcpcm.h | |
3 | // Purpose: | |
4 | // Date: 08/11/1999 | |
5 | // Author: Guilhem Lavaux <lavaux@easynet.fr> (C) 1999 | |
6 | // CVSID: $Id$ | |
05aa8cf3 | 7 | // License: wxWindows license |
e8482f24 GL |
8 | // -------------------------------------------------------------------------- |
9 | #ifndef _WX_SNDCPCM_H | |
10 | #define _WX_SNDCPCM_H | |
11 | ||
e8482f24 | 12 | #include "wx/defs.h" |
15e8daec | 13 | #include "wx/mmedia/defs.h" |
e8482f24 GL |
14 | #include "wx/mmedia/sndbase.h" |
15 | #include "wx/mmedia/sndcodec.h" | |
16 | ||
17 | // | |
18 | // PCM converter class | |
19 | // | |
20 | ||
15e8daec | 21 | class WXDLLIMPEXP_MMEDIA wxSoundStreamPcm: public wxSoundStreamCodec { |
e8482f24 GL |
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 |