From af8be5e71dfacbfa6472b2a3fb8617545e369ec2 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 31 Aug 2021 18:36:16 -0600 Subject: [PATCH] triggerbox: restore state initial implementation (incomplete) --- libs/ardour/ardour/triggerbox.h | 6 ++++++ libs/ardour/triggerbox.cc | 21 +++++++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/libs/ardour/ardour/triggerbox.h b/libs/ardour/ardour/triggerbox.h index a58fdc9835..453431606b 100644 --- a/libs/ardour/ardour/triggerbox.h +++ b/libs/ardour/ardour/triggerbox.h @@ -283,4 +283,10 @@ class LIBARDOUR_API TriggerBox : public Processor } // namespace ARDOUR +namespace PBD { +DEFINE_ENUM_CONVERT(ARDOUR::Trigger::FollowAction); +DEFINE_ENUM_CONVERT(ARDOUR::Trigger::LaunchStyle); +} /* namespace PBD */ + + #endif /* __ardour_triggerbox_h__ */ diff --git a/libs/ardour/triggerbox.cc b/libs/ardour/triggerbox.cc index a9d7213167..1f5087c1fa 100644 --- a/libs/ardour/triggerbox.cc +++ b/libs/ardour/triggerbox.cc @@ -106,8 +106,16 @@ Trigger::get_state (void) } int -Trigger::set_state (const XMLNode&, int version) +Trigger::set_state (const XMLNode& node, int version) { + node.get_property (X_("legato"), _legato); + node.get_property (X_("launch-style"), _launch_style); + node.get_property (X_("follow-action-0"), _follow_action[0]); + node.get_property (X_("follow-action-1"), _follow_action[1]); + node.get_property (X_("quantization"), _quantization); + node.get_property (X_("name"), _name); + node.get_property (X_("index"), _index); + return 0; } @@ -348,8 +356,17 @@ AudioTrigger::get_state (void) } int -AudioTrigger::set_state (const XMLNode&, int version) +AudioTrigger::set_state (const XMLNode& node, int version) { + timepos_t t; + + node.get_property (X_("start"), t); + _start_offset = t.samples(); + + node.get_property (X_("length"), t); + usable_length = t.samples(); + last_sample = _start_offset + usable_length; + return 0; }