]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: wave.h | |
3 | // Purpose: wxWave class | |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 25/10/98 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Julian Smart | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_WAVE_H_ | |
13 | #define _WX_WAVE_H_ | |
14 | ||
15 | #if wxUSE_WAVE | |
16 | ||
17 | #ifdef __GNUG__ | |
18 | #pragma interface "wave.h" | |
19 | #endif | |
20 | ||
21 | #include "wx/object.h" | |
22 | ||
23 | #ifndef AUDIODEV | |
24 | #define AUDIODEV "/dev/dsp" // Default path for audio device | |
25 | #endif | |
26 | ||
27 | class wxWave : public wxObject | |
28 | { | |
29 | public: | |
30 | wxWave(); | |
31 | wxWave(const wxString& fileName, bool isResource = FALSE); | |
32 | wxWave(int size, const wxByte* data); | |
33 | ~wxWave(); | |
34 | ||
35 | public: | |
36 | // Create from resource or file | |
37 | bool Create(const wxString& fileName, bool isResource = FALSE); | |
38 | // Create from data | |
39 | bool Create(int size, const wxByte* data); | |
40 | ||
41 | bool IsOk() const { return (m_waveData ? TRUE : FALSE); }; | |
42 | bool Play(bool async = TRUE, bool looped = FALSE); | |
43 | ||
44 | protected: | |
45 | bool Free(); | |
46 | ||
47 | private: | |
48 | wxByte* m_waveData; | |
49 | int m_waveLength; | |
50 | bool m_isResource; | |
51 | ||
52 | ||
53 | int OpenDSP(void); | |
54 | bool InitDSP(int dev, int iDataBits, int iChannel,unsigned long ulSamplingRate); | |
55 | int m_DSPblkSize; // Size of the DSP buffer | |
56 | char *m_data; | |
57 | int m_sizeData; | |
58 | }; | |
59 | ||
60 | #endif | |
61 | ||
62 | #endif | |
63 |