소스 검색

implemented Client.deactivate()

Fabian Peter Hammerle 9 년 전
부모
커밋
03dd9a5280
1개의 변경된 파일17개의 추가작업 그리고 0개의 파일을 삭제
  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,