summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorValeriy Kamyshniy <vkamyshniy@wavesglobal.com>2015-04-03 00:25:56 +0300
committerPaul Davis <paul@linuxaudiosystems.com>2015-06-29 14:18:10 -0400
commit7c5d849247bdd5fdccd5a91bc5f2d38ffc0ada0c (patch)
treebe465e912c463c473414d9166ed0d89c0da3c36b /libs
parent2a1d0e20f07b3302f42475ac07355f9ae549ebb6 (diff)
[Summary] For tracks when saving templates, we need stored the Auto Loop Range and all MIDI markers. As well, just to follow canonical rule: dealing with a pointer (_location in Session::state) check it for NULL prior to any operation (s), accessing the pointer.
[Review required] YPozdnyakov, GZharun, Paul Davis
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/session_state.cc32
1 files changed, 23 insertions, 9 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index ef70e99630..266096a894 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -1045,17 +1045,31 @@ Session::state (bool full_state)
}
}
}
+
+
if (full_state) {
- node->add_child_nocopy (_locations->get_state());
+
+ if (_locations) {
+ node->add_child_nocopy (_locations->get_state());
+ }
} else {
+ Locations loc (*this);
// for a template, just create a new Locations, populate it
// with the default start and end, and get the state for that.
- Locations loc (*this);
Location* range = new Location (*this, 0, 0, _("session"), Location::IsSessionRange);
range->set (max_framepos, 0);
loc.add (range);
- node->add_child_nocopy (loc.get_state());
+ XMLNode& locations_state = loc.get_state();
+
+ if (ARDOUR::Profile->get_trx() && _locations) {
+ for (Locations::LocationList::const_iterator i = _locations->list ().begin (); i != _locations->list ().end (); ++i) {
+ if ((*i)->is_mark () || (*i)->is_auto_loop ()) {
+ locations_state.add_child_nocopy ((*i)->get_state ());
+ }
+ }
+ }
+ node->add_child_nocopy (locations_state);
}
child = node->add_child ("Bundles");
@@ -1076,12 +1090,12 @@ Session::state (bool full_state)
RoutePublicOrderSorter cmp;
RouteList public_order (*r);
public_order.sort (cmp);
-
- /* the sort should have put control outs first */
-
- if (_monitor_out) {
- assert (_monitor_out == public_order.front());
- }
+
+ /* the sort should have put control outs first */
+
+ if (_monitor_out) {
+ assert (_monitor_out == public_order.front());
+ }
for (RouteList::iterator i = public_order.begin(); i != public_order.end(); ++i) {
if (!(*i)->is_auditioner()) {