13
0

save nudge clock value; don't reset the nudge clock mode when loading a session (possibly some finessing required here, since presumably mode and value should be per-session and are saved in the session instant.xml anyway)

git-svn-id: svn://localhost/ardour2/branches/3.0@11721 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2012-03-17 14:10:44 +00:00
parent 0a8c0c96ef
commit 685d8ffba7

View File

@ -1213,20 +1213,6 @@ Editor::set_session (Session *t)
_session->locations()->StateChanged.connect (_session_connections, invalidator (*this), ui_bind (&Editor::refresh_location_display, this), gui_context());
_session->history().Changed.connect (_session_connections, invalidator (*this), boost::bind (&Editor::history_changed, this), gui_context());
if (Profile->get_sae()) {
Timecode::BBT_Time bbt;
bbt.bars = 0;
bbt.beats = 0;
bbt.ticks = 120;
framepos_t pos = _session->tempo_map().bbt_duration_at (0, bbt, 1);
nudge_clock->set_mode(AudioClock::BBT);
nudge_clock->set (pos, true);
} else {
nudge_clock->set_mode (AudioClock::Timecode);
nudge_clock->set (_session->frame_rate() * 5, true);
}
playhead_cursor->canvas_item.show ();
boost::function<void (string)> pc (boost::bind (&Editor::parameter_changed, this, _1));
@ -2405,6 +2391,15 @@ Editor::set_state (const XMLNode& node, int /*version*/)
}
}
if ((prop = node.property ("nudge-clock-value"))) {
framepos_t f;
sscanf (prop->value().c_str(), "%" PRId64, &f);
nudge_clock->set (f);
} else {
nudge_clock->set_mode (AudioClock::Timecode);
nudge_clock->set (_session->frame_rate() * 5, true);
}
return 0;
}
@ -2499,6 +2494,9 @@ Editor::get_state ()
node->add_child_nocopy (selection->get_state ());
node->add_child_nocopy (_regions->get_state ());
snprintf (buf, sizeof (buf), "%" PRId64, nudge_clock->current_duration());
node->add_property ("nudge-clock-value", buf);
return *node;
}