]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/_sound.i
Add the masked package dir
[wxWidgets.git] / wxPython / src / _sound.i
index b26dbd859caac7e6917a2187a2529b1d57d13406..e120cf52a8cd00d022cf5f319c50192cff5ace71 100644 (file)
@@ -38,22 +38,22 @@ class wxSound : public wxObject
 {
 public:
     wxSound() {
-        wxPyBeginBlockThreads();
+        bool blocked = wxPyBeginBlockThreads();
         PyErr_SetString(PyExc_NotImplementedError,
                         "wxSound is not available on this platform.");
-        wxPyEndBlockThreads();
+        wxPyEndBlockThreads(blocked);
     }
     wxSound(const wxString&, bool) {
-        wxPyBeginBlockThreads();
+        bool blocked = wxPyBeginBlockThreads();
         PyErr_SetString(PyExc_NotImplementedError,
                         "wxSound is not available on this platform.");
-        wxPyEndBlockThreads();
+        wxPyEndBlockThreads(blocked);
     }
     wxSound(int, const wxByte*) {
-        wxPyBeginBlockThreads();
+        bool blocked = wxPyBeginBlockThreads();
         PyErr_SetString(PyExc_NotImplementedError,
                         "wxSound is not available on this platform.");
-        wxPyEndBlockThreads();
+        wxPyEndBlockThreads(blocked);
     }
     
     ~wxSound() {};
@@ -85,10 +85,22 @@ public:
     
     // Create from resource or file
     bool Create(const wxString& fileName, bool isResource = false);
-    
+
+#ifndef __WXMAC__
     // Create from data
     bool Create(int size, const wxByte* data);
-
+#else
+    %extend {
+        bool Create(int size, const wxByte* data) {
+            bool 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:
@@ -97,8 +109,14 @@ public:
     // Plays sound from filename:
     %name(PlaySound)static bool Play(const wxString& filename, unsigned flags = wxSOUND_ASYNC);
 
+#ifndef __WXMAC__
     static void Stop();
-
+#else
+    %extend {
+        static void Stop()
+            { wxPyRaiseNotImplemented(); }
+    }
+#endif
 
     %pythoncode { def __nonzero__(self): return self.IsOk() }
 };