]> git.saurik.com Git - wxWidgets.git/blob - contrib/include/wx/mmedia/sndulaw.h
Restore WXBASEPORT for carbon. This is more than just a flavour
[wxWidgets.git] / contrib / include / wx / mmedia / 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 "wx/defs.h"
16 #include "wx/mmedia/defs.h"
17 #include "wx/mmedia/sndcodec.h"
18 #include "wx/mmedia/sndbase.h"
19
20 //
21 // ULAW format
22 //
23 class WXDLLIMPEXP_MMEDIA wxSoundFormatUlaw: public wxSoundFormatBase {
24 public:
25 wxSoundFormatUlaw();
26 ~wxSoundFormatUlaw();
27
28 void SetSampleRate(wxUint32 srate);
29 wxUint32 GetSampleRate() const;
30
31 void SetChannels(wxUint8 channels);
32 wxUint8 GetChannels() const;
33
34 wxSoundFormatType GetType() const { return wxSOUND_ULAW; }
35 wxSoundFormatBase *Clone() const;
36
37 wxUint32 GetTimeFromBytes(wxUint32 bytes) const;
38 wxUint32 GetBytesFromTime(wxUint32 time) const;
39
40 bool operator !=(const wxSoundFormatBase& frmt2) const;
41
42 protected:
43 wxUint32 m_srate;
44 wxUint8 m_channels;
45 };
46
47 //
48 // ULAW converter class
49 //
50
51 class WXDLLIMPEXP_MMEDIA wxSoundRouterStream;
52 class WXDLLIMPEXP_MMEDIA wxSoundStreamUlaw: public wxSoundStreamCodec {
53 public:
54 wxSoundStreamUlaw(wxSoundStream& sndio);
55 ~wxSoundStreamUlaw();
56
57 wxSoundStream& Read(void *buffer, wxUint32 len);
58 wxSoundStream& Write(const void *buffer, wxUint32 len);
59
60 bool SetSoundFormat(const wxSoundFormatBase& format);
61
62 wxUint32 GetBestSize() const;
63
64 protected:
65 wxSoundRouterStream *m_router;
66 };
67
68 #endif