- %name(SoundFromData) wxSound(const wxMemoryBuffer& data) {
- return new wxSound((int)data.GetDataLen(), (wxByte*)data.GetData());
+ %RenameCtor(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;