- %nokwargs wxSound;
- wxSound();
- wxSound(const wxString& fileName, bool isResource = false);
- wxSound(int size, const wxByte* data);
+ %extend {
+ wxSound(const wxString& fileName = wxPyEmptyString /*, bool isResource = false*/) {
+ if (fileName.Length() == 0)
+ return new wxSound;
+ else
+ return new wxSound(fileName);
+ }
+ %name(SoundFromData) wxSound(PyObject* data) {
+ unsigned char* buffer; int size;
+ wxSound *sound = NULL;
+
+ bool blocked = wxPyBeginBlockThreads();
+ if (!PyArg_Parse(data, "t#", &buffer, &size))
+ goto done;
+ sound = new wxSound(size, buffer);
+ done:
+ wxPyEndBlockThreads(blocked);
+ return sound;
+ }
+ }
+