]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/wxMMedia2/lib/sndcpcm.h
Moved wxMMedia to contrib/src/mmedia
[wxWidgets.git] / utils / wxMMedia2 / lib / sndcpcm.h
index e2a5db1fefd947f06423bd22e5a30ec5edb8124a..9064e5813c5e3486b7de5f50955c616fc2e8a696 100644 (file)
 //
 
 class wxSoundStreamPcm: public wxSoundStreamCodec {
- public:
-  typedef void (*ConverterType)(const char *buf_in, char *buf_out, size_t len);
-
-  wxSoundStreamPcm(wxSoundStream& sndio);
-  ~wxSoundStreamPcm();
-
-  wxSoundStream& Read(void *buffer, size_t len);
-  wxSoundStream& Write(const void *buffer, size_t len);
-
-  bool SetSoundFormat(const wxSoundFormatBase& format);
-
- protected:
-  ConverterType m_function_out, m_function_in;
-
-  bool m_16_to_8;
+public:
+    typedef void (*ConverterType)(const void *buf_in, void *buf_out,
+                                  wxUint32 len);
+    
+    wxSoundStreamPcm(wxSoundStream& sndio);
+    ~wxSoundStreamPcm();
+    
+    wxSoundStream& Read(void *buffer, wxUint32 len);
+    wxSoundStream& Write(const void *buffer, wxUint32 len);
+    
+    bool SetSoundFormat(const wxSoundFormatBase& format);
+    
+    wxUint32 GetBestSize() const;
+    
+protected:
+    wxUint32 GetReadSize(wxUint32 len) const;
+    wxUint32 GetWriteSize(wxUint32 len) const;
+
+protected:
+    ConverterType m_function_out, m_function_in;
+
+    // Static temporary buffer
+    char *m_prebuffer;
+    wxUint32 m_prebuffer_size;
+    // Estimated best size to fit into the static buffer
+    wxUint32 m_best_size;
+    // Multiplier for IO buffer size
+    float m_multiplier_in, m_multiplier_out;
 };
 
 #endif