trigger arming must be mutually exclusive within a triggerbox
This commit is contained in:
parent
3228a61e62
commit
590400a95f
@ -814,6 +814,7 @@ class LIBARDOUR_API TriggerBox : public Processor, public std::enable_shared_fro
|
||||
|
||||
void arm_from_another_thread (Trigger& slot, samplepos_t, uint32_t chans);
|
||||
void disarm();
|
||||
void disarm_all();
|
||||
bool armed() const { return (bool) _arm_info.load(); }
|
||||
PBD::Signal<void()> ArmedChanged;
|
||||
|
||||
|
@ -290,8 +290,20 @@ Trigger::request_trigger_delete (Trigger* t)
|
||||
void
|
||||
Trigger::arm ()
|
||||
{
|
||||
#warning paul need channel count here, somehow
|
||||
_box.arm_from_another_thread (*this, _box.session().transport_sample(), 2);
|
||||
/* trigger arming is mutually exclusive within a given TriggerBox */
|
||||
|
||||
_box.disarm_all ();
|
||||
|
||||
Track* trk = static_cast<Track*> (_box.owner());
|
||||
int chns;
|
||||
|
||||
if (trk->data_type() == DataType::AUDIO) {
|
||||
chns = dynamic_cast<AudioTrack*> (trk)->input()->n_ports().n_audio();
|
||||
} else {
|
||||
chns = 0;
|
||||
}
|
||||
|
||||
_box.arm_from_another_thread (*this, _box.session().transport_sample(), chns);
|
||||
_armed = true;
|
||||
ArmChanged(); /* EMIT SIGNAL */
|
||||
TriggerArmChanged (this);
|
||||
@ -3569,6 +3581,16 @@ TriggerBox::arm_from_another_thread (Trigger& slot, samplepos_t now, uint32_t ch
|
||||
void
|
||||
TriggerBox::disarm ()
|
||||
{
|
||||
delete _arm_info;
|
||||
_arm_info = nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
TriggerBox::disarm_all ()
|
||||
{
|
||||
for (auto & t : all_triggers) {
|
||||
t->disarm ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user