1 // --------------------------------------------------------------------------
5 // Author: Guilhem Lavaux <lavaux@easynet.fr> (C) 1999
7 // --------------------------------------------------------------------------
12 #pragma interface "sndg72x.h"
16 #include "wx/mmedia/sndbase.h"
17 #include "wx/mmedia/sndcodec.h"
18 #include "wx/mmedia/sndbase.h"
26 // This fixes a bug in Mingw95
27 typedef struct g72x_state g72state
;
32 class WXDLLEXPORT wxSoundFormatG72X
: public wxSoundFormatBase
{
37 void SetG72XType(wxSoundG72XType type
);
38 wxSoundG72XType
GetG72XType() const { return m_g72x_type
; }
40 void SetSampleRate(wxUint32 srate
);
41 wxUint32
GetSampleRate() const;
43 wxSoundFormatType
GetType() const { return wxSOUND_G72X
; }
44 wxSoundFormatBase
*Clone() const;
46 wxUint32
GetTimeFromBytes(wxUint32 bytes
) const;
47 wxUint32
GetBytesFromTime(wxUint32 time
) const;
49 bool operator !=(const wxSoundFormatBase
& frmt2
) const;
53 wxSoundG72XType m_g72x_type
;
57 // ULAW converter class
60 class WXDLLEXPORT wxSoundRouterStream
;
61 class WXDLLEXPORT wxSoundStreamG72X
: public wxSoundStreamCodec
{
63 wxSoundStreamG72X(wxSoundStream
& sndio
);
66 wxSoundStream
& Read(void *buffer
, wxUint32 len
);
67 wxSoundStream
& Write(const void *buffer
, wxUint32 len
);
69 bool SetSoundFormat(const wxSoundFormatBase
& format
);
72 wxSoundRouterStream
*m_router
;
73 wxUint8 m_n_bits
, m_current_mask
, m_current_b_pos
, m_current_byte
;
77 int (*m_coder
)(int code
, int in_code
, struct g72x_state
*state
);
78 int (*m_decoder
)(int code
, int out_code
, struct g72x_state
*state
);
81 void PutBits(wxUint8 bits
);