diff options
author | Robin Gareus <robin@gareus.org> | 2017-10-04 00:35:29 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-10-04 00:54:55 +0200 |
commit | e31f5d999837b0d0d63dc824c50e9da4acca7244 (patch) | |
tree | ef4712ccd25e8cc651ffabcd16e120571c21921d /libs/ardour/route.cc | |
parent | 5dd9acf9ab39306277652c28fb5ac4af330e0af0 (diff) |
Clean up State API:
* Processor implement get_state(), classes derived from Processor
implement protected ::state() -- as documented in processor.h
* likewise for Route, Track: make ::state() a protected interface
* removal of "full_state", use explicit "template_save"
* use RAII/Unwind to skip saving automation-state
Diffstat (limited to 'libs/ardour/route.cc')
-rw-r--r-- | libs/ardour/route.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 236f2d7c0c..368ec50eae 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -2428,17 +2428,17 @@ Route::set_strict_io (const bool enable) XMLNode& Route::get_state() { - return state(true); + return state (false); } XMLNode& Route::get_template() { - return state(false); + return state (true); } XMLNode& -Route::state(bool full_state) +Route::state (bool save_template) { if (!_session._template_state_dir.empty()) { foreach_processor (sigc::bind (sigc::mem_fun (*this, &Route::set_plugin_state_dir), _session._template_state_dir)); @@ -2469,14 +2469,14 @@ Route::state(bool full_state) node->add_child_nocopy (_solo_isolate_control->get_state ()); node->add_child_nocopy (_solo_safe_control->get_state ()); - node->add_child_nocopy (_input->state (full_state)); - node->add_child_nocopy (_output->state (full_state)); + node->add_child_nocopy (_input->get_state ()); + node->add_child_nocopy (_output->get_state ()); node->add_child_nocopy (_mute_master->get_state ()); node->add_child_nocopy (_mute_control->get_state ()); node->add_child_nocopy (_phase_control->get_state ()); - if (full_state) { + if (!skip_saving_automation) { node->add_child_nocopy (Automatable::get_automation_xml_state ()); } @@ -2486,7 +2486,7 @@ Route::state(bool full_state) } if (_pannable) { - node->add_child_nocopy (_pannable->state (full_state)); + node->add_child_nocopy (_pannable->get_state ()); } { @@ -2495,7 +2495,7 @@ Route::state(bool full_state) if (*i == _delayline) { continue; } - if (!full_state) { + if (save_template) { /* template save: do not include internal sends functioning as aux sends because the chance of the target ID in the session where this template is used @@ -2513,7 +2513,7 @@ Route::state(bool full_state) } } } - node->add_child_nocopy((*i)->state (full_state)); + node->add_child_nocopy((*i)->get_state ()); } } @@ -2908,7 +2908,7 @@ Route::get_processor_state () { XMLNode* root = new XMLNode (X_("redirects")); for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) { - root->add_child_nocopy ((*i)->state (true)); + root->add_child_nocopy ((*i)->get_state ()); } return *root; |