solo.set_label("S")
solo.connect("toggled", self.on_solo_toggled)
self.solo = solo
+ pre = Gtk.ToggleButton("Pre")
+ pre.connect("toggled", self.on_prefader_toggled)
+ self.buttons_box.pack_start(pre, True, True, button_padding)
+ self.buttons_box.pack_start(mute, True, True, button_padding)
if self.output_channel.display_solo_buttons:
- self.buttons_box.pack_end(solo, True, True, button_padding)
- self.buttons_box.pack_end(mute, True, True, button_padding)
+ self.buttons_box.pack_start(solo, True, True, button_padding)
def update(self):
if self.output_channel.display_solo_buttons:
if not self.solo in self.buttons_box.get_children():
- self.buttons_box.pack_end(self.solo, True, True, button_padding)
- self.buttons_box.reorder_child(self.mute, -1)
+ self.buttons_box.pack_start(self.solo, True, True, button_padding)
self.solo.show()
else:
- if self.solo in self.hbox.get_children():
- self.hbox.remove(self.solo)
+ if self.solo in self.buttons_box.get_children():
+ self.buttons_box.remove(self.solo)
self.label.set_text(self.output_channel.channel.name)
set_background_color(self.vbox, self.output_channel.css_name, self.output_channel.color.to_string())
def on_solo_toggled(self, button):
self.output_channel.channel.set_solo(self.input_channel.channel, button.get_active())
self.app.update_monitor(self)
+
+ def on_prefader_toggled(self, button):
+ self.output_channel.channel.set_prefader(self.input_channel.channel, button.get_active() == 1)
struct channel channel;
GSList *soloed_channels;
GSList *muted_channels;
+ GSList *prefader_channels;
+
bool system; /* system channel, without any associated UI */
bool prefader;
};
for (i = start ; i < end ; i++)
{
- if (! output_mix_channel->prefader) {
+ if (! output_mix_channel->prefader &&
+ g_slist_find(output_mix_channel->prefader_channels, channel_ptr) == NULL) {
frame_left = channel_ptr->frames_left[i-start];
} else {
frame_left = channel_ptr->prefader_frames_left[i-start];
mix_channel->tmp_mixed_frames_left[i] += frame_left;
if (mix_channel->stereo)
{
- if (! output_mix_channel->prefader) {
+ if (! output_mix_channel->prefader &&
+ g_slist_find(output_mix_channel->prefader_channels, channel_ptr) == NULL) {
frame_right = channel_ptr->frames_right[i-start];
} else {
frame_right = channel_ptr->prefader_frames_right[i-start];
output_channel_ptr->soloed_channels = NULL;
output_channel_ptr->muted_channels = NULL;
+ output_channel_ptr->prefader_channels = NULL;
output_channel_ptr->system = system;
output_channel_ptr->prefader = false;
g_slist_free(output_channel_ptr->soloed_channels);
g_slist_free(output_channel_ptr->muted_channels);
+ g_slist_free(output_channel_ptr->prefader_channels);
free(channel_ptr->tmp_mixed_frames_left);
free(channel_ptr->tmp_mixed_frames_right);
struct output_channel *output_channel_ptr = output_channel;
return output_channel_ptr->prefader;
}
+
+void
+output_channel_set_in_prefader(
+ jack_mixer_output_channel_t output_channel,
+ jack_mixer_channel_t channel,
+ bool prefader_value)
+{
+ struct output_channel *output_channel_ptr = output_channel;
+
+ if (prefader_value) {
+ if (g_slist_find(output_channel_ptr->prefader_channels, channel) != NULL)
+ return;
+ output_channel_ptr->prefader_channels = g_slist_prepend(output_channel_ptr->prefader_channels, channel);
+ } else {
+ if (g_slist_find(output_channel_ptr->prefader_channels, channel) == NULL)
+ return;
+ output_channel_ptr->prefader_channels = g_slist_remove(output_channel_ptr->prefader_channels, channel);
+ }
+}
output_channel_is_prefader(
jack_mixer_output_channel_t output_channel);
+void output_channel_set_in_prefader(jack_mixer_output_channel_t output_channel,
+ jack_mixer_channel_t input_channel,
+ bool prefader_value);
+
#endif /* #ifndef JACK_MIXER_H__DAEB51D8_5861_40F2_92E4_24CA495A384D__INCLUDED */
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 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_prefader", (PyCFunction)OutputChannel_set_in_prefader, METH_VARARGS, "Set a channel as prefader"},
{NULL}
};