refactoring in preparation for further changes: moved data in a private struct, let...
[wxWidgets.git] / include / wx / msw / sound.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/sound.h
3 // Purpose: wxSound class
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 01/02/97
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_SOUND_H_
13 #define _WX_SOUND_H_
14
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "sound.h"
17 #endif
18
19 #if wxUSE_SOUND
20
21 class WXDLLIMPEXP_ADV wxSound : public wxSoundBase
22 {
23 public:
24 wxSound();
25 wxSound(const wxString& fileName, bool isResource = false);
26 wxSound(int size, const wxByte* data);
27 virtual ~wxSound();
28
29 // Create from resource or file
30 bool Create(const wxString& fileName, bool isResource = false);
31
32 // Create from data
33 bool Create(int size, const wxByte* data);
34
35 bool IsOk() const { return m_data != NULL; }
36
37 static void Stop();
38
39 protected:
40 void Init() { m_data = NULL; }
41 bool CheckCreatedOk();
42 void Free();
43
44 virtual bool DoPlay(unsigned flags) const;
45
46 private:
47 // data of this object
48 class wxSoundData *m_data;
49
50 DECLARE_NO_COPY_CLASS(wxSound)
51 };
52
53 #endif // wxUSE_SOUND
54
55 #endif // _WX_SOUND_H_
56