/usr/include/wx-3.0/wx/wxPython/i_files/_sound.i is in python-wxgtk3.0-dev 3.0.2.0+dfsg-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | /////////////////////////////////////////////////////////////////////////////
// Name: _sound.i
// Purpose: SWIG interface stuff for wxSound
//
// Author: Robin Dunn
//
// Created: 18-June-1999
// RCS-ID: $Id$
// Copyright: (c) 2003 by Total Control Software
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
// Not a %module
//---------------------------------------------------------------------------
%newgroup
%{
#include <wx/sound.h>
%}
//---------------------------------------------------------------------------
enum wxSoundFlags
{
wxSOUND_SYNC,
wxSOUND_ASYNC,
wxSOUND_LOOP
};
%{
#if !wxUSE_SOUND
// A C++ stub class for wxSound for platforms that don't have it.
enum wxSoundFlags
{
wxSOUND_SYNC,
wxSOUND_ASYNC,
wxSOUND_LOOP
};
class wxSound : public wxObject
{
public:
wxSound() {
wxPyBlock_t blocked = wxPyBeginBlockThreads();
PyErr_SetString(PyExc_NotImplementedError,
"wxSound is not available on this platform.");
wxPyEndBlockThreads(blocked);
}
wxSound(const wxString&/*, bool*/) {
wxPyBlock_t blocked = wxPyBeginBlockThreads();
PyErr_SetString(PyExc_NotImplementedError,
"wxSound is not available on this platform.");
wxPyEndBlockThreads(blocked);
}
wxSound(int, const wxByte*) {
wxPyBlock_t blocked = wxPyBeginBlockThreads();
PyErr_SetString(PyExc_NotImplementedError,
"wxSound is not available on this platform.");
wxPyEndBlockThreads(blocked);
}
~wxSound() {};
bool Create(const wxString&/*, bool*/) { return false; }
bool Create(int, const wxByte*) { return false; };
bool IsOk() { return false; };
bool Play(unsigned) const { return false; }
static bool Play(const wxString&, unsigned) { return false; }
static void Stop() {}
};
#endif
%}
MustHaveApp(wxSound);
MustHaveApp(wxSound::Play);
MustHaveApp(wxSound::Stop);
class wxSound /*: public wxObject*/
{
public:
%extend {
wxSound(const wxString& fileName = wxPyEmptyString /*, bool isResource = false*/) {
if (fileName.Length() == 0)
return new wxSound;
else
return new wxSound(fileName);
}
%RenameCtor(SoundFromData, wxSound(PyObject* data))
{
unsigned char* buffer; int size;
wxSound *sound = NULL;
wxPyBlock_t blocked = wxPyBeginBlockThreads();
if (!PyArg_Parse(data, "t#", &buffer, &size))
goto done;
sound = new wxSound(size, buffer);
done:
wxPyEndBlockThreads(blocked);
return sound;
}
}
~wxSound();
// Create from resource or file
bool Create(const wxString& fileName/*, bool isResource = false*/);
%extend {
bool CreateFromData(PyObject* data) {
%#ifndef __WXMAC__
unsigned char* buffer;
int size;
bool rv = false;
wxPyBlock_t blocked = wxPyBeginBlockThreads();
if (!PyArg_Parse(data, "t#", &buffer, &size))
goto done;
rv = self->Create(size, buffer);
done:
wxPyEndBlockThreads(blocked);
return rv;
%#else
wxPyBlock_t blocked = wxPyBeginBlockThreads();
PyErr_SetString(PyExc_NotImplementedError,
"Create from data is not available on this platform.");
wxPyEndBlockThreads(blocked);
return false;
%#endif
}
}
bool IsOk();
// Play the sound:
bool Play(unsigned flags = wxSOUND_ASYNC) const;
// Plays sound from filename:
%Rename(PlaySound, static bool, Play(const wxString& filename, unsigned flags = wxSOUND_ASYNC));
static void Stop();
%pythoncode { def __nonzero__(self): return self.IsOk() }
};
//---------------------------------------------------------------------------
|