]> git.saurik.com Git - wxWidgets.git/blame - include/wx/mac/carbon/sound.h
destroy m_impl even if an exception is thrown from the main loop
[wxWidgets.git] / include / wx / mac / carbon / sound.h
CommitLineData
8cf73271
SC
1/////////////////////////////////////////////////////////////////////////////
2// Name: sound.h
3// Purpose: wxSound class (loads and plays short Windows .wav files).
4// Optional on non-Windows platforms.
4b430ee1 5// Author: Ryan Norton, Stefan Csomor
8cf73271
SC
6// Modified by:
7// Created: 1998-01-01
8// RCS-ID: $Id$
4b430ee1 9// Copyright: (c) Ryan Norton, Stefan Csomor
65571936 10// Licence: wxWindows licence
8cf73271
SC
11/////////////////////////////////////////////////////////////////////////////
12
13#ifndef _WX_SOUND_H_
14#define _WX_SOUND_H_
15
8cf73271
SC
16#if wxUSE_SOUND
17
18#include "wx/object.h"
19
20class WXDLLEXPORT wxSound : public wxSoundBase
21{
22public:
23 wxSound();
24 wxSound(const wxString& fileName, bool isResource = FALSE);
25 wxSound(int size, const wxByte* data);
d3c7fc99 26 virtual ~wxSound();
8cf73271
SC
27
28public:
29 bool Create(const wxString& fileName, bool isResource = FALSE);
30 bool IsOk() const { return !m_sndname.IsEmpty(); }
4b430ee1
DS
31 static void Stop();
32 static bool IsPlaying();
8cf73271 33
625d14ab 34 void* GetHandle();
4b430ee1 35protected:
8cf73271
SC
36 bool DoPlay(unsigned flags) const;
37
38private:
625d14ab
SC
39 wxString m_sndname; //file path
40 char* m_hSnd; //pointer to resource or memory location
41 int m_waveLength; //size of file in memory mode
42 void* m_pTimer; //timer
43
44 enum wxSoundType
45 {
46 wxSound_MEMORY,
47 wxSound_FILE,
48 wxSound_RESOURCE,
49 wxSound_NONE
50 } m_type; //mode
8cf73271
SC
51};
52
53#endif
54#endif
55 // _WX_SOUND_H_