1 // --------------------------------------------------------------------------
5 // Author: Guilhem Lavaux <lavaux@easynet.fr> (C) 1999
7 // License: wxWindows license
8 // --------------------------------------------------------------------------
13 #pragma interface "sndg72x.h"
17 #include "wx/mmedia/defs.h"
18 #include "wx/mmedia/sndbase.h"
19 #include "wx/mmedia/sndcodec.h"
20 #include "wx/mmedia/sndbase.h"
28 // This fixes a bug in Mingw95
29 typedef struct g72x_state g72state
;
34 class WXDLLIMPEXP_MMEDIA wxSoundFormatG72X
: public wxSoundFormatBase
{
39 void SetG72XType(wxSoundG72XType type
);
40 wxSoundG72XType
GetG72XType() const { return m_g72x_type
; }
42 void SetSampleRate(wxUint32 srate
);
43 wxUint32
GetSampleRate() const;
45 wxSoundFormatType
GetType() const { return wxSOUND_G72X
; }
46 wxSoundFormatBase
*Clone() const;
48 wxUint32
GetTimeFromBytes(wxUint32 bytes
) const;
49 wxUint32
GetBytesFromTime(wxUint32 time
) const;
51 bool operator !=(const wxSoundFormatBase
& frmt2
) const;
55 wxSoundG72XType m_g72x_type
;
59 // ULAW converter class
62 class WXDLLIMPEXP_MMEDIA wxSoundRouterStream
;
63 class WXDLLIMPEXP_MMEDIA wxSoundStreamG72X
: public wxSoundStreamCodec
{
65 wxSoundStreamG72X(wxSoundStream
& sndio
);
68 wxSoundStream
& Read(void *buffer
, wxUint32 len
);
69 wxSoundStream
& Write(const void *buffer
, wxUint32 len
);
71 bool SetSoundFormat(const wxSoundFormatBase
& format
);
74 wxSoundRouterStream
*m_router
;
75 wxUint8 m_n_bits
, m_current_mask
, m_current_b_pos
, m_current_byte
;
79 int (*m_coder
)(int code
, int in_code
, struct g72x_state
*state
);
80 int (*m_decoder
)(int code
, int out_code
, struct g72x_state
*state
);
83 void PutBits(wxUint8 bits
);