]> git.saurik.com Git - wxWidgets.git/blame - include/wx/cocoa/sound.h
Applied changes by Bartlomiej Gorny for recent files and style panel fix.
[wxWidgets.git] / include / wx / cocoa / sound.h
CommitLineData
0c0be4a3
RN
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
6// Modified by:
7// Created: 2004-10-02
8// RCS-ID: $Id$
9// Copyright: (c) Ryan Norton
10// Licence: wxWindows licence
11/////////////////////////////////////////////////////////////////////////////
dcb68102 12
0c0be4a3
RN
13#ifndef _WX_COCOA_SOUND_H_
14#define _WX_COCOA_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
24class WXDLLEXPORT wxSound : public wxSoundBase
25{
26public:
27 wxSound();
28 wxSound(const wxString& fileName, bool isResource = FALSE);
29 wxSound(int size, const wxByte* data);
30 ~wxSound();
31
32public:
33 bool Create(const wxString& fileName, bool isResource = FALSE);
34 bool IsOk() const { return m_hSnd != NULL; }
35 static void Stop();
36 static bool IsPlaying();
37
38 inline WX_NSSound GetNSSound()
39 { return m_hSnd; }
40protected:
41 bool DoPlay(unsigned flags) const;
42
43private:
44 WX_NSSound m_hSnd; //NSSound handle
45 wxString m_sndname; //file path
46 int m_waveLength; //size of file in memory mode
47 struct objc_object * m_cocoaSoundDelegate;
48};
49
50#endif
51#endif
52 // _WX_COCOA_SOUND_H_