]>
Commit | Line | Data |
---|---|---|
1 | // -------------------------------------------------------------------------- | |
2 | // Name: sndpcm.h | |
3 | // Purpose: | |
4 | // Date: 08/11/1999 | |
5 | // Author: Guilhem Lavaux <lavaux@easynet.fr> (C) 1999 | |
6 | // CVSID: $Id$ | |
7 | // -------------------------------------------------------------------------- | |
8 | #ifndef _WX_SNDPCM_H | |
9 | #define _WX_SNDPCM_H | |
10 | ||
11 | #ifdef __GNUG__ | |
12 | #pragma interface "sndpcm.h" | |
13 | #endif | |
14 | ||
15 | #include "wx/defs.h" | |
16 | #include "wx/mmedia/defs.h" | |
17 | #include "wx/mmedia/sndbase.h" | |
18 | ||
19 | // | |
20 | // PCM specification class | |
21 | // | |
22 | ||
23 | class wxSoundFormatPcm : public wxSoundFormatBase { | |
24 | public: | |
25 | wxSoundFormatPcm(wxUint32 srate = 22500, wxUint8 bps = 8, | |
26 | wxUint16 channels = 2, bool sign = true, | |
27 | int order = wxLITTLE_ENDIAN); | |
28 | ~wxSoundFormatPcm(); | |
29 | ||
30 | void SetSampleRate(wxUint32 srate); | |
31 | void SetBPS(wxUint8 bps); | |
32 | void SetChannels(wxUint16 nchannels); | |
33 | void SetOrder(int order); | |
34 | void Signed(bool sign); | |
35 | ||
36 | wxUint32 GetSampleRate() const { return m_srate; } | |
37 | wxUint8 GetBPS() const { return m_bps; } | |
38 | wxUint16 GetChannels() const { return m_nchan; } | |
39 | int GetOrder() const { return m_order; } | |
40 | bool Signed() const { return m_signed; } | |
41 | ||
42 | wxSoundFormatType GetType() const { return wxSOUND_PCM; } | |
43 | wxSoundFormatBase *Clone() const; | |
44 | ||
45 | wxUint32 GetTimeFromBytes(wxUint32 bytes) const; | |
46 | wxUint32 GetBytesFromTime(wxUint32 time) const; | |
47 | ||
48 | bool operator!=(const wxSoundFormatBase& frmt2) const; | |
49 | ||
50 | protected: | |
51 | wxUint32 m_srate; | |
52 | wxUint8 m_bps; | |
53 | wxUint16 m_nchan; | |
54 | int m_order; | |
55 | bool m_signed; | |
56 | }; | |
57 | ||
58 | #endif |