mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 23:05:04 +01:00
Add selectionPropertiesBox disposition for routes|regions|clips
This commit is contained in:
parent
ae56743b7d
commit
f4c70d2903
4 changed files with 50 additions and 31 deletions
|
|
@ -1740,10 +1740,8 @@ Editor::region_selection_changed ()
|
||||||
_pianoroll->contents().show_all ();
|
_pianoroll->contents().show_all ();
|
||||||
_properties_box->show ();
|
_properties_box->show ();
|
||||||
} else {
|
} else {
|
||||||
if (!selection->regions.empty()) {
|
_bottom_hbox.pack_start(*_properties_box, true, true);
|
||||||
_bottom_hbox.pack_start(*_properties_box, true, true);
|
_properties_box->show ();
|
||||||
_properties_box->show ();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -189,7 +189,7 @@ RoutePropertiesBox::refill_processors ()
|
||||||
float ui_scale = std::max<float> (1.f, UIConfiguration::instance().get_ui_scale());
|
float ui_scale = std::max<float> (1.f, UIConfiguration::instance().get_ui_scale());
|
||||||
int h = 100 * ui_scale;
|
int h = 100 * ui_scale;
|
||||||
for (auto const& ui : _proc_uis) {
|
for (auto const& ui : _proc_uis) {
|
||||||
h = std::max<int> (h, ui->get_preferred_height () + /* frame label */ 30 * ui_scale);
|
h = std::max<int> (h, ui->get_preferred_height () + /* frame label */ 34 * ui_scale);
|
||||||
}
|
}
|
||||||
h = std::min<int> (h, 300 * ui_scale);
|
h = std::min<int> (h, 300 * ui_scale);
|
||||||
_box.set_size_request (-1, h);
|
_box.set_size_request (-1, h);
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@
|
||||||
#include "gtkmm2ext/gui_thread.h"
|
#include "gtkmm2ext/gui_thread.h"
|
||||||
#include "gtkmm2ext/utils.h"
|
#include "gtkmm2ext/utils.h"
|
||||||
|
|
||||||
|
#include "ardour/profile.h"
|
||||||
#include "ardour/session.h"
|
#include "ardour/session.h"
|
||||||
|
|
||||||
#include "audio_region_editor.h"
|
#include "audio_region_editor.h"
|
||||||
|
|
@ -45,9 +46,10 @@ using namespace ARDOUR;
|
||||||
using std::min;
|
using std::min;
|
||||||
using std::max;
|
using std::max;
|
||||||
|
|
||||||
SelectionPropertiesBox::SelectionPropertiesBox ()
|
SelectionPropertiesBox::SelectionPropertiesBox (DispositionMask mask)
|
||||||
: _region_editor (nullptr)
|
: _region_editor (nullptr)
|
||||||
, _region_fx_box (nullptr)
|
, _region_fx_box (nullptr)
|
||||||
|
, _disposition (mask)
|
||||||
{
|
{
|
||||||
init ();
|
init ();
|
||||||
|
|
||||||
|
|
@ -62,6 +64,7 @@ SelectionPropertiesBox::SelectionPropertiesBox ()
|
||||||
|
|
||||||
_time_info_box->set_no_show_all ();
|
_time_info_box->set_no_show_all ();
|
||||||
_route_prop_box->set_no_show_all ();
|
_route_prop_box->set_no_show_all ();
|
||||||
|
_slot_prop_box->set_no_show_all ();
|
||||||
_region_editor_box.set_no_show_all ();
|
_region_editor_box.set_no_show_all ();
|
||||||
_region_editor_box.set_spacing (4);
|
_region_editor_box.set_spacing (4);
|
||||||
|
|
||||||
|
|
@ -142,20 +145,15 @@ SelectionPropertiesBox::selection_changed ()
|
||||||
if (!_session || _session->inital_connect_or_deletion_in_progress ()) {
|
if (!_session || _session->inital_connect_or_deletion_in_progress ()) {
|
||||||
_time_info_box->hide ();
|
_time_info_box->hide ();
|
||||||
_route_prop_box->hide ();
|
_route_prop_box->hide ();
|
||||||
|
_slot_prop_box->hide ();
|
||||||
delete_region_editor ();
|
delete_region_editor ();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Selection& selection (Editor::instance().get_selection());
|
Selection& selection (Editor::instance().get_selection());
|
||||||
|
|
||||||
if (!selection.time.empty ()) {
|
|
||||||
_time_info_box->show ();
|
|
||||||
} else {
|
|
||||||
_time_info_box->hide ();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool show_slot_properties = false;
|
bool show_slot_properties = false;
|
||||||
if (!selection.triggers.empty ()) {
|
if (!selection.triggers.empty () && 0 != (_disposition & ShowTriggers)) {
|
||||||
TriggerSelection ts = selection.triggers;
|
TriggerSelection ts = selection.triggers;
|
||||||
TriggerEntry* entry = *ts.begin ();
|
TriggerEntry* entry = *ts.begin ();
|
||||||
TriggerReference ref = entry->trigger_reference ();
|
TriggerReference ref = entry->trigger_reference ();
|
||||||
|
|
@ -163,14 +161,9 @@ SelectionPropertiesBox::selection_changed ()
|
||||||
_slot_prop_box->set_slot(ref);
|
_slot_prop_box->set_slot(ref);
|
||||||
show_slot_properties = true;
|
show_slot_properties = true;
|
||||||
}
|
}
|
||||||
if (show_slot_properties) {
|
|
||||||
_slot_prop_box->show();
|
|
||||||
} else {
|
|
||||||
_slot_prop_box->hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool show_route_properties = false;
|
bool show_route_properties = ARDOUR::Profile->get_mixbus(); // XXX
|
||||||
if (!selection.tracks.empty ()) {
|
if (!selection.tracks.empty () && 0 != (_disposition & ShowRoutes)) {
|
||||||
TimeAxisView *tav = selection.tracks.back (); //the LAST selected stripable is the clicked one. see selection.cc line ~92
|
TimeAxisView *tav = selection.tracks.back (); //the LAST selected stripable is the clicked one. see selection.cc line ~92
|
||||||
RouteTimeAxisView *rtav = dynamic_cast<RouteTimeAxisView *>(tav);
|
RouteTimeAxisView *rtav = dynamic_cast<RouteTimeAxisView *>(tav);
|
||||||
if (rtav) {
|
if (rtav) {
|
||||||
|
|
@ -178,13 +171,8 @@ SelectionPropertiesBox::selection_changed ()
|
||||||
show_route_properties = true;
|
show_route_properties = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (show_route_properties) {
|
|
||||||
_route_prop_box->show();
|
|
||||||
} else {
|
|
||||||
_route_prop_box->hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (selection.regions.size () == 1) {
|
if (selection.regions.size () == 1 && 0 != (_disposition & ShowRegions)) {
|
||||||
RegionView* rv = (selection.regions.front ());
|
RegionView* rv = (selection.regions.front ());
|
||||||
if (!_region_editor || _region_editor->region () != rv->region ()) {
|
if (!_region_editor || _region_editor->region () != rv->region ()) {
|
||||||
delete_region_editor ();
|
delete_region_editor ();
|
||||||
|
|
@ -203,14 +191,38 @@ SelectionPropertiesBox::selection_changed ()
|
||||||
|
|
||||||
_region_fx_box = new RegionFxPropertiesBox (rv->region ());
|
_region_fx_box = new RegionFxPropertiesBox (rv->region ());
|
||||||
_region_editor_box.pack_start (*_region_fx_box);
|
_region_editor_box.pack_start (*_region_fx_box);
|
||||||
_region_editor_box.show ();
|
|
||||||
rv->RegionViewGoingAway.connect_same_thread (_region_connection, std::bind (&SelectionPropertiesBox::delete_region_editor, this));
|
rv->RegionViewGoingAway.connect_same_thread (_region_connection, std::bind (&SelectionPropertiesBox::delete_region_editor, this));
|
||||||
}
|
}
|
||||||
_region_editor_box.show ();
|
|
||||||
} else {
|
} else {
|
||||||
/* only hide region props when selecting a track or trigger ..*/
|
/* only hide region props when selecting a track or trigger,
|
||||||
if (_route_prop_box->get_visible () || !selection.markers.empty () || !selection.playlists.empty () || !selection.triggers.empty ()) {
|
* but retain existing RegionEditor, when selecting another additional region.
|
||||||
|
*/
|
||||||
|
if (selection.regions.empty () || !selection.markers.empty () || !selection.playlists.empty () || !selection.triggers.empty ()) {
|
||||||
delete_region_editor ();
|
delete_region_editor ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (show_slot_properties) {
|
||||||
|
_slot_prop_box->show ();
|
||||||
|
_route_prop_box->hide ();
|
||||||
|
delete_region_editor ();
|
||||||
|
} else if (_region_editor) {
|
||||||
|
_slot_prop_box->hide ();
|
||||||
|
_route_prop_box->hide ();
|
||||||
|
_region_editor_box.show ();
|
||||||
|
} else if (show_route_properties) {
|
||||||
|
_slot_prop_box->hide ();
|
||||||
|
_route_prop_box->show ();
|
||||||
|
delete_region_editor ();
|
||||||
|
} else {
|
||||||
|
_slot_prop_box->hide ();
|
||||||
|
_route_prop_box->hide ();
|
||||||
|
delete_region_editor ();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!selection.time.empty () && 0 != (_disposition & ShowTimeInfo)) {
|
||||||
|
_time_info_box->show ();
|
||||||
|
} else {
|
||||||
|
_time_info_box->hide ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,14 @@ class SlotPropertiesBox;
|
||||||
class SelectionPropertiesBox : public Gtk::HBox, public ARDOUR::SessionHandlePtr
|
class SelectionPropertiesBox : public Gtk::HBox, public ARDOUR::SessionHandlePtr
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SelectionPropertiesBox ();
|
enum DispositionMask {
|
||||||
|
ShowRoutes = 0x01,
|
||||||
|
ShowRegions = 0x02,
|
||||||
|
ShowTriggers = 0x04,
|
||||||
|
ShowTimeInfo = 0x08,
|
||||||
|
};
|
||||||
|
|
||||||
|
SelectionPropertiesBox (DispositionMask dm = DispositionMask(0x07));
|
||||||
~SelectionPropertiesBox ();
|
~SelectionPropertiesBox ();
|
||||||
|
|
||||||
void set_session (ARDOUR::Session*);
|
void set_session (ARDOUR::Session*);
|
||||||
|
|
@ -58,6 +65,8 @@ private:
|
||||||
RegionEditor* _region_editor;
|
RegionEditor* _region_editor;
|
||||||
RegionFxPropertiesBox* _region_fx_box;
|
RegionFxPropertiesBox* _region_fx_box;
|
||||||
|
|
||||||
|
DispositionMask _disposition;
|
||||||
|
|
||||||
PBD::ScopedConnection _region_connection;
|
PBD::ScopedConnection _region_connection;
|
||||||
PBD::ScopedConnection _editor_connection;
|
PBD::ScopedConnection _editor_connection;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue