1 // --------------------------------------------------------------------------
5 // Author: Guilhem Lavaux <lavaux@easynet.fr> (C) 1999
7 // License: wxWindows license
8 // --------------------------------------------------------------------------
13 #include "wx/mmedia/defs.h"
14 #include "wx/mmedia/sndbase.h"
15 #include "wx/mmedia/sndcodec.h"
16 #include "wx/mmedia/sndbase.h"
24 // This fixes a bug in Mingw95
25 typedef struct g72x_state g72state
;
30 class WXDLLIMPEXP_MMEDIA wxSoundFormatG72X
: public wxSoundFormatBase
{
35 void SetG72XType(wxSoundG72XType type
);
36 wxSoundG72XType
GetG72XType() const { return m_g72x_type
; }
38 void SetSampleRate(wxUint32 srate
);
39 wxUint32
GetSampleRate() const;
41 wxSoundFormatType
GetType() const { return wxSOUND_G72X
; }
42 wxSoundFormatBase
*Clone() const;
44 wxUint32
GetTimeFromBytes(wxUint32 bytes
) const;
45 wxUint32
GetBytesFromTime(wxUint32 time
) const;
47 bool operator !=(const wxSoundFormatBase
& frmt2
) const;
51 wxSoundG72XType m_g72x_type
;
55 // ULAW converter class
58 class WXDLLIMPEXP_MMEDIA wxSoundRouterStream
;
59 class WXDLLIMPEXP_MMEDIA wxSoundStreamG72X
: public wxSoundStreamCodec
{
61 wxSoundStreamG72X(wxSoundStream
& sndio
);
64 wxSoundStream
& Read(void *buffer
, wxUint32 len
);
65 wxSoundStream
& Write(const void *buffer
, wxUint32 len
);
67 bool SetSoundFormat(const wxSoundFormatBase
& format
);
70 wxSoundRouterStream
*m_router
;
71 wxUint8 m_n_bits
, m_current_mask
, m_current_b_pos
, m_current_byte
;
75 int (*m_coder
)(int code
, int in_code
, struct g72x_state
*state
);
76 int (*m_decoder
)(int code
, int out_code
, struct g72x_state
*state
);
79 void PutBits(wxUint8 bits
);