From d2fb6c498ab52e85be5a3e264f1798f0ee4c23e3 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 22 Jan 2025 19:17:55 +0100 Subject: [PATCH] Show number of regionFX in sidebar --- gtk2_ardour/editor_regions.cc | 7 ++++--- gtk2_ardour/region_list_base.cc | 11 ++++++++++- gtk2_ardour/region_list_base.h | 23 +++++++++++++---------- 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/gtk2_ardour/editor_regions.cc b/gtk2_ardour/editor_regions.cc index bb182da51e..e35c225ab7 100644 --- a/gtk2_ardour/editor_regions.cc +++ b/gtk2_ardour/editor_regions.cc @@ -64,6 +64,7 @@ EditorRegions::init () { add_name_column (); setup_col (append_col (_columns.channels, "Chans "), 1, ALIGN_START, _("# Ch"), _("# Channels in the region")); + setup_col (append_col (_columns.regionfx, "Region Fx"), 2, ALIGN_START, _("# Fx"), _("# Region effects")); add_tag_column (); int cb_width = 24; @@ -75,9 +76,9 @@ EditorRegions::init () TreeViewColumn* tvc; tvc = append_col (_columns.start, bbt_width); - setup_col (tvc, 16, ALIGN_END, _("Start"), _("Position of start of region")); + setup_col (tvc, 4, ALIGN_END, _("Start"), _("Position of start of region")); tvc = append_col (_columns.length, bbt_width); - setup_col (tvc, 4, ALIGN_END, _("Length"), _("Length of the region")); + setup_col (tvc, 5, ALIGN_END, _("Length"), _("Length of the region")); tvc = append_col (_columns.locked, cb_width); setup_col (tvc, -1, ALIGN_CENTER, S_("Lock|L"), _("Region position locked?")); @@ -93,7 +94,7 @@ EditorRegions::init () #ifdef SHOW_REGION_EXTRAS tvc = append_col (_columns.end, bbt_width); - setup_col (tvc, 5, ALIGN_END, _("End"), _("Position of end of region")); + setup_col (tvc, 6, ALIGN_END, _("End"), _("Position of end of region")); tvc = append_col (_columns.sync, bbt_width); setup_col (tvc, -1, ALIGN_END, _("Sync"), _("Position of region sync point, relative to start of the region")); tvc = append_col (_columns.fadein, bbt_width); diff --git a/gtk2_ardour/region_list_base.cc b/gtk2_ardour/region_list_base.cc index 505b9b7ade..f69d2a4f40 100644 --- a/gtk2_ardour/region_list_base.cc +++ b/gtk2_ardour/region_list_base.cc @@ -171,7 +171,7 @@ void RegionListBase::add_tag_column () { TreeViewColumn* tvc = append_col (_columns.tags, "2099-10-10 10:10:30"); - setup_col (tvc, 2, ALIGN_START, _("Tags"), _("Tags")); + setup_col (tvc, 3, ALIGN_START, _("Tags"), _("Tags")); /* Tags cell: make editable */ CellRendererText* region_tags_cell = dynamic_cast (tvc->get_first_cell ()); @@ -492,6 +492,9 @@ RegionListBase::populate_row (std::shared_ptr region, TreeModel::Row con populate_row_end (region, row); populate_row_length (region, row); } + if (all || what_changed.contains (Properties::region_fx)) { + populate_row_regionfx (region, row); + } if (all) { populate_row_source (region, row); } @@ -610,6 +613,12 @@ RegionListBase::populate_row_opaque (std::shared_ptr region, TreeModel:: row[_columns.opaque] = region->opaque (); } +void +RegionListBase::populate_row_regionfx (std::shared_ptr region, TreeModel::Row const& row) +{ + row[_columns.regionfx] = region->n_region_fx (); +} + void RegionListBase::populate_row_name (std::shared_ptr region, TreeModel::Row const& row) { diff --git a/gtk2_ardour/region_list_base.h b/gtk2_ardour/region_list_base.h index fc74c196d1..ea704e894d 100644 --- a/gtk2_ardour/region_list_base.h +++ b/gtk2_ardour/region_list_base.h @@ -92,14 +92,15 @@ protected: { add (name); // 0 add (channels); // 1 - add (tags); // 2 - add (start); // 3 - add (length); // 3 - add (end); // 5 - add (sync); // 6 - add (fadein); // 7 - add (fadeout); // 8 - add (locked); // 9 + add (regionfx); // 2 + add (tags); // 3 + add (start); // 4 + add (length); // 5 + add (end); // 6 + add (sync); // 7 + add (fadein); // 8 + add (fadeout); // 9 + add (locked); // 10 add (muted); // 11 add (opaque); // 12 add (path); // 13 @@ -111,11 +112,12 @@ protected: add (take_id); // 18 add (natural_pos); // 19 add (natural_s); // 20 - add (captd_xruns); + add (captd_xruns); // 21 } Gtk::TreeModelColumn name; Gtk::TreeModelColumn channels; + Gtk::TreeModelColumn regionfx; Gtk::TreeModelColumn tags; Gtk::TreeModelColumn position; Gtk::TreeModelColumn start; @@ -128,7 +130,7 @@ protected: Gtk::TreeModelColumn muted; Gtk::TreeModelColumn opaque; Gtk::TreeModelColumn path; - Gtk::TreeModelColumn> region; + Gtk::TreeModelColumn> region; Gtk::TreeModelColumn color_; Gtk::TreeModelColumn captd_for; Gtk::TreeModelColumn take_id; @@ -209,6 +211,7 @@ protected: void populate_row_length (std::shared_ptr region, Gtk::TreeModel::Row const& row); void populate_row_name (std::shared_ptr region, Gtk::TreeModel::Row const& row); void populate_row_source (std::shared_ptr region, Gtk::TreeModel::Row const& row); + void populate_row_regionfx (std::shared_ptr region, Gtk::TreeModel::Row const& row); void clock_format_changed ();