diff --git a/gtk2_ardour/trigger_page.cc b/gtk2_ardour/trigger_page.cc index 237349d8ee..209910031b 100644 --- a/gtk2_ardour/trigger_page.cc +++ b/gtk2_ardour/trigger_page.cc @@ -280,6 +280,7 @@ TriggerPage::set_session (Session* s) _session->config.ParameterChanged.connect (_session_connections, invalidator (*this), boost::bind (&TriggerPage::parameter_changed, this, _1), gui_context ()); Editor::instance ().get_selection ().TriggersChanged.connect (sigc::mem_fun (*this, &TriggerPage::selection_changed)); + Trigger::TriggerArmChanged.connect (*this, invalidator (*this), boost::bind (&TriggerPage::rec_enable_changed, this, _1), gui_context()); initial_track_display (); @@ -382,6 +383,56 @@ TriggerPage::clear_selected_slot () trigger->set_region (std::shared_ptr()); } +void +TriggerPage::rec_enable_changed (Trigger const * trigger) +{ + /* hide everything */ + + _slot_prop_box.hide (); + _audio_trig_box.hide (); + _midi_trig_box.hide (); + _midi_editor->viewport().hide (); + + _parameter_box.hide (); + + TriggerBox& box = trigger->box(); + TriggerReference ref (trigger->boxptr(), trigger->index()); + + _slot_prop_box.set_slot (ref); + _slot_prop_box.show (); + + if (box.data_type () == DataType::AUDIO) { + if (trigger->the_region()) { + _audio_trig_box.set_trigger (ref); + _audio_trig_box.show (); + } + } else { + _midi_trig_box.set_trigger (ref); + _midi_trig_box.show (); + + _midi_editor->set_box (trigger->boxptr()); + + Stripable* st = dynamic_cast (box.owner()); + assert (st); + std::shared_ptr mt = std::dynamic_pointer_cast (st->shared_from_this()); + assert (mt); + _midi_editor->set_track (mt); + + if (trigger->the_region()) { + + std::shared_ptr mr = std::dynamic_pointer_cast (trigger->the_region()); + + if (mr) { + _midi_editor->set_region (mr); + } + } + + _midi_editor->viewport().show (); + } + + _parameter_box.show (); +} + void TriggerPage::selection_changed () { diff --git a/gtk2_ardour/trigger_page.h b/gtk2_ardour/trigger_page.h index 4eff24fc74..36e9632c76 100644 --- a/gtk2_ardour/trigger_page.h +++ b/gtk2_ardour/trigger_page.h @@ -96,6 +96,7 @@ private: AxisView* axis_view_by_control (std::shared_ptr) const; void selection_changed (); + void rec_enable_changed (ARDOUR::Trigger const *); PBD::ScopedConnectionList editor_connections; gint start_updating ();