diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-03-17 14:10:44 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-03-17 14:10:44 +0000 |
commit | 685d8ffba78c49feee91f00184a33b3cc924b388 (patch) | |
tree | 8b5d5608aea24833940b5594cbb16987724ebc5d /gtk2_ardour/editor.cc | |
parent | 0a8c0c96ef0085f69719e8aeda212c0099c24259 (diff) |
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
Diffstat (limited to 'gtk2_ardour/editor.cc')
-rw-r--r-- | gtk2_ardour/editor.cc | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 7cebd04d98..5086305b01 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -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; } |