/** 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)
{
}
add_group (other);
emit_changed ();
+ _bundles_dirty = true;
}
boost::shared_ptr<Bundle>
_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;
);
emit_changed ();
+ _bundles_dirty = true;
}
void
}
emit_changed ();
+ _bundles_dirty = true;
}
void
ARDOUR::DataType _type;
mutable PortGroup::BundleList _bundles;
+ mutable bool _bundles_dirty;
List _groups;
std::vector<sigc::connection> _bundle_changed_connections;
bool _signals_suspended;
{
uint32_t n = 0;
- PortGroup::BundleList::const_iterator i = _matrix->columns()->bundles().begin();
- while (i != _matrix->columns()->bundles().end() && i->bundle != bc.bundle) {
+ PortGroup::BundleList const & b = _matrix->columns()->bundles ();
+ PortGroup::BundleList::const_iterator i = b.begin();
+ while (i != b.end() && i->bundle != bc.bundle) {
if (_matrix->show_only_bundles()) {
n += 1;
} else {
if (!_matrix->show_only_bundles()) {
n += bc.channel;
}
-
+
return n * column_width();
}
PortMatrixLabels::draw_extra (cairo_t* cr)
{
for (std::vector<ARDOUR::BundleChannel>::const_iterator i = _channel_highlights.begin(); i != _channel_highlights.end(); ++i) {
-
if (_matrix->show_only_bundles()) {
render_bundle_name (
cr,
PortMatrixLabels::clear_channel_highlights ()
{
for (std::vector<ARDOUR::BundleChannel>::const_iterator i = _channel_highlights.begin(); i != _channel_highlights.end(); ++i) {
-
queue_draw_for (*i);
}
{
uint32_t n = 0;
- PortGroup::BundleList::const_iterator i = _matrix->rows()->bundles().begin();
- while (i != _matrix->rows()->bundles().end() && i->bundle != bc.bundle) {
+ PortGroup::BundleList const & bundles = _matrix->rows()->bundles();
+ PortGroup::BundleList::const_iterator i = bundles.begin ();
+ while (i != bundles.end() && i->bundle != bc.bundle) {
if (_matrix->show_only_bundles()) {
n += 1;
} else {