#include "ardour/revision.h"
#include "ardour/route_group.h"
#include "ardour/send.h"
+#include "ardour/selection.h"
#include "ardour/session.h"
#include "ardour/session_directory.h"
#include "ardour/session_metadata.h"
return tree.write (sn.c_str());
}
+namespace
+{
+struct route_id_compare {
+ bool
+ operator() (const boost::shared_ptr<Route>& r1, const boost::shared_ptr<Route>& r2)
+ {
+ return r1->id () < r2->id ();
+ }
+};
+} // anon namespace
+
XMLNode&
Session::state (bool full_state)
{
child = node->add_child ("Path");
child->add_content (p);
}
+ node->set_property ("end-is-free", _session_range_end_is_free);
}
- node->set_property ("end-is-free", _session_range_end_is_free);
-
/* save the ID counter */
node->set_property ("id-counter", ID::counter());
if (full_state) {
+ node->add_child_nocopy (_selection->get_state());
+
if (_locations) {
node->add_child_nocopy (_locations->get_state());
}
{
boost::shared_ptr<RouteList> r = routes.reader ();
- RoutePublicOrderSorter cmp;
- RouteList public_order (*r);
- public_order.sort (cmp);
-
- /* the sort should have put the monitor out first */
-
- if (_monitor_out) {
- assert (_monitor_out == public_order.front());
- }
+ route_id_compare cmp;
+ RouteList xml_node_order (*r);
+ xml_node_order.sort (cmp);
- for (RouteList::iterator i = public_order.begin(); i != public_order.end(); ++i) {
+ for (RouteList::const_iterator i = xml_node_order.begin(); i != xml_node_order.end(); ++i) {
if (!(*i)->is_auditioner()) {
if (full_state) {
child->add_child_nocopy ((*i)->get_state());
}
}
+ if ((child = find_named_node (node, X_("Selection")))) {
+ _selection->set_state (*child, version);
+ }
+
update_route_record_state ();
/* here beginneth the second phase ... */
return boost::shared_ptr<Controllable>();
}
+boost::shared_ptr<AutomationControl>
+Session::automation_control_by_id (const PBD::ID& id)
+{
+ return boost::dynamic_pointer_cast<AutomationControl> (controllable_by_id (id));
+}
+
boost::shared_ptr<Controllable>
Session::controllable_by_descriptor (const ControllableDescriptor& desc)
{
XMLNode *t = *it;
UndoTransaction* ut = new UndoTransaction ();
- struct timeval tv;
- ut->set_name(t->property("name")->value());
- stringstream ss(t->property("tv-sec")->value());
- ss >> tv.tv_sec;
- ss.str(t->property("tv-usec")->value());
- ss >> tv.tv_usec;
+ std::string name;
+ int64_t tv_sec;
+ int64_t tv_usec;
+
+ if (!t->get_property ("name", name) || !t->get_property ("tv-sec", tv_sec) ||
+ !t->get_property ("tv-usec", tv_usec)) {
+ continue;
+ }
+
+ ut->set_name (name);
+
+ struct timeval tv;
+ tv.tv_sec = tv_sec;
+ tv.tv_usec = tv_usec;
ut->set_timestamp(tv);
for (XMLNodeConstIterator child_it = t->children().begin();
session_dirs.push_back (sp);
refresh_disk_space ();
+ _writable = exists_and_writable (_path);
+
/* ensure that all existing tracks reset their current capture source paths
*/
reset_write_sources (true, true);