]>
Commit | Line | Data |
---|---|---|
0e320a79 | 1 | ///////////////////////////////////////////////////////////////////////////// |
80fdcdb9 | 2 | // Name: wx/os2/sound.h |
bae90c4c | 3 | // Purpose: wxSound class (loads and plays short Windows .wav files). |
0e320a79 | 4 | // Optional on non-Windows platforms. |
d90895ac | 5 | // Author: David Webster |
0e320a79 | 6 | // Modified by: |
d90895ac | 7 | // Created: 10/17/99 |
0e320a79 | 8 | // RCS-ID: $Id$ |
d90895ac | 9 | // Copyright: (c) David Webster |
65571936 | 10 | // Licence: wxWindows licence |
0e320a79 DW |
11 | ///////////////////////////////////////////////////////////////////////////// |
12 | ||
bae90c4c VS |
13 | #ifndef _WX_SOUND_H_ |
14 | #define _WX_SOUND_H_ | |
0e320a79 | 15 | |
0e320a79 DW |
16 | #include "wx/object.h" |
17 | ||
bae90c4c | 18 | class wxSound : public wxSoundBase |
0e320a79 DW |
19 | { |
20 | public: | |
bae90c4c VS |
21 | wxSound(); |
22 | wxSound(const wxString& fileName, bool isResource = FALSE); | |
c559c4b3 | 23 | wxSound(size_t size, const void* data); |
d3c7fc99 | 24 | virtual ~wxSound(); |
0e320a79 DW |
25 | |
26 | public: | |
d90895ac | 27 | // Create from resource or file |
0e320a79 | 28 | bool Create(const wxString& fileName, bool isResource = FALSE); |
d90895ac | 29 | // Create from data |
c559c4b3 | 30 | bool Create(size_t size, const void* data); |
d90895ac | 31 | |
6dd0883d | 32 | bool IsOk() const { return (m_waveData ? TRUE : FALSE); } |
0e320a79 DW |
33 | |
34 | protected: | |
35 | bool Free(); | |
03647350 | 36 | |
bae90c4c | 37 | bool DoPlay(unsigned flags) const; |
0e320a79 DW |
38 | |
39 | private: | |
d90895ac | 40 | wxByte* m_waveData; |
0e320a79 DW |
41 | int m_waveLength; |
42 | bool m_isResource; | |
43 | }; | |
44 | ||
45 | #endif | |
bae90c4c | 46 | // _WX_SOUND_H_ |