1 // --------------------------------------------------------------------------
5 // Author: Guilhem Lavaux <lavaux@easynet.fr> (C) 1999
7 // --------------------------------------------------------------------------
12 #pragma interface "sndg72x.h"
25 // This fixes a bug in Mingw95
26 typedef struct g72x_state g72state
;
31 class WXDLLEXPORT wxSoundFormatG72X
: public wxSoundFormatBase
{
36 void SetG72XType(wxSoundG72XType type
);
37 wxSoundG72XType
GetG72XType() const { return m_g72x_type
; }
39 void SetSampleRate(wxUint32 srate
);
40 wxUint32
GetSampleRate() const;
42 wxSoundFormatType
GetType() const { return wxSOUND_G72X
; }
43 wxSoundFormatBase
*Clone() const;
45 wxUint32
GetTimeFromBytes(wxUint32 bytes
) const;
46 wxUint32
GetBytesFromTime(wxUint32 time
) const;
48 bool operator !=(const wxSoundFormatBase
& frmt2
) const;
52 wxSoundG72XType m_g72x_type
;
56 // ULAW converter class
59 class WXDLLEXPORT wxSoundRouterStream
;
60 class WXDLLEXPORT wxSoundStreamG72X
: public wxSoundStreamCodec
{
62 wxSoundStreamG72X(wxSoundStream
& sndio
);
65 wxSoundStream
& Read(void *buffer
, wxUint32 len
);
66 wxSoundStream
& Write(const void *buffer
, wxUint32 len
);
68 bool SetSoundFormat(const wxSoundFormatBase
& format
);
71 wxSoundRouterStream
*m_router
;
72 wxUint8 m_n_bits
, m_current_mask
, m_current_b_pos
, m_current_byte
;
76 int (*m_coder
)(int code
, int in_code
, struct g72x_state
*state
);
77 int (*m_decoder
)(int code
, int out_code
, struct g72x_state
*state
);
80 void PutBits(wxUint8 bits
);