libardour: provide Processor::check_active() as a standard way to handle Processor::_{pending_,}active

This commit is contained in:
Paul Davis 2021-11-24 10:27:24 -07:00
parent 797bc1a162
commit 59ac52f113
2 changed files with 16 additions and 0 deletions

View File

@ -161,6 +161,7 @@ protected:
virtual XMLNode& state ();
virtual int set_state_2X (const XMLNode&, int version);
bool check_active ();
bool map_loop_range (samplepos_t& start, samplepos_t& end) const;
int _pending_active;

View File

@ -332,3 +332,18 @@ Processor::owner() const
{
return _owner;
}
bool
Processor::check_active ()
{
if (_active) {
if (!_pending_active) {
_active = false;
}
} else {
if (_pending_active) {
_active = true;
}
}
return _active;
}