mmc = 0;
session_send_mmc = false;
session_send_mtc = false;
- session_midi_feedback = false;
post_transport_work = PostTransportWork (0);
g_atomic_int_set (&butler_should_do_transport_work, 0);
g_atomic_int_set (&butler_active, 0);
Curve::CurveCreated.connect (mem_fun (*this, &Session::add_curve));
AutomationList::AutomationListCreated.connect (mem_fun (*this, &Session::add_automation_list));
- Controllable::GoingAway.connect (mem_fun (*this, &Session::remove_controllable));
+ Controllable::Destroyed.connect (mem_fun (*this, &Session::remove_controllable));
IO::MoreOutputs.connect (mem_fun (*this, &Session::ensure_passthru_buffers));
return -1;
}
- StateManager::prohibit_save ();
-
if ((prop = node.property ("name")) != 0) {
_name = prop->value ();
}
start_location = location;
}
- _locations.save_state (_("initial state"));
-
if ((child = find_named_node (node, "EditGroups")) == 0) {
error << _("Session: XML state has no edit groups section") << endmsg;
goto out;
_state_of_the_state = Clean;
- StateManager::allow_save (_("initial state"), true);
-
if (state_was_pending) {
save_state (_current_snapshot_name);
remove_pending_capture_state ();
return 0;
out:
- /* we failed, re-enable state saving but don't actually save internal state */
- StateManager::allow_save (X_("ignored"), false);
return ret;
}
nchans = atoi (prop->value().c_str());
}
+
+ if ((prop = node.property ("name")) == 0) {
+ cerr << "no name for this region\n";
+ abort ();
+ }
if ((prop = node.property (X_("source-0"))) == 0) {
if ((prop = node.property ("source")) == 0) {
delete *x;
}
- /* step 2: clear the undo/redo history for all playlists */
-
- for (PlaylistList::iterator x = playlists.begin(); x != playlists.end(); ++x) {
- (*x)->drop_all_states ();
- }
-
- /* step 3: find all un-referenced sources */
+ /* step 2: find all un-referenced sources */
rep.paths.clear ();
rep.space = 0;
i = tmp;
}
- /* Step 4: get rid of all regions in the region list that use any dead sources
+ /* Step 3: get rid of all regions in the region list that use any dead sources
in case the sources themselves don't go away (they might be referenced in
other snapshots).
*/
/* replace history */
history.clear();
- for (XMLNodeConstIterator it = tree.root()->children().begin();
- it != tree.root()->children().end();
- it++)
- {
- 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;
- ut->set_timestamp(tv);
-
- for (XMLNodeConstIterator child_it = t->children().begin();
- child_it != t->children().end();
- child_it++)
- {
- XMLNode *n = *child_it;
- Command *c;
- if (n->name() == "MementoCommand" ||
- n->name() == "MementoUndoCommand" ||
- n->name() == "MementoRedoCommand")
- {
- c = memento_command_factory(n);
- if (c)
- ut->add_command(c);
- }
- else
- {
- error << string_compose(_("Couldn't figure out how to make a Command out of a %1 XMLNode."), n->name()) << endmsg;
- }
- }
- history.add(ut);
+
+ for (XMLNodeConstIterator it = tree.root()->children().begin(); it != tree.root()->children().end(); it++) {
+
+ 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;
+ ut->set_timestamp(tv);
+
+ for (XMLNodeConstIterator child_it = t->children().begin();
+ child_it != t->children().end();
+ child_it++)
+ {
+ XMLNode *n = *child_it;
+ Command *c;
+
+ if (n->name() == "MementoCommand" ||
+ n->name() == "MementoUndoCommand" ||
+ n->name() == "MementoRedoCommand") {
+ if ((c = memento_command_factory(n))) {
+ ut->add_command(c);
+ }
+ } else {
+ error << string_compose(_("Couldn't figure out how to make a Command out of a %1 XMLNode."), n->name()) << endmsg;
+ }
+ }
+
+ history.add (ut);
}
return 0;