]>
Commit | Line | Data |
---|---|---|
1 | // -------------------------------------------------------------------------- | |
2 | // Name: sndulaw.h | |
3 | // Purpose: | |
4 | // Date: 08/11/1999 | |
5 | // Author: Guilhem Lavaux <lavaux@easynet.fr> (C) 1999 | |
6 | // CVSID: $Id$ | |
7 | // License: wxWindows license | |
8 | // -------------------------------------------------------------------------- | |
9 | #ifndef _WX_SNDULAW_H | |
10 | #define _WX_SNDULAW_H | |
11 | ||
12 | #include "wx/defs.h" | |
13 | #include "wx/mmedia/defs.h" | |
14 | #include "wx/mmedia/sndcodec.h" | |
15 | #include "wx/mmedia/sndbase.h" | |
16 | ||
17 | // | |
18 | // ULAW format | |
19 | // | |
20 | class WXDLLIMPEXP_MMEDIA wxSoundFormatUlaw: public wxSoundFormatBase { | |
21 | public: | |
22 | wxSoundFormatUlaw(); | |
23 | ~wxSoundFormatUlaw(); | |
24 | ||
25 | void SetSampleRate(wxUint32 srate); | |
26 | wxUint32 GetSampleRate() const; | |
27 | ||
28 | void SetChannels(wxUint8 channels); | |
29 | wxUint8 GetChannels() const; | |
30 | ||
31 | wxSoundFormatType GetType() const { return wxSOUND_ULAW; } | |
32 | wxSoundFormatBase *Clone() const; | |
33 | ||
34 | wxUint32 GetTimeFromBytes(wxUint32 bytes) const; | |
35 | wxUint32 GetBytesFromTime(wxUint32 time) const; | |
36 | ||
37 | bool operator !=(const wxSoundFormatBase& frmt2) const; | |
38 | ||
39 | protected: | |
40 | wxUint32 m_srate; | |
41 | wxUint8 m_channels; | |
42 | }; | |
43 | ||
44 | // | |
45 | // ULAW converter class | |
46 | // | |
47 | ||
48 | class WXDLLIMPEXP_MMEDIA wxSoundRouterStream; | |
49 | class WXDLLIMPEXP_MMEDIA wxSoundStreamUlaw: public wxSoundStreamCodec { | |
50 | public: | |
51 | wxSoundStreamUlaw(wxSoundStream& sndio); | |
52 | ~wxSoundStreamUlaw(); | |
53 | ||
54 | wxSoundStream& Read(void *buffer, wxUint32 len); | |
55 | wxSoundStream& Write(const void *buffer, wxUint32 len); | |
56 | ||
57 | bool SetSoundFormat(const wxSoundFormatBase& format); | |
58 | ||
59 | wxUint32 GetBestSize() const; | |
60 | ||
61 | protected: | |
62 | wxSoundRouterStream *m_router; | |
63 | }; | |
64 | ||
65 | #endif |