1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxSound class (loads and plays short Windows .wav files).
4 // Optional on non-Windows platforms.
9 // Copyright: (c) Ryan Norton
10 // Licence: wxWindows licence
11 /////////////////////////////////////////////////////////////////////////////
13 #ifndef _WX_COCOA_SOUND_H_
14 #define _WX_COCOA_SOUND_H_
16 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
17 #pragma interface "sound.h"
22 #include "wx/object.h"
23 #include "wx/cocoa/ObjcRef.h"
25 class WXDLLEXPORT wxSound
: public wxSoundBase
29 wxSound(const wxString
& fileName
, bool isResource
= false);
30 wxSound(int size
, const wxByte
* data
);
34 bool Create(const wxString
& fileName
, bool isResource
= false);
36 { return m_cocoaNSSound
; }
38 static bool IsPlaying();
40 inline WX_NSSound
GetNSSound()
41 { return m_cocoaNSSound
; }
43 bool DoPlay(unsigned flags
) const;
46 WX_NSSound m_cocoaNSSound
; //NSSound handle
47 wxString m_sndname
; //file path
48 int m_waveLength
; //size of file in memory mode
49 static const wxObjcAutoRefFromAlloc
<struct objc_object
*> sm_cocoaDelegate
;