1 // --------------------------------------------------------------------------
5 // Author: Guilhem Lavaux <lavaux@easynet.fr> (C) 1999
7 // --------------------------------------------------------------------------
12 #pragma interface "sndg72x.h"
28 class WXDLLEXPORT wxSoundFormatG72X
: public wxSoundFormatBase
{
33 void SetG72XType(wxSoundG72XType type
);
34 wxSoundG72XType
GetG72XType() const { return m_g72x_type
; }
36 void SetSampleRate(wxUint32 srate
);
37 wxUint32
GetSampleRate() const;
39 wxSoundFormatType
GetType() const { return wxSOUND_G72X
; }
40 wxSoundFormatBase
*Clone() const;
42 wxUint32
GetTimeFromBytes(wxUint32 bytes
) const;
43 wxUint32
GetBytesFromTime(wxUint32 time
) const;
45 bool operator !=(const wxSoundFormatBase
& frmt2
) const;
49 wxSoundG72XType m_g72x_type
;
53 // ULAW converter class
56 class WXDLLEXPORT wxSoundRouterStream
;
57 class WXDLLEXPORT wxSoundStreamG72X
: public wxSoundStreamCodec
{
59 wxSoundStreamG72X(wxSoundStream
& sndio
);
62 wxSoundStream
& Read(void *buffer
, wxUint32 len
);
63 wxSoundStream
& Write(const void *buffer
, wxUint32 len
);
65 bool SetSoundFormat(const wxSoundFormatBase
& format
);
68 wxSoundRouterStream
*m_router
;
69 wxUint8 m_n_bits
, m_current_mask
, m_current_b_pos
, m_current_byte
;
71 struct g72x_state
*m_state
;
73 int (*m_coder
)(int code
, int in_code
, struct g72x_state
*state
);
74 int (*m_decoder
)(int code
, int out_code
, struct g72x_state
*state
);
77 void PutBits(wxUint8 bits
);