]>
Commit | Line | Data |
---|---|---|
e8482f24 GL |
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/sndbase.h" | |
17 | ||
18 | // | |
19 | // PCM specification class | |
20 | // | |
21 | ||
22 | class wxSoundFormatPcm : public wxSoundFormatBase { | |
23 | public: | |
24 | wxSoundFormatPcm(wxUint32 srate = 22500, wxUint8 bps = 8, | |
25 | wxUint16 channels = 2, bool sign = TRUE, | |
26 | int order = wxLITTLE_ENDIAN); | |
27 | ~wxSoundFormatPcm(); | |
28 | ||
29 | void SetSampleRate(wxUint32 srate); | |
30 | void SetBPS(wxUint8 bps); | |
31 | void SetChannels(wxUint16 nchannels); | |
32 | void SetOrder(int order); | |
33 | void Signed(bool sign); | |
34 | ||
35 | wxUint32 GetSampleRate() const { return m_srate; } | |
36 | wxUint8 GetBPS() const { return m_bps; } | |
37 | wxUint16 GetChannels() const { return m_nchan; } | |
38 | int GetOrder() const { return m_order; } | |
39 | bool Signed() const { return m_signed; } | |
40 | ||
41 | wxSoundFormatType GetType() const { return wxSOUND_PCM; } | |
42 | wxSoundFormatBase *Clone() const; | |
43 | ||
44 | wxUint32 GetTimeFromBytes(wxUint32 bytes) const; | |
45 | wxUint32 GetBytesFromTime(wxUint32 time) const; | |
46 | ||
47 | bool operator!=(const wxSoundFormatBase& frmt2) const; | |
48 | ||
49 | protected: | |
50 | wxUint32 m_srate; | |
51 | wxUint8 m_bps; | |
52 | wxUint16 m_nchan; | |
53 | int m_order; | |
54 | bool m_signed; | |
55 | }; | |
56 | ||
57 | #endif |