self.channel.balance_midi_cc = self.future_balance_midi_cc
if self.future_mute_midi_cc != None:
self.channel.mute_midi_cc = self.future_mute_midi_cc
- self.channel.midi_scale = self.slider_scale.scale
+ if self.app._init_solo_channels and self.channel_name in self.app._init_solo_channels:
+ self.channel.solo = True
+
self.channel.midi_scale = self.slider_scale.scale
self.on_volume_changed(self.slider_adjustment)
# self.label_stereo.set_size_request(0, -1)
# self.vbox.pack_start(self.label_stereo, True)
+ self.hbox_mutesolo = gtk.HBox()
+
self.mute = gtk.ToggleButton()
self.mute.set_label("M")
self.mute.set_active(self.channel.out_mute)
self.mute.connect("toggled", self.on_mute_toggled)
- self.vbox.pack_start(self.mute, True)
+ self.hbox_mutesolo.pack_start(self.mute, True)
+
+ self.solo = gtk.ToggleButton()
+ self.solo.set_label("S")
+ self.solo.set_active(self.channel.solo)
+ self.solo.connect("toggled", self.on_solo_toggled)
+ self.hbox_mutesolo.pack_start(self.solo, True)
+
+ self.vbox.pack_start(self.hbox_mutesolo, False)
frame = gtk.Frame()
frame.set_shadow_type(gtk.SHADOW_IN)
jack_client_t * jack_client;
GSList *input_channels_list;
GSList *output_channels_list;
+ GSList *soloed_channels;
jack_port_t * port_midi_in;
jack_port_t * port_midi_out;
return channel_ptr->out_mute;
}
+void
+channel_solo(
+ jack_mixer_channel_t channel)
+{
+ if (g_slist_find(channel_ptr->mixer_ptr->soloed_channels, channel) != NULL)
+ return;
+ channel_ptr->mixer_ptr->soloed_channels = g_slist_prepend(channel_ptr->mixer_ptr->soloed_channels, channel);
+}
+
+void
+channel_unsolo(
+ jack_mixer_channel_t channel)
+{
+ if (g_slist_find(channel_ptr->mixer_ptr->soloed_channels, channel) == NULL)
+ return;
+ channel_ptr->mixer_ptr->soloed_channels = g_slist_remove(channel_ptr->mixer_ptr->soloed_channels, channel);
+}
+
+bool
+channel_is_soloed(
+ jack_mixer_channel_t channel)
+{
+ if (g_slist_find(channel_ptr->mixer_ptr->soloed_channels, channel))
+ return true;
+ return false;
+}
+
void
channel_set_midi_scale(
jack_mixer_channel_t channel,
continue;
}
- if (output_mix_channel->soloed_channels &&
- g_slist_find(output_mix_channel->soloed_channels, channel_ptr) == NULL) {
- /* skip channels that are not soloed, when some are */
- continue;
- }
-
- for (i = start ; i < end ; i++)
- {
- if (! output_mix_channel->prefader) {
- frame_left = channel_ptr->frames_left[i-start];
- } else {
- frame_left = channel_ptr->prefader_frames_left[i-start];
- }
- if (frame_left == NAN)
- break;
- mix_channel->tmp_mixed_frames_left[i] += frame_left;
+ if ((!channel_ptr->mixer_ptr->soloed_channels && !output_mix_channel->soloed_channels) ||
+ (channel_ptr->mixer_ptr->soloed_channels &&
+ g_slist_find(channel_ptr->mixer_ptr->soloed_channels, channel_ptr) != NULL) ||
+ (output_mix_channel->soloed_channels &&
+ g_slist_find(output_mix_channel->soloed_channels, channel_ptr) != NULL)) {
- if (mix_channel->stereo)
+ for (i = start ; i < end ; i++)
{
if (! output_mix_channel->prefader) {
- frame_right = channel_ptr->frames_right[i-start];
+ frame_left = channel_ptr->frames_left[i-start];
} else {
- frame_right = channel_ptr->prefader_frames_right[i-start];
+ frame_left = channel_ptr->prefader_frames_left[i-start];
}
- if (frame_right == NAN)
+ if (frame_left == NAN)
break;
-
- mix_channel->tmp_mixed_frames_right[i] += frame_right;
+ mix_channel->tmp_mixed_frames_left[i] += frame_left;
+ if (mix_channel->stereo)
+ {
+ if (! output_mix_channel->prefader) {
+ frame_right = channel_ptr->frames_right[i-start];
+ } else {
+ frame_right = channel_ptr->prefader_frames_right[i-start];
+ }
+ if (frame_right == NAN)
+ break;
+ mix_channel->tmp_mixed_frames_right[i] += frame_right;
+ }
}
-
}
-
}
-
/* process main mix channel */
unsigned int steps = mix_channel->num_volume_transition_steps;
for (i = start ; i < end ; i++)
mixer_ptr->input_channels_list = NULL;
mixer_ptr->output_channels_list = NULL;
+ mixer_ptr->soloed_channels = NULL;
+
mixer_ptr->last_midi_channel = -1;
for (i = 0 ; i < 128 ; i++)
channel_is_out_muted(
jack_mixer_channel_t channel);
+void
+channel_solo(
+ jack_mixer_channel_t channel);
+
+void
+channel_unsolo(
+ jack_mixer_channel_t channel);
+
+bool
+channel_is_soloed(
+ jack_mixer_channel_t channel);
+
void
channel_rename(
jack_mixer_channel_t channel,
# name of settngs file that is currently open
current_filename = None
+ _init_solo_channels = None
+
def __init__(self, name, lash_client):
self.mixer = jack_mixer_c.Mixer(name)
if not self.mixer:
s.unserialize(self, b)
for channel in self.unserialized_channels:
if isinstance(channel, InputChannel):
+ print self._init_solo_channels, hasattr(channel, 'name'), channel.channel_name
+ if self._init_solo_channels and channel.channel_name in self._init_solo_channels:
+ channel.solo = True
+ print channel.channel_name, 'solo ', channel.solo
self.add_channel_precreated(channel)
+ self._init_solo_channels = None
for channel in self.unserialized_channels:
if isinstance(channel, OutputChannel):
self.add_output_channel_precreated(channel)
def serialize(self, object_backend):
object_backend.add_property('geometry',
'%sx%s' % (self.window.allocation.width, self.window.allocation.height))
+ solo_channels = []
+ for input_channel in self.channels:
+ if input_channel.channel.solo:
+ solo_channels.append(input_channel)
+ if solo_channels:
+ object_backend.add_property('solo_channels', '|'.join([x.channel.name for x in solo_channels]))
def unserialize_property(self, name, value):
if name == 'geometry':
width, height = value.split('x')
self.window.resize(int(width), int(height))
return True
+ if name == 'solo_channels':
+ self._init_solo_channels = value.split('|')
+ return True
def unserialize_child(self, name):
if name == InputChannel.serialization_name():
return 0;
}
+static PyObject*
+Channel_get_solo(ChannelObject *self, void *closure)
+{
+ printf ("get_solo\n");
+ PyObject *result;
+
+ if (channel_is_soloed(self->channel)) {
+ result = Py_True;
+ } else {
+ result = Py_False;
+ }
+ Py_INCREF(result);
+ return result;
+}
+
+static int
+Channel_set_solo(ChannelObject *self, PyObject *value, void *closure)
+{
+ if (value == Py_True) {
+ channel_solo(self->channel);
+ } else {
+ channel_unsolo(self->channel);
+ }
+ return 0;
+}
+
static PyObject*
Channel_get_meter(ChannelObject *self, void *closure)
{
return result;
}
-
static PyGetSetDef Channel_getseters[] = {
{"is_stereo",
(getter)Channel_get_is_stereo, NULL,
{"out_mute",
(getter)Channel_get_out_mute, (setter)Channel_set_out_mute,
"out_mute", NULL},
+ {"solo",
+ (getter)Channel_get_solo, (setter)Channel_set_solo,
+ "solo", NULL},
{"meter",
(getter)Channel_get_meter, NULL,
"meter", NULL},