libardour: provide Processor::check_active() as a standard way to handle Processor::_{pending_,}active
This commit is contained in:
parent
797bc1a162
commit
59ac52f113
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user