]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/_wave.i
renamed wxWave to wxSound
[wxWidgets.git] / wxPython / src / _wave.i
CommitLineData
d14a1e28
RD
1/////////////////////////////////////////////////////////////////////////////
2// Name: _joystick.i
3// Purpose: SWIG interface stuff for wxWave
4//
5// Author: Robin Dunn
6//
7// Created: 18-June-1999
8// RCS-ID: $Id$
9// Copyright: (c) 2003 by Total Control Software
10// Licence: wxWindows license
11/////////////////////////////////////////////////////////////////////////////
12
13// Not a %module
14
15
16//---------------------------------------------------------------------------
17%newgroup
18
19%{
20#include <wx/wave.h>
21%}
22
23//---------------------------------------------------------------------------
24
25%{
dff1fa9b 26#if !wxUSE_SOUND
d14a1e28
RD
27// A C++ stub class for wxWave for platforms that don't have it.
28class wxWave : public wxObject
29{
30public:
dd9f7fea 31 wxWave(const wxString& fileName, bool isResource = False) {
d14a1e28 32 wxPyBeginBlockThreads();
81cfe5e1
RD
33 PyErr_SetString(PyExc_NotImplementedError,
34 "wxWave is not available on this platform.");
d14a1e28
RD
35 wxPyEndBlockThreads();
36 }
37 wxWave(int size, const wxByte* data) {
38 wxPyBeginBlockThreads();
81cfe5e1
RD
39 PyErr_SetString(PyExc_NotImplementedError,
40 "wxWave is not available on this platform.");
d14a1e28
RD
41 wxPyEndBlockThreads();
42 }
43
44 ~wxWave() {}
45
dd9f7fea
RD
46 bool IsOk() const { return False; }
47 bool Play(bool async = True, bool looped = False) const { return False; }
d14a1e28
RD
48};
49
50#endif
51%}
52
53
54
55class wxWave /*: public wxObject*/
56{
57public:
dd9f7fea 58 wxWave(const wxString& fileName, bool isResource = False);
d14a1e28
RD
59 %extend {
60 %name(WaveData) wxWave(const wxString& data) {
61 return new wxWave(data.Len(), (wxByte*)data.c_str());
62 }
63 }
64
65 ~wxWave();
66
67 bool IsOk() const;
6c3b4aae 68 bool Play(bool async = True, bool looped = False);
d14a1e28
RD
69
70 %pythoncode { def __nonzero__(self): return self.IsOk() }
71};
72
73
74
75
76//---------------------------------------------------------------------------