]> git.saurik.com Git - wxWidgets.git/blob - include/wx/mac/carbon/sound.h
hide the MDI parent frame instead of just moving it away (why didn't I do it like...
[wxWidgets.git] / include / wx / mac / carbon / sound.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: sound.h
3 // Purpose: wxSound class (loads and plays short Windows .wav files).
4 // Optional on non-Windows platforms.
5 // Author: Ryan Norton, Stefan Csomor
6 // Modified by:
7 // Created: 1998-01-01
8 // RCS-ID: $Id$
9 // Copyright: (c) Ryan Norton, Stefan Csomor
10 // Licence: wxWindows licence
11 /////////////////////////////////////////////////////////////////////////////
12
13 #ifndef _WX_SOUND_H_
14 #define _WX_SOUND_H_
15
16 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
17 #pragma interface "sound.h"
18 #endif
19
20 #if wxUSE_SOUND
21
22 #include "wx/object.h"
23
24 class WXDLLEXPORT wxSound : public wxSoundBase
25 {
26 public:
27 wxSound();
28 wxSound(const wxString& fileName, bool isResource = FALSE);
29 wxSound(int size, const wxByte* data);
30 ~wxSound();
31
32 public:
33 bool Create(const wxString& fileName, bool isResource = FALSE);
34 bool IsOk() const { return !m_sndname.IsEmpty(); }
35 static void Stop();
36 static bool IsPlaying();
37
38 void* GetHandle();
39 protected:
40 bool DoPlay(unsigned flags) const;
41
42 private:
43 wxString m_sndname; //file path
44 char* m_hSnd; //pointer to resource or memory location
45 int m_waveLength; //size of file in memory mode
46 void* m_pTimer; //timer
47
48 enum wxSoundType
49 {
50 wxSound_MEMORY,
51 wxSound_FILE,
52 wxSound_RESOURCE,
53 wxSound_NONE
54 } m_type; //mode
55 };
56
57 #endif
58 #endif
59 // _WX_SOUND_H_