mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-05 21:25:46 +01:00
Cache BundleChannel nchannels, allow lock-free calls
This commit is contained in:
parent
9897074fcc
commit
a0ba6e3dfb
1 changed files with 10 additions and 0 deletions
|
|
@ -174,8 +174,18 @@ public:
|
|||
return bundle != other.bundle || channel != other.channel;
|
||||
}
|
||||
|
||||
ChanCount nchannels () const {
|
||||
if (!_nchannels) {
|
||||
_nchannels = bundle->nchannels ();
|
||||
}
|
||||
return _nchannels.value ();
|
||||
}
|
||||
|
||||
std::shared_ptr<Bundle> bundle;
|
||||
int channel; ///< channel index, or -1 for "all"
|
||||
|
||||
private:
|
||||
mutable std::optional<ChanCount> _nchannels;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue