]>
Commit | Line | Data |
---|---|---|
e8482f24 GL |
1 | // -------------------------------------------------------------------------- |
2 | // Name: sndulaw.h | |
3 | // Purpose: | |
4 | // Date: 08/11/1999 | |
5 | // Author: Guilhem Lavaux <lavaux@easynet.fr> (C) 1999 | |
6 | // CVSID: $Id$ | |
05aa8cf3 | 7 | // License: wxWindows license |
e8482f24 GL |
8 | // -------------------------------------------------------------------------- |
9 | #ifndef _WX_SNDULAW_H | |
10 | #define _WX_SNDULAW_H | |
11 | ||
e8482f24 | 12 | #include "wx/defs.h" |
15e8daec | 13 | #include "wx/mmedia/defs.h" |
e8482f24 GL |
14 | #include "wx/mmedia/sndcodec.h" |
15 | #include "wx/mmedia/sndbase.h" | |
16 | ||
17 | // | |
18 | // ULAW format | |
19 | // | |
15e8daec | 20 | class WXDLLIMPEXP_MMEDIA wxSoundFormatUlaw: public wxSoundFormatBase { |
e8482f24 GL |
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 | ||
15e8daec VS |
48 | class WXDLLIMPEXP_MMEDIA wxSoundRouterStream; |
49 | class WXDLLIMPEXP_MMEDIA wxSoundStreamUlaw: public wxSoundStreamCodec { | |
e8482f24 GL |
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 |