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