]>
Commit | Line | Data |
---|---|---|
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 | %{ | |
26 | #if !wxUSE_WAVE | |
27 | // A C++ stub class for wxWave for platforms that don't have it. | |
28 | class wxWave : public wxObject | |
29 | { | |
30 | public: | |
31 | wxWave(const wxString& fileName, bool isResource = False) { | |
32 | wxPyBeginBlockThreads(); | |
33 | PyErr_SetString(PyExc_NotImplementedError, "wxWave is not available on this platform."); | |
34 | wxPyEndBlockThreads(); | |
35 | } | |
36 | wxWave(int size, const wxByte* data) { | |
37 | wxPyBeginBlockThreads(); | |
38 | PyErr_SetString(PyExc_NotImplementedError, "wxWave is not available on this platform."); | |
39 | wxPyEndBlockThreads(); | |
40 | } | |
41 | ||
42 | ~wxWave() {} | |
43 | ||
44 | bool IsOk() const { return False; } | |
45 | bool Play(bool async = True, bool looped = False) const { return False; } | |
46 | }; | |
47 | ||
48 | #endif | |
49 | %} | |
50 | ||
51 | ||
52 | ||
53 | class wxWave /*: public wxObject*/ | |
54 | { | |
55 | public: | |
56 | wxWave(const wxString& fileName, bool isResource = False); | |
57 | %extend { | |
58 | %name(WaveData) wxWave(const wxString& data) { | |
59 | return new wxWave(data.Len(), (wxByte*)data.c_str()); | |
60 | } | |
61 | } | |
62 | ||
63 | ~wxWave(); | |
64 | ||
65 | bool IsOk() const; | |
66 | bool Play(bool async = True, bool looped = False); | |
67 | ||
68 | %pythoncode { def __nonzero__(self): return self.IsOk() } | |
69 | }; | |
70 | ||
71 | ||
72 | ||
73 | ||
74 | //--------------------------------------------------------------------------- |