, panners (sess)
, button_table (3, 1)
, solo_led_table (2, 2)
+ , top_button_table (1, 2)
, middle_button_table (1, 2)
, bottom_button_table (1, 2)
, meter_point_label (_("pre"))
input_selector = 0;
output_selector = 0;
group_menu = 0;
- _marked_for_display = false;
route_ops_menu = 0;
ignore_comment_edit = false;
ignore_toggle = false;
mute_button->set_name ("MixerMuteButton");
solo_button->set_name ("MixerSoloButton");
+ monitor_input_button->set_name ("MixerMonitorInputButton");
+ monitor_disk_button->set_name ("MixerMonitorInputButton");
+
solo_isolated_led = manage (new LED);
solo_isolated_led->show ();
solo_isolated_led->set_diameter (6);
solo_led_table.attach (*solo_isolated_led, 1, 2, 0, 1, Gtk::FILL, Gtk::FILL);
solo_led_table.attach (*_safe_label, 0, 1, 1, 2, Gtk::FILL, Gtk::FILL);
solo_led_table.attach (*solo_safe_led, 1, 2, 1, 2, Gtk::FILL, Gtk::FILL);
-
solo_led_table.show ();
+
+ top_button_table.set_homogeneous (true);
+ top_button_table.set_spacings (0);
+ top_button_table.attach (*monitor_input_button, 0, 1, 0, 1);
+ top_button_table.attach (*monitor_disk_button, 1, 2, 0, 1);
+ top_button_table.show ();
+
below_panner_box.set_border_width (2);
below_panner_box.set_spacing (2);
below_panner_box.pack_end (solo_led_table, false, false);
global_vpacker.pack_start (button_table, Gtk::PACK_SHRINK);
global_vpacker.pack_start (processor_box, true, true);
global_vpacker.pack_start (panners, Gtk::PACK_SHRINK);
+ global_vpacker.pack_start (top_button_table, Gtk::PACK_SHRINK);
global_vpacker.pack_start (below_panner_box, Gtk::PACK_SHRINK);
global_vpacker.pack_start (middle_button_table, Gtk::PACK_SHRINK);
global_vpacker.pack_start (gpm, Gtk::PACK_SHRINK);
SwitchIO.connect (sigc::mem_fun (*this, &MixerStrip::switch_io));
AudioEngine::instance()->PortConnectedOrDisconnected.connect (
- *this, invalidator (*this), boost::bind (&MixerStrip::port_connected_or_disconnected, this, _1, _2), gui_context ()
+ *this, invalidator (*this), boost::bind (&MixerStrip::port_connected_or_disconnected, this, _1, _3), gui_context ()
);
}
revert_to_default_display ();
- if (set_color_from_route()) {
- set_color (unique_random_color());
- }
-
if (route()->is_master()) {
solo_button->hide ();
below_panner_box.hide ();
global_vpacker.pack_start (*spacer, false, false);
}
+ if (is_track()) {
+ monitor_input_button->show ();
+ monitor_disk_button->show ();
+ } else {
+ monitor_input_button->hide();
+ monitor_disk_button->hide ();
+ }
+
if (is_midi_track()) {
if (midi_input_enable_button == 0) {
Image* img = manage (new Image (get_icon (X_("midi_socket_small"))));
midi_input_enable_button = manage (new StatefulToggleButton);
midi_input_enable_button->set_name ("MixerMidiInputEnableButton");
midi_input_enable_button->set_image (*img);
- midi_input_enable_button->signal_toggled().connect (sigc::mem_fun (*this, &MixerStrip::midi_input_toggled));
+ midi_input_enable_button->signal_button_press_event().connect (sigc::mem_fun (*this, &MixerStrip::input_active_button_press), false);
+ midi_input_enable_button->signal_button_release_event().connect (sigc::mem_fun (*this, &MixerStrip::input_active_button_release), false);
ARDOUR_UI::instance()->set_tip (midi_input_enable_button, _("Enable/Disable MIDI input"));
} else {
input_button_box.remove (*midi_input_enable_button);
_route->meter_change.connect (route_connections, invalidator (*this), bind (&MixerStrip::meter_changed, this), gui_context());
_route->route_group_changed.connect (route_connections, invalidator (*this), boost::bind (&MixerStrip::route_group_changed, this), gui_context());
- if (_route->panner()) {
+ if (_route->panner_shell()) {
_route->panner_shell()->Changed.connect (route_connections, invalidator (*this), boost::bind (&MixerStrip::connect_to_pan, this), gui_context());
}
}
_route->comment_changed.connect (route_connections, invalidator (*this), ui_bind (&MixerStrip::comment_changed, this, _1), gui_context());
- _route->gui_changed.connect (route_connections, invalidator (*this), ui_bind (&MixerStrip::route_gui_changed, this, _1, _2), gui_context());
set_stuff_from_route ();
void
MixerStrip::set_stuff_from_route ()
{
- XMLProperty *prop;
-
- ensure_xml_node ();
-
/* if width is not set, it will be set by the MixerUI or editor */
- if ((prop = xml_node->property ("strip-width")) != 0) {
- set_width_enum (Width (string_2_enum (prop->value(), _width)), this);
- }
-
- if ((prop = xml_node->property ("shown-mixer")) != 0) {
- if (prop->value() == "no") {
- _marked_for_display = false;
- } else {
- _marked_for_display = true;
- }
- } else {
- /* backwards compatibility */
- _marked_for_display = true;
+ string str = gui_property ("strip-width");
+ if (!str.empty()) {
+ set_width_enum (Width (string_2_enum (str, _width)), this);
}
}
_width_owner = owner;
- ensure_xml_node ();
-
_width = w;
if (_width_owner == this) {
- xml_node->add_property ("strip-width", enum_2_string (_width));
+ set_gui_property ("strip-width", enum_2_string (_width));
}
set_button_names ();
{
_packed = yn;
- ensure_xml_node ();
-
if (_packed) {
- xml_node->add_property ("shown-mixer", "yes");
+ set_gui_property ("visible", true);
} else {
- xml_node->add_property ("shown-mixer", "no");
+ set_gui_property ("visible", false);
}
}
input_selector->hide_all ();
}
- show_route_color ();
+ route_color_changed ();
} else {
}
}
-
void
-MixerStrip::route_gui_changed (string what_changed, void*)
-{
- ENSURE_GUI_THREAD (*this, &MixerStrip::route_gui_changed, what_changed, ignored)
-
- if (what_changed == "color") {
- if (set_color_from_route () == 0) {
- show_route_color ();
- }
- }
-}
-
-void
-MixerStrip::show_route_color ()
+MixerStrip::route_color_changed ()
{
name_button.modify_bg (STATE_NORMAL, color());
top_event_box.modify_bg (STATE_NORMAL, color());
rec_enable_button->set_sensitive (true);
solo_isolated_led->set_sensitive (true);
solo_safe_led->set_sensitive (true);
+ monitor_input_button->set_sensitive (true);
+ monitor_disk_button->set_sensitive (true);
}
void
rec_enable_button->set_sensitive (false);
solo_isolated_led->set_sensitive (false);
solo_safe_led->set_sensitive (false);
+ monitor_input_button->set_sensitive (false);
+ monitor_disk_button->set_sensitive (false);
if (boost::dynamic_pointer_cast<InternalSend>(send)) {
output_button.set_sensitive (false);
case Wide:
rec_enable_button_label.set_text (_("Rec"));
mute_button_label.set_text (_("Mute"));
+ monitor_input_button_label.set_text (_("In"));
+ monitor_disk_button_label.set_text (_("Disk"));
if (_route && _route->solo_safe()) {
solo_button_label.set_text (X_("!"));
} else {
default:
rec_enable_button_label.set_text (_("R"));
mute_button_label.set_text (_("M"));
+ monitor_input_button_label.set_text (_("I"));
+ monitor_disk_button_label.set_text (_("D"));
if (_route && _route->solo_safe()) {
solo_button_label.set_text (X_("!"));
if (!Config->get_solo_control_is_listen_control()) {
processor_box.hide_things ();
}
-void
-MixerStrip::midi_input_toggled ()
+bool
+MixerStrip::input_active_button_press (GdkEventButton*)
+{
+ /* nothing happens on press */
+ return true;
+}
+
+bool
+MixerStrip::input_active_button_release (GdkEventButton* ev)
{
boost::shared_ptr<MidiTrack> mt = midi_track ();
if (!mt) {
- return;
+ return true;
+ }
+
+ if (mt->input_active()) {
+ if (Keyboard::modifier_state_contains (ev->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier|Keyboard::SecondaryModifier))) {
+ /* turn all other tracks using this input off */
+ _session->set_exclusive_input_active (mt, false);
+ } else {
+ mt->set_input_active (false);
+ }
+
+ } else {
+ if (Keyboard::modifier_state_contains (ev->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier|Keyboard::SecondaryModifier))) {
+ /* turn all other tracks using this input on */
+ _session->set_exclusive_input_active (mt, true);
+ } else {
+ mt->set_input_active (true);
+ }
}
- mt->set_input_active (midi_input_enable_button->get_active());
+ return true;
}
void
midi_input_enable_button->set_active (mt->input_active ());
}
}
+
+string
+MixerStrip::state_id () const
+{
+ return string_compose ("strip %1", _route->id().to_s());
+}