Port-Matrix: use cached nchannels

This surprisingly significantly speeds up rendering of large matrices.
20sec instead of 43sec for a 512x512 matrix on a i7-10610U
This commit is contained in:
Robin Gareus
2025-07-01 17:44:37 +02:00
parent a0ba6e3dfb
commit 846253533f
3 changed files with 3 additions and 3 deletions

View File

@@ -84,7 +84,7 @@ BundleEditorMatrix::set_state (BundleChannel c[2], bool s)
PortMatrixNode::State
BundleEditorMatrix::get_state (BundleChannel c[2]) const
{
if (c[0].bundle->nchannels() == ChanCount::ZERO || c[1].bundle->nchannels() == ChanCount::ZERO) {
if (c[0].nchannels() == ChanCount::ZERO || c[1].nchannels() == ChanCount::ZERO) {
return PortMatrixNode::NOT_ASSOCIATED;
}

View File

@@ -102,7 +102,7 @@ GlobalPortMatrix::get_state (BundleChannel c[2]) const
return PortMatrixNode::NOT_ASSOCIATED;
}
if (c[0].bundle->nchannels() == ChanCount::ZERO || c[1].bundle->nchannels() == ChanCount::ZERO) {
if (c[0].nchannels() == ChanCount::ZERO || c[1].nchannels() == ChanCount::ZERO) {
return PortMatrixNode::NOT_ASSOCIATED;
}

View File

@@ -162,7 +162,7 @@ IOSelector::set_state (ARDOUR::BundleChannel c[2], bool s)
PortMatrixNode::State
IOSelector::get_state (ARDOUR::BundleChannel c[2]) const
{
if (c[0].bundle->nchannels() == ChanCount::ZERO || c[1].bundle->nchannels() == ChanCount::ZERO) {
if (c[0].nchannels() == ChanCount::ZERO || c[1].nchannels() == ChanCount::ZERO) {
return PortMatrixNode::NOT_ASSOCIATED;
}