Forráskód Böngészése

implemented Client.deactivate()

Fabian Peter Hammerle 9 éve
szülő
commit
03dd9a5280
1 módosított fájl, 17 hozzáadás és 0 törlés
  1. 17 0
      jack.c

+ 17 - 0
jack.c

@@ -212,6 +212,17 @@ static PyObject* client_activate(Client* self) {
         return Py_None;
     }
 }
+
+static PyObject* client_deactivate(Client* self) {
+    int error_code = jack_deactivate(self->client);
+    if(error_code) {
+        PyErr_SetString(error, "");
+        return NULL;
+    } else {
+        Py_INCREF(Py_None);
+        return Py_None;
+    }
+}
 #include <stdio.h>
 static PyObject* client_connect(Client* self, PyObject* args)
 {
@@ -382,6 +393,12 @@ static PyMethodDef client_methods[] = {
         METH_VARARGS,
         "Establish a connection between two ports.",
         },
+    {
+        "deactivate",
+        (PyCFunction)client_deactivate,
+        METH_NOARGS,
+        "Tell the Jack server that the program is ready to start processing audio.",
+        },
     {
         "get_name",
         (PyCFunction)client_get_name,