]> git.0d.be Git - jack_mixer.git/commitdiff
Add explicit method to destroy JACK client connection
authorFrédéric Péters <fpeters@0d.be>
Wed, 5 May 2010 09:55:29 +0000 (11:55 +0200)
committerFrédéric Péters <fpeters@0d.be>
Wed, 5 May 2010 09:55:29 +0000 (11:55 +0200)
jack_mixer.py
jack_mixer_c.c

index 52b28b33ec0f96a310f6e43e60b4af3585ed2ae4..99eb9d63e07a40d9d90f5e7d8edf476709e6f54c 100755 (executable)
@@ -222,6 +222,8 @@ class JackMixer(SerializedObject):
         for channel in self.channels:
             channel.unrealize()
 
+        self.mixer.destroy()
+
     def on_open_cb(self, *args):
         dlg = gtk.FileChooserDialog(title='Open', parent=self.window,
                         action=gtk.FILE_CHOOSER_ACTION_OPEN,
index d1e3229e1e3ecb6c26a37298f286232cd112c675..dba61d035c1e543a45f47aa43e7fd31912455e91 100644 (file)
@@ -873,10 +873,21 @@ Mixer_add_output_channel(MixerObject *self, PyObject *args)
        return OutputChannel_New(channel);
 }
 
+static PyObject*
+Mixer_destroy(MixerObject *self, PyObject *args)
+{
+       if (self->mixer) {
+               destroy(self->mixer);
+               self->mixer = NULL;
+       }
+       Py_INCREF(Py_None);
+       return Py_None;
+}
 
 static PyMethodDef Mixer_methods[] = {
        {"add_channel", (PyCFunction)Mixer_add_channel, METH_VARARGS, "Add a new channel"},
        {"add_output_channel", (PyCFunction)Mixer_add_output_channel, METH_VARARGS, "Add a new output channel"},
+       {"destroy", (PyCFunction)Mixer_destroy, METH_VARARGS, "Destroy JACK Mixer"},
 //     {"remove_channel", (PyCFunction)Mixer_remove_channel, METH_VARARGS, "Remove a channel"},
        {NULL}
 };