]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: sound.h | |
3 | // Purpose: wxSound class (loads and plays short Windows .wav files). | |
4 | // Optional on non-Windows platforms. | |
5 | // Author: Stefan Csomor | |
6 | // Modified by: | |
7 | // Created: 1998-01-01 | |
8 | // RCS-ID: $Id$ | |
9 | // Copyright: (c) Stefan Csomor | |
10 | // Licence: wxWindows licence | |
11 | ///////////////////////////////////////////////////////////////////////////// | |
12 | ||
13 | #ifndef _WX_SOUND_H_ | |
14 | #define _WX_SOUND_H_ | |
15 | ||
16 | #if wxUSE_SOUND | |
17 | ||
18 | #include "wx/object.h" | |
19 | ||
20 | class WXDLLEXPORT wxSound : public wxSoundBase | |
21 | { | |
22 | public: | |
23 | wxSound(); | |
24 | wxSound(const wxString& fileName, bool isResource = FALSE); | |
25 | wxSound(int size, const wxByte* data); | |
26 | ~wxSound(); | |
27 | ||
28 | public: | |
29 | bool Create(const wxString& fileName, bool isResource = FALSE); | |
30 | bool IsOk() const { return !m_sndname.IsEmpty(); } | |
31 | ||
32 | protected: | |
33 | // prevent collision with some BSD definitions of macro Free() | |
34 | bool FreeData(); | |
35 | ||
36 | bool DoPlay(unsigned flags) const; | |
37 | ||
38 | private: | |
39 | void* m_sndChan; | |
40 | ||
41 | wxString m_sndname; | |
42 | void* m_hSnd; | |
43 | int m_waveLength; | |
44 | bool m_isResource; | |
45 | }; | |
46 | ||
47 | #endif | |
48 | #endif | |
49 | // _WX_SOUND_H_ |