diff --git a/gtk2_ardour/editor_route_groups.cc b/gtk2_ardour/editor_route_groups.cc index 9ee0b503fc..319c48735c 100644 --- a/gtk2_ardour/editor_route_groups.cc +++ b/gtk2_ardour/editor_route_groups.cc @@ -343,20 +343,6 @@ EditorRouteGroups::row_change (const Gtk::TreeModel::Path&, const Gtk::TreeModel return; } - if ((*iter)[_columns.is_visible]) { - for (TrackViewList::const_iterator j = _editor->get_track_views().begin(); j != _editor->get_track_views().end(); ++j) { - if ((*j)->route_group() == group) { - _editor->_routes->show_track_in_display (**j); - } - } - } else { - for (TrackViewList::const_iterator j = _editor->get_track_views().begin(); j != _editor->get_track_views().end(); ++j) { - if ((*j)->route_group() == group) { - _editor->hide_track_in_display (*j); - } - } - } - PropertyList plist; bool val = (*iter)[_columns.gain]; plist.add (Properties::gain, val); @@ -404,7 +390,7 @@ EditorRouteGroups::add (RouteGroup* group) focus = true; } - group->PropertyChanged.connect (property_changed_connection, MISSING_INVALIDATOR, ui_bind (&EditorRouteGroups::property_changed, this, group, _1), gui_context()); + group->PropertyChanged.connect (_property_changed_connections, MISSING_INVALIDATOR, ui_bind (&EditorRouteGroups::property_changed, this, group, _1), gui_context()); if (focus) { TreeViewColumn* col = _display.get_column (0); @@ -456,6 +442,16 @@ EditorRouteGroups::property_changed (RouteGroup* group, const PropertyChange& ch if (change.contains (Properties::name) || change.contains (Properties::active)) { _editor->_group_tabs->set_dirty (); } + + for (TrackViewList::const_iterator i = _editor->get_track_views().begin(); i != _editor->get_track_views().end(); ++i) { + if ((*i)->route_group() == group) { + if (group->is_hidden ()) { + _editor->hide_track_in_display (*i); + } else { + _editor->_routes->show_track_in_display (**i); + } + } + } } void @@ -493,7 +489,7 @@ EditorRouteGroups::set_session (Session* s) RouteGroup& arg (_session->all_route_group()); - arg.PropertyChanged.connect (property_changed_connection, MISSING_INVALIDATOR, ui_bind (&EditorRouteGroups::all_group_changed, this, _1), gui_context()); + arg.PropertyChanged.connect (all_route_groups_changed_connection, MISSING_INVALIDATOR, ui_bind (&EditorRouteGroups::all_group_changed, this, _1), gui_context()); _session->route_group_added.connect (_session_connections, MISSING_INVALIDATOR, ui_bind (&EditorRouteGroups::add, this, _1), gui_context()); _session->route_group_removed.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&EditorRouteGroups::groups_changed, this), gui_context()); diff --git a/gtk2_ardour/editor_route_groups.h b/gtk2_ardour/editor_route_groups.h index c5e4eda254..d881655467 100644 --- a/gtk2_ardour/editor_route_groups.h +++ b/gtk2_ardour/editor_route_groups.h @@ -81,7 +81,8 @@ private: Gtk::VBox _display_packer; Gtk::ToggleButton _all_group_active_button; bool _in_row_change; - PBD::ScopedConnection property_changed_connection; + PBD::ScopedConnectionList _property_changed_connections; + PBD::ScopedConnection all_route_groups_changed_connection; }; diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc index dc3aced978..b7fa89cfe2 100644 --- a/gtk2_ardour/mixer_ui.cc +++ b/gtk2_ardour/mixer_ui.cc @@ -1188,6 +1188,16 @@ Mixer_UI::route_group_property_changed (RouteGroup* group, const PropertyChange& if (change.contains (Properties::name)) { _group_tabs->set_dirty (); } + + for (list::iterator j = strips.begin(); j != strips.end(); ++j) { + if ((*j)->route_group() == group) { + if (group->is_hidden ()) { + hide_strip (*j); + } else { + show_strip (*j); + } + } + } } void @@ -1221,26 +1231,17 @@ Mixer_UI::route_group_row_change (const Gtk::TreeModel::Path&, const Gtk::TreeMo return; } - if ((*iter)[group_columns.visible]) { - for (list::iterator i = strips.begin(); i != strips.end(); ++i) { - if ((*i)->route_group() == group) { - show_strip (*i); - } - } - } else { - for (list::iterator i = strips.begin(); i != strips.end(); ++i) { - if ((*i)->route_group() == group) { - hide_strip (*i); - } - } - } - std::string name = (*iter)[group_columns.text]; if (name != group->name()) { group->set_name (name); } + bool hidden = !(*iter)[group_columns.visible]; + + if (hidden != group->is_hidden ()) { + group->set_hidden (hidden, this); + } } void @@ -1252,7 +1253,7 @@ Mixer_UI::add_route_group (RouteGroup* group) in_group_row_change = true; TreeModel::Row row = *(group_model->append()); - row[group_columns.visible] = true; + row[group_columns.visible] = !group->is_hidden (); row[group_columns.group] = group; if (!group->name().empty()) { row[group_columns.text] = group->name(); diff --git a/libs/ardour/route_group.cc b/libs/ardour/route_group.cc index ce760563ac..c64e5f77d1 100644 --- a/libs/ardour/route_group.cc +++ b/libs/ardour/route_group.cc @@ -377,6 +377,7 @@ RouteGroup::set_hidden (bool yn, void* /*src*/) if (is_hidden() == yn) { return; } + if (yn) { _hidden = true; if (Config->get_hiding_groups_deactivates_groups()) { @@ -388,6 +389,9 @@ RouteGroup::set_hidden (bool yn, void* /*src*/) _active = true; } } + + PropertyChanged (Properties::hidden); /* EMIT SIGNAL */ + _session.set_dirty (); }