return 1;
}
+#ifndef NDEBUG
+ const int64_t save_start_time = g_get_monotonic_time();
+#endif
+
/* tell sources we're saving first, in case they write out to a new file
* which should be saved with the state rather than the old one */
for (SourceMap::const_iterator i = sources.begin(); i != sources.end(); ++i) {
StateSaved (snapshot_name); /* EMIT SIGNAL */
}
+#ifndef NDEBUG
+ const int64_t elapsed_time_us = g_get_monotonic_time() - save_start_time;
+ cerr << "saved state in " << fixed << setprecision (1) << elapsed_time_us / 1000. << " ms\n";
+#endif
return 0;
}
snprintf (buf, sizeof (buf), "%" PRIu64, ID::counter());
node->add_property ("id-counter", buf);
+ snprintf (buf, sizeof (buf), "%u", name_id_counter ());
+ node->add_property ("name-counter", buf);
+
/* save the event ID counter */
snprintf (buf, sizeof (buf), "%d", Evoral::event_id_counter());
ID::init_counter (now);
}
- if ((prop = node.property (X_("event-counter"))) != 0) {
- Evoral::init_event_id_counter (atoi (prop->value()));
- }
+ if ((prop = node.property (X_("name-counter"))) != 0) {
+ init_name_id_counter (atoi (prop->value()));
+ }
+ if ((prop = node.property (X_("event-counter"))) != 0) {
+ Evoral::init_event_id_counter (atoi (prop->value()));
+ }
if ((child = find_named_node (node, "MIDIPorts")) != 0) {
_midi_ports->set_midi_port_states (child->children());
cmd->name ()));
_current_trans->add_command (cmd);
}
+
+PBD::StatefulDiffCommand*
+Session::add_stateful_diff_command (boost::shared_ptr<PBD::StatefulDestructible> sfd)
+{
+ PBD::StatefulDiffCommand* cmd = new PBD::StatefulDiffCommand (sfd);
+ add_command (cmd);
+ return cmd;
+}
+
void
Session::begin_reversible_command (const string& name)
{