]> git.0d.be Git - jack_mixer.git/commitdiff
Add possibility for main to be mono
authorFrédéric Péters <fpeters@0d.be>
Wed, 13 Jul 2011 13:37:26 +0000 (15:37 +0200)
committerFrédéric Péters <fpeters@0d.be>
Wed, 13 Jul 2011 13:37:26 +0000 (15:37 +0200)
jack_mixer.c
jack_mixer.h
jack_mixer_c.c

index 8ddd811d335e0486f50c191aaad7c6d1cbe0fcc1..a8703a3a95325e9780697a60d6bee6e0e77a9fce 100644 (file)
@@ -991,7 +991,8 @@ process(
 
 jack_mixer_t
 create(
-  const char * jack_client_name_ptr)
+  const char * jack_client_name_ptr,
+  bool stereo)
 {
   int ret;
   struct jack_mixer * mixer_ptr;
@@ -1033,7 +1034,7 @@ create(
 
   LOG_DEBUG("Sample rate: %" PRIu32, jack_get_sample_rate(mixer_ptr->jack_client));
 
-  mixer_ptr->main_mix_channel = create_output_channel(mixer_ptr, "MAIN", true, false);
+  mixer_ptr->main_mix_channel = create_output_channel(mixer_ptr, "MAIN", stereo, false);
   if (mixer_ptr->main_mix_channel == NULL) {
     LOG_ERROR("Cannot create main mix channel");
     goto close_jack;
index 3de773a88e415ccf4b4897cc4f66ba826718e879..5e38576061ac9e5238d4d2e644796659c8f278b9 100644 (file)
@@ -41,7 +41,8 @@ typedef void * jack_mixer_threshold_t;
 
 jack_mixer_t
 create(
-  const char * jack_client_name_ptr);
+  const char * jack_client_name_ptr,
+  bool stereo);
 
 void
 destroy(
index c5e56fbbac9f4628eb7a84ffedf168c53e6ce4c3..5bff6f9c51c1241349e53c9e46491f43c10dab44 100644 (file)
@@ -795,13 +795,14 @@ Mixer_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
 static int
 Mixer_init(MixerObject *self, PyObject *args, PyObject *kwds)
 {
-       static char *kwlist[] = {"name", NULL};
+       static char *kwlist[] = {"name", "stereo", NULL};
        char *name;
+       int stereo = 1;
 
-       if (!PyArg_ParseTupleAndKeywords(args, kwds, "s", kwlist, &name))
+       if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|b", kwlist, &name, &stereo))
                return -1;
        
-       self->mixer = create(name);
+       self->mixer = create(name, (bool)stereo);
        if (self->mixer == NULL) {
                PyErr_SetString(PyExc_RuntimeError,
                                "error creating mixer, probably jack is not running");