diff options
author | Carl Hetherington <carl@carlh.net> | 2009-07-17 14:21:54 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2009-07-17 14:21:54 +0000 |
commit | 748ad24ace7a37059b6812a1f9f0145d4725ba66 (patch) | |
tree | 162026ac28a6331013f37b0ee1d8cbbb46a08300 /gtk2_ardour/port_group.cc | |
parent | be40312e01ea36e1aaa86cae8551e42353849bc2 (diff) |
Small optimisation. Fix mouseover highlighting in the port matrix.
git-svn-id: svn://localhost/ardour2/branches/3.0@5369 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/port_group.cc')
-rw-r--r-- | gtk2_ardour/port_group.cc | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/gtk2_ardour/port_group.cc b/gtk2_ardour/port_group.cc index f64b1031ef..149baf3046 100644 --- a/gtk2_ardour/port_group.cc +++ b/gtk2_ardour/port_group.cc @@ -159,7 +159,7 @@ PortGroup::total_channels () const /** PortGroupList constructor. */ PortGroupList::PortGroupList () - : _type (DataType::AUDIO), _signals_suspended (false), _pending_change (false) + : _type (DataType::AUDIO), _signals_suspended (false), _pending_change (false), _bundles_dirty (true) { } @@ -319,6 +319,7 @@ PortGroupList::gather (ARDOUR::Session& session, bool inputs) add_group (other); emit_changed (); + _bundles_dirty = true; } boost::shared_ptr<Bundle> @@ -402,18 +403,23 @@ PortGroupList::clear () _bundle_changed_connections.clear (); emit_changed (); + _bundles_dirty = true; } PortGroup::BundleList const & PortGroupList::bundles () const { - _bundles.clear (); - - for (PortGroupList::List::const_iterator i = begin (); i != end (); ++i) { - if ((*i)->visible()) { - std::copy ((*i)->bundles().begin(), (*i)->bundles().end(), std::back_inserter (_bundles)); + if (_bundles_dirty) { + _bundles.clear (); + + for (PortGroupList::List::const_iterator i = begin (); i != end (); ++i) { + if ((*i)->visible()) { + std::copy ((*i)->bundles().begin(), (*i)->bundles().end(), std::back_inserter (_bundles)); + } } + + _bundles_dirty = false; } return _bundles; @@ -446,6 +452,7 @@ PortGroupList::add_group (boost::shared_ptr<PortGroup> g) ); emit_changed (); + _bundles_dirty = true; } void @@ -456,6 +463,7 @@ PortGroupList::remove_bundle (boost::shared_ptr<Bundle> b) } emit_changed (); + _bundles_dirty = true; } void |