an initial guess at using the new region-edit-disposition parameter

No editing of the parameter yet
This commit is contained in:
Paul Davis 2025-08-18 18:26:10 -06:00
parent 1817aa5c2d
commit 368189c4f6
3 changed files with 55 additions and 16 deletions

View file

@ -232,6 +232,7 @@ public:
bool extend_selection_to_track (TimeAxisView&); bool extend_selection_to_track (TimeAxisView&);
void edit_region_in_pianoroll_window (); void edit_region_in_pianoroll_window ();
void maybe_edit_region_in_bottom_pane (RegionView&);
void play_selection (); void play_selection ();
void maybe_locate_with_edit_preroll (samplepos_t); void maybe_locate_with_edit_preroll (samplepos_t);

View file

@ -1912,9 +1912,30 @@ Editor::edit_region (RegionView* rv)
{ {
if (UIConfiguration::instance().get_use_double_click_to_zoom_to_selection()) { if (UIConfiguration::instance().get_use_double_click_to_zoom_to_selection()) {
temporal_zoom_selection (Both); temporal_zoom_selection (Both);
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 { } else {
rv->show_region_editor (); rv->show_region_editor ();
} }
break;
case Editing::NeverBottomPane:
rv->show_region_editor ();
break;
}
} }
void void

View file

@ -1716,10 +1716,30 @@ Editor::region_selection_changed ()
} }
update_selection_markers (); update_selection_markers ();
bool pack_pianoroll = false;
if (selection->regions.size () == 1) { if (selection->regions.size () == 1) {
RegionView* rv = (selection->regions.front ()); RegionView* rv = (selection->regions.front ());
MidiRegionView* mrv = dynamic_cast<MidiRegionView*> (rv); 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<MidiRegionView*> (&rv);
if (mrv) { if (mrv) {
std::shared_ptr<ARDOUR::MidiTrack> mt = std::dynamic_pointer_cast<ARDOUR::MidiTrack> (mrv->midi_view()->track()); std::shared_ptr<ARDOUR::MidiTrack> mt = std::dynamic_pointer_cast<ARDOUR::MidiTrack> (mrv->midi_view()->track());
std::shared_ptr<MidiRegion> mr = std::dynamic_pointer_cast<MidiRegion>(mrv->region()); std::shared_ptr<MidiRegion> mr = std::dynamic_pointer_cast<MidiRegion>(mrv->region());
@ -1729,18 +1749,15 @@ Editor::region_selection_changed ()
pack_pianoroll = true; pack_pianoroll = true;
} }
} }
}
Gtkmm2ext::container_clear (_bottom_hbox);
if (pack_pianoroll) { if (pack_pianoroll) {
_bottom_hbox.pack_start(*_properties_box, false, false); _bottom_hbox.pack_start (*_properties_box, false, false);
_bottom_hbox.pack_start(_pianoroll->contents(), true, true); _bottom_hbox.pack_start (_pianoroll->contents(), true, true);
_pianoroll->contents().hide (); _pianoroll->contents().hide ();
_pianoroll->contents().show_all (); _pianoroll->contents().show_all ();
_properties_box->show (); _properties_box->show ();
} else { } else {
_bottom_hbox.pack_start(*_properties_box, true, true); _bottom_hbox.pack_start (*_properties_box, true, true);
_properties_box->show (); _properties_box->show ();
} }
} }