diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2006-10-31 02:40:08 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2006-10-31 02:40:08 +0000 |
commit | 71c94e69438c7c282b2dcac5ead080119944b290 (patch) | |
tree | 17bc6b75ff24c0eca6a7a45043f2c9d11cc2ff0c /libs/ardour/route.cc | |
parent | 74df5d49c8ff42c05d7eb9300c3a9f9a7257e694 (diff) |
massive changes in automation state handling, not entirely complete; some bug fixes for automation line drawing
git-svn-id: svn://localhost/ardour2/trunk@1034 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/route.cc')
-rw-r--r-- | libs/ardour/route.cc | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 5c4be73979..b204ad76dc 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -61,13 +61,13 @@ Route::Route (Session& sess, string name, int input_min, int input_max, int outp init (); } -Route::Route (Session& sess, const XMLNode& node) - : IO (sess, "route"), +Route::Route (Session& sess, const XMLNode& node, DataType default_type) + : IO (sess, *node.child ("IO"), default_type), _solo_control (X_("solo"), *this, ToggleControllable::SoloControl), _mute_control (X_("mute"), *this, ToggleControllable::MuteControl) { init (); - set_state (node); + _set_state (node, false); } void @@ -1482,6 +1482,12 @@ Route::add_redirect_from_xml (const XMLNode& node) int Route::set_state (const XMLNode& node) { + return _set_state (node, true); +} + +int +Route::_set_state (const XMLNode& node, bool call_base) +{ XMLNodeList nlist; XMLNodeConstIterator niter; XMLNode *child; @@ -1604,7 +1610,7 @@ Route::set_state (const XMLNode& node) child = *niter; - if (child->name() == IO::state_node_name) { + if (child->name() == IO::state_node_name && call_base) { IO::set_state (*child); break; @@ -1925,6 +1931,10 @@ Route::handle_transport_stopped (bool abort_ignored, bool did_locate, bool can_f { Glib::RWLock::ReaderLock lm (redirect_lock); + if (!did_locate) { + automation_snapshot (now); + } + for (RedirectList::iterator i = _redirects.begin(); i != _redirects.end(); ++i) { if (Config->get_plugins_stop_with_transport() && can_flush_redirects) { @@ -2024,6 +2034,15 @@ int Route::roll (nframes_t nframes, nframes_t start_frame, nframes_t end_frame, nframes_t offset, int declick, bool can_record, bool rec_monitors_input) { + { + Glib::RWLock::ReaderLock lm (redirect_lock, Glib::TRY_LOCK); + if (lm.locked()) { + // automation snapshot can also be called from the non-rt context + // and it uses the redirect list, so we take the lock out here + automation_snapshot (_session.transport_frame()); + } + } + if ((n_outputs() == 0 && _redirects.empty()) || n_inputs() == 0 || !_active) { silence (nframes, offset); return 0; @@ -2160,6 +2179,16 @@ Route::set_latency_delay (nframes_t longest_session_latency) } } +void +Route::automation_snapshot (nframes_t now) +{ + IO::automation_snapshot (now); + + for (RedirectList::iterator i = _redirects.begin(); i != _redirects.end(); ++i) { + (*i)->automation_snapshot (now); + } +} + Route::ToggleControllable::ToggleControllable (std::string name, Route& s, ToggleType tp) : Controllable (name), route (s), type(tp) { |