diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index e4805dfae6..6f863820d0 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -232,6 +232,7 @@ public: bool extend_selection_to_track (TimeAxisView&); void edit_region_in_pianoroll_window (); + void maybe_edit_region_in_bottom_pane (RegionView&); void play_selection (); void maybe_locate_with_edit_preroll (samplepos_t); diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index 20f18edf99..f3aaddc348 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -1912,8 +1912,29 @@ Editor::edit_region (RegionView* rv) { if (UIConfiguration::instance().get_use_double_click_to_zoom_to_selection()) { temporal_zoom_selection (Both); - } else { + return; + } + + switch (UIConfiguration::instance().get_region_edit_disposition()) { + case Editing::BottomPaneOnly: + maybe_edit_region_in_bottom_pane (*rv); + break; + case Editing::OpenBottomPane: + if (!att_bottom_visible()) { + /* XXX do something */ + } + maybe_edit_region_in_bottom_pane (*rv); + break; + case Editing::PreferBottomPane: + if (att_bottom_visible()) { + maybe_edit_region_in_bottom_pane (*rv); + } else { + rv->show_region_editor (); + } + break; + case Editing::NeverBottomPane: rv->show_region_editor (); + break; } } diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc index 745b7c850b..9223e683d4 100644 --- a/gtk2_ardour/editor_selection.cc +++ b/gtk2_ardour/editor_selection.cc @@ -1716,31 +1716,48 @@ Editor::region_selection_changed () } update_selection_markers (); - bool pack_pianoroll = false; if (selection->regions.size () == 1) { RegionView* rv = (selection->regions.front ()); - MidiRegionView* mrv = dynamic_cast (rv); - if (mrv) { - std::shared_ptr mt = std::dynamic_pointer_cast (mrv->midi_view()->track()); - std::shared_ptr mr = std::dynamic_pointer_cast(mrv->region()); - if (mrv && mt && mr) { - _pianoroll->set_track (mt); - _pianoroll->set_region (mr); - pack_pianoroll = true; - } + assert (rv); + maybe_edit_region_in_bottom_pane (*rv); + } else { + Gtkmm2ext::container_clear (_bottom_hbox); + } +} + +void +Editor::maybe_edit_region_in_bottom_pane (RegionView& rv) +{ + Gtkmm2ext::container_clear (_bottom_hbox); + + if (UIConfiguration::instance().get_region_edit_disposition() == Editing::NeverBottomPane) { + /* Just the properties box. XXX does that make sense ? */ + _bottom_hbox.pack_start (*_properties_box, true, true); + _properties_box->show (); + return; + } + + bool pack_pianoroll = false; + MidiRegionView* mrv = dynamic_cast (&rv); + + if (mrv) { + std::shared_ptr mt = std::dynamic_pointer_cast (mrv->midi_view()->track()); + std::shared_ptr mr = std::dynamic_pointer_cast(mrv->region()); + if (mrv && mt && mr) { + _pianoroll->set_track (mt); + _pianoroll->set_region (mr); + pack_pianoroll = true; } } - Gtkmm2ext::container_clear (_bottom_hbox); - if (pack_pianoroll) { - _bottom_hbox.pack_start(*_properties_box, false, false); - _bottom_hbox.pack_start(_pianoroll->contents(), true, true); + _bottom_hbox.pack_start (*_properties_box, false, false); + _bottom_hbox.pack_start (_pianoroll->contents(), true, true); _pianoroll->contents().hide (); _pianoroll->contents().show_all (); _properties_box->show (); } else { - _bottom_hbox.pack_start(*_properties_box, true, true); + _bottom_hbox.pack_start (*_properties_box, true, true); _properties_box->show (); } }