settings for a new session
*/
session->save_state ("");
- session->save_history ("");
}
/* there is too much going on, in too many threads, for us to
}
if ((ret = session->save_state (name)) != 0) {
- session->save_history (name);
return ret;
}
}
case 1:
session->save_state ("");
- session->save_history ("");
break;
}
}
using namespace sigc;
using namespace PBD;
+sigc::signal<void,AutomationList *> AutomationList::AutomationListCreated;
+
#if 0
static void dumpit (const AutomationList& al, string prefix = "")
{
using namespace sigc;
using namespace PBD;
+sigc::signal<void, Curve*> Curve::CurveCreated;
+
Curve::Curve (double minv, double maxv, double canv, bool nostate)
: AutomationList (canv, nostate)
{
{
bool new_session;
- cerr << "Loading session " << fullpath << " using snapshot " << snapshot_name << endl;
+ cerr << "Loading session " << fullpath << " using snapshot " << snapshot_name << " (1)" << endl;
n_physical_outputs = _engine.n_physical_outputs();
n_physical_inputs = _engine.n_physical_inputs();
{
bool new_session;
- cerr << "Loading session " << fullpath << " using snapshot " << snapshot_name << endl;
+ cerr << "Loading session " << fullpath << " using snapshot " << snapshot_name << " (2)" << endl;
n_physical_outputs = max (requested_physical_out, _engine.n_physical_outputs());
n_physical_inputs = max (requested_physical_in, _engine.n_physical_inputs());
if (get_record_enabled() && get_punch_in()) {
/* capture start has been changed, so save new pending state */
save_state ("", true);
- save_history("");
}
}
*/
save_state ("", true);
- save_history ("");
if (_transport_speed) {
if (!punch_in) {
set_dirty();
save_state (_current_snapshot_name);
- save_history (_current_snapshot_name);
RouteAdded (route); /* EMIT SIGNAL */
}
set_dirty();
save_state (_current_snapshot_name);
- save_history (_current_snapshot_name);
DiskstreamAdded (dstream); /* EMIT SIGNAL */
}
/* XXX should we disconnect from the Route's signals ? */
save_state (_current_snapshot_name);
- save_history (_current_snapshot_name);
/* all shared ptrs to route should go out of scope here */
}
*/
save_state (_current_snapshot_name);
- save_history (_current_snapshot_name);
}
SourceRemoved(source); /* EMIT SIGNAL */
/* get before/after */
if (n->name() == "MementoCommand")
{
- before = n->children().front();
- after = n->children().back();
+ before = new XMLNode(*n->children().front());
+ after = new XMLNode(*n->children().back());
} else if (n->name() == "MementoUndoCommand")
- before = n->children().front();
+ before = new XMLNode(*n->children().front());
else if (n->name() == "MementoRedoCommand")
- after = n->children().front();
+ after = new XMLNode(*n->children().front());
/* create command */
}
else if (obj_T == "Route") // inlcudes AudioTrack
return new MementoCommand<Route>(*route_by_id(id), before, after);
- // For Editor and AutomationLine which are off-limits here
- else if (registry.count(id))
- return new MementoCommand<Stateful>(*registry[id], before, after);
else if (obj_T == "Curve")
{
if (curves.count(id))
if (automation_lists.count(id))
return new MementoCommand<AutomationList>(*automation_lists[id], before, after);
}
+ // For Editor and AutomationLine which are off-limits here
+ else if (registry.count(id))
+ return new MementoCommand<Stateful>(*registry[id], before, after);
/* we failed */
error << _("could not reconstitute MementoCommand from XMLNode. id=") << id.to_s() << endmsg;
*/
save_state ("", true);
- save_history ("");
g_atomic_int_set (&_record_status, Enabled);
RecordStateChanged (); /* EMIT SIGNAL */
_end_location_is_free = false;
}
+ restore_history(_current_snapshot_name);
return 0;
}
}
if (!pending) {
+ save_history(snapshot_name);
bool was_dirty = dirty();
if (state_was_pending) {
save_state (_current_snapshot_name);
- save_history (_current_snapshot_name);
remove_pending_capture_state ();
state_was_pending = false;
}
Session::auto_save()
{
save_state (_current_snapshot_name);
- save_history (_current_snapshot_name);
}
RouteGroup *
*/
save_state ("");
- save_history ("");
out:
_state_of_the_state = (StateOfTheState) (_state_of_the_state & ~InCleanup);
string xml_path;
string bak_path;
+
tree.set_root (&history.get_state());
if (snapshot_name.empty()) {
}
xml_path = _path + snapshot_name + ".history";
+ info << "Saving history to " << xml_path << endmsg;
bak_path = xml_path + ".bak";
/* read xml */
xmlpath = _path + snapshot_name + ".history";
+ info << string_compose(_("Loading history from '%1'."), xmlpath) << endmsg;
+
if (access (xmlpath.c_str(), F_OK)) {
error << string_compose(_("%1: session history file \"%2\" doesn't exist!"), _name, xmlpath) << endmsg;
return 1;
return -1;
}
+ info << "root children " << tree.root()->children().size() << endmsg;
+
/* replace history */
history.clear();
for (XMLNodeConstIterator it = tree.root()->children().begin();
}
history.add(ut);
}
+
+ XMLTree tree2;
+ tree2.set_root(&history.get_state());
+ info << tree2.write_buffer() << endmsg;
+
return 0;
}
if ((post_transport_work & PostTransportLocate) && get_record_enabled()) {
/* capture start has been changed, so save pending state */
save_state ("", true);
- save_history ("");
}
/* always try to get rid of this */
if (did_record) {
save_state (_current_snapshot_name);
- save_history (_current_snapshot_name);
}
if (post_transport_work & PostTransportDuration) {
if ((ret = IO::set_name (str, src)) == 0) {
_session.save_state ("");
- _session.save_history ("");
}
return ret;
}
BasicUI::save_state ()
{
session->save_state ("");
- session->save_history("");
}
void