]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/sound.h
c96dc74cfc2d31ce8b6d06fb5ca3b61cebc1a696
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxSoundBase class
4 // Author: Vaclav Slavik
8 // Copyright: (c) 2004, Vaclav Slavik
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_SOUND_H_BASE_
13 #define _WX_SOUND_H_BASE_
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "soundbase.h"
19 #include "wx/object.h"
21 // ----------------------------------------------------------------------------
22 // wxSoundBase: common wxSound code and interface
23 // ----------------------------------------------------------------------------
25 // Flags for wxSound::Play
30 wxSOUND_LOOP
= 2 | wxSOUND_ASYNC
33 class wxSoundBase
: public wxObject
37 bool Play(unsigned flags
= wxSOUND_ASYNC
)
41 #if WXWIN_COMPATIBILITY_2_4
42 wxDEPRECATED( bool Play(bool async
= true, bool looped
= false) );
46 virtual bool DoPlay(unsigned flags
) = 0;
49 #if WXWIN_COMPATIBILITY_2_4
50 inline bool wxSoundBase::Play(bool async
, bool looped
)
53 if (async
) flags
|= wxSOUND_ASYNC
;
54 if (looped
) flags
|= wxSOUND_LOOP
;
59 // ----------------------------------------------------------------------------
60 // wxSound class implementation
61 // ----------------------------------------------------------------------------
63 #if defined(__WXMSW__)
64 #include "wx/msw/wave.h"
65 #elif defined(__UNIX__)
66 #include "wx/unix/sound.h"
67 #elif defined(__WXMAC__)
68 #include "wx/mac/wave.h"
69 #elif defined(__WXPM__)
70 #include "wx/os2/wave.h"
73 // wxSound used to be called wxWave before wxWindows 2.5.1:
74 #ifdef __UNIX__ // FIXME: on all platforms when everything is renamed
75 #if WXWIN_COMPATIBILITY_2_4
76 typedef wxSound wxWave
;
79 typedef wxWave wxSound
;
82 #endif // _WX_SOUND_H_BASE_