using namespace ARDOUR;
using namespace PBD;
+
void
Session::first_stage_init (string fullpath, string snapshot_name)
{
_path += G_DIR_SEPARATOR;
}
- if (Glib::file_test (_path, Glib::FILE_TEST_EXISTS) && ::access (_path.c_str(), W_OK)) {
- _writable = false;
- } else {
- _writable = true;
- }
-
/* these two are just provisional settings. set_state()
will likely override them.
*/
return -1;
}
+ _writable = exists_and_writable (sys::path (_path));
+
if (!mix_template.empty()) {
std::string in_path = mix_template;
}
if (!rl.empty()) {
- add_routes (rl, false);
+ add_routes (rl, false, false);
}
/* this allows the user to override settings with an environment variable.
set_dirty();
- /* writable() really reflects the whole folder, but if for any
- reason the session state file can't be written to, still
- make us unwritable.
- */
-
- if (::access (xmlpath.to_string().c_str(), W_OK) != 0) {
- _writable = false;
- }
+ _writable = exists_and_writable (xmlpath);
if (!state_tree->read (xmlpath.to_string())) {
error << string_compose(_("Could not understand ardour file %1"), xmlpath.to_string()) << endmsg;
new_routes.push_back (route);
}
- add_routes (new_routes, false);
+ add_routes (new_routes, false, false);
return 0;
}
route_group_removed (); /* EMIT SIGNAL */
}
+}
+/** Set a new order for our route groups, without adding or removing any.
+ * @param groups Route group list in the new order.
+ */
+void
+Session::reorder_route_groups (list<RouteGroup*> groups)
+{
+ _route_groups = groups;
+
+ route_groups_reordered (); /* EMIT SIGNAL */
+ set_dirty ();
}
+
RouteGroup *
Session::route_group_by_name (string name)
{
for (i = session_dirs.begin(); i != session_dirs.end(); ++i) {
- dead_dir = (*i).path;
- dead_dir += dead_dir_name;
+ dead_dir = Glib::build_filename ((*i).path, dead_dir_name);
clear_directory (dead_dir, &rep.space, &rep.paths);
}