return -1;
}
channel_volume_write(self->channel, PyFloat_AsDouble(value));
+ channel_set_midi_cc_volume_picked_up(self->channel, false);
return 0;
}
Channel_set_balance(ChannelObject *self, PyObject *value, void *closure)
{
channel_balance_write(self->channel, PyFloat_AsDouble(value));
+ channel_set_midi_cc_balance_picked_up(self->channel, false);
return 0;
}
{
PyObject *result;
- if (channel_is_out_muted(self->channel)) {
+ if (channel_is_out_muted(self->channel)) {
result = Py_True;
} else {
result = Py_False;
return result;
}
+static PyObject*
+Channel_get_kmeter(ChannelObject *self, void *closure)
+{
+ PyObject *result;
+ double peak_left, peak_right, rms_left, rms_right;
+
+ if (channel_is_stereo(self->channel)) {
+ result = PyTuple_New(4);
+ channel_stereo_kmeter_read(self->channel, &peak_left, &peak_right, &rms_left, &rms_right);
+ PyTuple_SetItem(result, 0, PyFloat_FromDouble(peak_left));
+ PyTuple_SetItem(result, 1, PyFloat_FromDouble(peak_right));
+ PyTuple_SetItem(result, 2, PyFloat_FromDouble(rms_left));
+ PyTuple_SetItem(result, 3, PyFloat_FromDouble(rms_right));
+ } else {
+ result = PyTuple_New(2);
+ channel_mono_kmeter_read(self->channel, &peak_left, &rms_left);
+ PyTuple_SetItem(result, 0, PyFloat_FromDouble(peak_left));
+ PyTuple_SetItem(result, 1, PyFloat_FromDouble(rms_left));
+ }
+ return result;
+}
+
static PyObject*
Channel_get_abspeak(ChannelObject *self, void *closure)
{
{"meter",
(getter)Channel_get_meter, NULL,
"meter", NULL},
+ {"kmeter",
+ (getter)Channel_get_kmeter, NULL,
+ "kmeter", NULL},
{"abspeak",
(getter)Channel_get_abspeak, (setter)Channel_set_abspeak,
"balance", NULL},
}
static PyObject*
-Channel_autoset_midi_cc(ChannelObject *self, PyObject *args)
+Channel_autoset_volume_midi_cc(ChannelObject *self, PyObject *args)
+{
+ if (! PyArg_ParseTuple(args, "")) return NULL;
+ channel_autoset_volume_midi_cc(self->channel);
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static PyObject*
+Channel_autoset_balance_midi_cc(ChannelObject *self, PyObject *args)
+{
+ if (! PyArg_ParseTuple(args, "")) return NULL;
+ channel_autoset_balance_midi_cc(self->channel);
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static PyObject*
+Channel_autoset_mute_midi_cc(ChannelObject *self, PyObject *args)
{
if (! PyArg_ParseTuple(args, "")) return NULL;
- channel_autoset_midi_cc(self->channel);
+ channel_autoset_mute_midi_cc(self->channel);
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static PyObject*
+Channel_autoset_solo_midi_cc(ChannelObject *self, PyObject *args)
+{
+ if (! PyArg_ParseTuple(args, "")) return NULL;
+ channel_autoset_solo_midi_cc(self->channel);
Py_INCREF(Py_None);
return Py_None;
}
static PyMethodDef channel_methods[] = {
{"remove", (PyCFunction)Channel_remove, METH_VARARGS, "Remove"},
- {"autoset_midi_cc", (PyCFunction)Channel_autoset_midi_cc, METH_VARARGS, "Autoset MIDI CC"},
+ {"autoset_volume_midi_cc",
+ (PyCFunction)Channel_autoset_volume_midi_cc, METH_VARARGS, "Autoset Volume MIDI CC"},
+ {"autoset_balance_midi_cc",
+ (PyCFunction)Channel_autoset_balance_midi_cc, METH_VARARGS, "Autoset Balance MIDI CC"},
+ {"autoset_mute_midi_cc",
+ (PyCFunction)Channel_autoset_mute_midi_cc, METH_VARARGS, "Autoset Mute MIDI CC"},
+ {"autoset_solo_midi_cc",
+ (PyCFunction)Channel_autoset_solo_midi_cc, METH_VARARGS, "Autoset Solo MIDI CC"},
{NULL}
};
return result;
}
+static PyObject*
+OutputChannel_set_in_prefader(OutputChannelObject *self, PyObject *args)
+{
+ PyObject *channel;
+ unsigned char prefader;
+
+ if (! PyArg_ParseTuple(args, "Ob", &channel, &prefader)) return NULL;
+
+ output_channel_set_in_prefader(self->output_channel,
+ ((ChannelObject*)channel)->channel,
+ prefader);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static PyObject*
+OutputChannel_is_in_prefader(OutputChannelObject *self, PyObject *args)
+{
+ PyObject *channel;
+ PyObject *result;
+
+ if (! PyArg_ParseTuple(args, "O", &channel)) return NULL;
+
+ if (output_channel_is_in_prefader(self->output_channel,
+ ((ChannelObject*)channel)->channel)) {
+ result = Py_True;
+ } else {
+ result = Py_False;
+ }
+
+ Py_INCREF(result);
+ return result;
+}
+
static PyMethodDef output_channel_methods[] = {
{"remove", (PyCFunction)OutputChannel_remove, METH_VARARGS, "Remove"},
{"set_solo", (PyCFunction)OutputChannel_set_solo, METH_VARARGS, "Set a channel as solo"},
{"set_muted", (PyCFunction)OutputChannel_set_muted, METH_VARARGS, "Set a channel as muted"},
{"is_solo", (PyCFunction)OutputChannel_is_solo, METH_VARARGS, "Is a channel set as solo"},
{"is_muted", (PyCFunction)OutputChannel_is_muted, METH_VARARGS, "Is a channel set as muted"},
+ {"set_in_prefader", (PyCFunction)OutputChannel_set_in_prefader, METH_VARARGS, "Set a channel as prefader"},
+ {"is_in_prefader", (PyCFunction)OutputChannel_is_in_prefader, METH_VARARGS, "Is a channel set as prefader"},
{NULL}
};
return -1;
}
+static PyObject*
+Mixer_get_midi_behavior_mode(MixerObject *self, void *closure)
+{
+ return PyLong_FromLong(get_midi_behavior_mode(self->mixer));
+}
+
+static int
+Mixer_set_midi_behavior_mode(MixerObject *self, PyObject *value, void *closure)
+{
+ int mode;
+ unsigned int result;
+
+ mode = PyLong_AsLong(value);
+ result = set_midi_behavior_mode(self->mixer, mode);
+ if (result == 0) {
+ return 0;
+ }
+ return -1;
+}
+
+
+
static PyGetSetDef Mixer_getseters[] = {
{"channels_count", (getter)Mixer_get_channels_count, NULL,
"channels count", NULL},
{"last_midi_channel", (getter)Mixer_get_last_midi_channel, (setter)Mixer_set_last_midi_channel,
"last midi channel", NULL},
+ {"midi_behavior_mode", (getter)Mixer_get_midi_behavior_mode, (setter)Mixer_set_midi_behavior_mode,
+ "midi behavior mode", NULL},
{NULL}
};