]> git.saurik.com Git - wxWidgets.git/blob - contrib/include/wx/mmedia/sndulaw.h
use WX_DEFINE_ARRAY_PTR for anarray of pointers (fixes Sun CC warning)
[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 // License: wxWindows license
8 // --------------------------------------------------------------------------
9 #ifndef _WX_SNDULAW_H
10 #define _WX_SNDULAW_H
11
12 #ifdef __GNUG__
13 #pragma interface "sndulaw.h"
14 #endif
15
16 #include "wx/defs.h"
17 #include "wx/mmedia/defs.h"
18 #include "wx/mmedia/sndcodec.h"
19 #include "wx/mmedia/sndbase.h"
20
21 //
22 // ULAW format
23 //
24 class WXDLLIMPEXP_MMEDIA wxSoundFormatUlaw: public wxSoundFormatBase {
25 public:
26 wxSoundFormatUlaw();
27 ~wxSoundFormatUlaw();
28
29 void SetSampleRate(wxUint32 srate);
30 wxUint32 GetSampleRate() const;
31
32 void SetChannels(wxUint8 channels);
33 wxUint8 GetChannels() const;
34
35 wxSoundFormatType GetType() const { return wxSOUND_ULAW; }
36 wxSoundFormatBase *Clone() const;
37
38 wxUint32 GetTimeFromBytes(wxUint32 bytes) const;
39 wxUint32 GetBytesFromTime(wxUint32 time) const;
40
41 bool operator !=(const wxSoundFormatBase& frmt2) const;
42
43 protected:
44 wxUint32 m_srate;
45 wxUint8 m_channels;
46 };
47
48 //
49 // ULAW converter class
50 //
51
52 class WXDLLIMPEXP_MMEDIA wxSoundRouterStream;
53 class WXDLLIMPEXP_MMEDIA wxSoundStreamUlaw: public wxSoundStreamCodec {
54 public:
55 wxSoundStreamUlaw(wxSoundStream& sndio);
56 ~wxSoundStreamUlaw();
57
58 wxSoundStream& Read(void *buffer, wxUint32 len);
59 wxSoundStream& Write(const void *buffer, wxUint32 len);
60
61 bool SetSoundFormat(const wxSoundFormatBase& format);
62
63 wxUint32 GetBestSize() const;
64
65 protected:
66 wxSoundRouterStream *m_router;
67 };
68
69 #endif