]> git.saurik.com Git - wxWidgets.git/blob - utils/wxMMedia2/lib/sndulaw.h
4ddba8f577bb0f1aca3c30ac4b0118946ec75dfd
[wxWidgets.git] / utils / wxMMedia2 / lib / sndulaw.h
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 // --------------------------------------------------------------------------
8 #ifndef _WX_SNDULAW_H
9 #define _WX_SNDULAW_H
10
11 #ifdef __GNUG__
12 #pragma interface "sndulaw.h"
13 #endif
14
15 #include "sndcodec.h"
16 #include "sndbase.h"
17
18 //
19 // ULAW format
20 //
21 class WXDLLEXPORT wxSoundFormatUlaw: public wxSoundFormatBase {
22 public:
23 wxSoundFormatUlaw();
24 ~wxSoundFormatUlaw();
25
26 void SetSampleRate(wxUint32 srate);
27 wxUint32 GetSampleRate() const;
28
29 void SetChannels(wxUint8 channels);
30 wxUint8 GetChannels() const;
31
32 wxSoundFormatType GetType() const { return wxSOUND_ULAW; }
33 wxSoundFormatBase *Clone() const;
34
35 wxUint32 GetTimeFromBytes(wxUint32 bytes) const;
36 wxUint32 GetBytesFromTime(wxUint32 time) const;
37
38 bool operator !=(const wxSoundFormatBase& frmt2) const;
39
40 protected:
41 wxUint32 m_srate;
42 };
43
44 //
45 // ULAW converter class
46 //
47
48 class WXDLLEXPORT wxSoundRouterStream;
49 class WXDLLEXPORT 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