1 // --------------------------------------------------------------------------
5 // Author: Guilhem Lavaux <lavaux@easynet.fr> (C) 1999
7 // --------------------------------------------------------------------------
12 #pragma interface "sndg72x.h"
16 #include "wx/mmedia/defs.h"
17 #include "wx/mmedia/sndbase.h"
18 #include "wx/mmedia/sndcodec.h"
19 #include "wx/mmedia/sndbase.h"
27 // This fixes a bug in Mingw95
28 typedef struct g72x_state g72state
;
33 class WXDLLIMPEXP_MMEDIA wxSoundFormatG72X
: public wxSoundFormatBase
{
38 void SetG72XType(wxSoundG72XType type
);
39 wxSoundG72XType
GetG72XType() const { return m_g72x_type
; }
41 void SetSampleRate(wxUint32 srate
);
42 wxUint32
GetSampleRate() const;
44 wxSoundFormatType
GetType() const { return wxSOUND_G72X
; }
45 wxSoundFormatBase
*Clone() const;
47 wxUint32
GetTimeFromBytes(wxUint32 bytes
) const;
48 wxUint32
GetBytesFromTime(wxUint32 time
) const;
50 bool operator !=(const wxSoundFormatBase
& frmt2
) const;
54 wxSoundG72XType m_g72x_type
;
58 // ULAW converter class
61 class WXDLLIMPEXP_MMEDIA wxSoundRouterStream
;
62 class WXDLLIMPEXP_MMEDIA wxSoundStreamG72X
: public wxSoundStreamCodec
{
64 wxSoundStreamG72X(wxSoundStream
& sndio
);
67 wxSoundStream
& Read(void *buffer
, wxUint32 len
);
68 wxSoundStream
& Write(const void *buffer
, wxUint32 len
);
70 bool SetSoundFormat(const wxSoundFormatBase
& format
);
73 wxSoundRouterStream
*m_router
;
74 wxUint8 m_n_bits
, m_current_mask
, m_current_b_pos
, m_current_byte
;
78 int (*m_coder
)(int code
, int in_code
, struct g72x_state
*state
);
79 int (*m_decoder
)(int code
, int out_code
, struct g72x_state
*state
);
82 void PutBits(wxUint8 bits
);