diff options
author | Carl Hetherington <carl@carlh.net> | 2010-12-01 17:51:17 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-12-01 17:51:17 +0000 |
commit | bce9a0aee7dcb27f17f1b938109eda9b96228217 (patch) | |
tree | 64ad2de2afa5247071ca8c5eaa3226a7e27e6d53 /gtk2_ardour/editor.cc | |
parent | f500846fd46d6eab97e5e02fd795b9a938464773 (diff) |
Revert previous incorrect patch.
git-svn-id: svn://localhost/ardour2/branches/3.0@8144 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor.cc')
-rw-r--r-- | gtk2_ardour/editor.cc | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 73ed8e6a5d..63d580c054 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -1090,6 +1090,7 @@ Editor::set_session (Session *t) _session->PositionChanged.connect (_session_connections, invalidator (*this), ui_bind (&Editor::map_position_change, this, _1), gui_context()); _session->RouteAdded.connect (_session_connections, invalidator (*this), ui_bind (&Editor::handle_new_route, this, _1), gui_context()); _session->DirtyChanged.connect (_session_connections, invalidator (*this), boost::bind (&Editor::update_title, this), gui_context()); + _session->TimecodeOffsetChanged.connect (_session_connections, invalidator (*this), boost::bind (&Editor::update_just_timecode, this), gui_context()); _session->tempo_map().PropertyChanged.connect (_session_connections, invalidator (*this), ui_bind (&Editor::tempo_map_changed, this, _1), gui_context()); _session->Located.connect (_session_connections, invalidator (*this), boost::bind (&Editor::located, this), gui_context()); _session->config.ParameterChanged.connect (_session_connections, invalidator (*this), ui_bind (&Editor::parameter_changed, this, _1), gui_context()); @@ -2428,19 +2429,44 @@ Editor::timecode_snap_to_internal (framepos_t& start, int32_t direction, bool /* break; case SnapToTimecodeSeconds: + if (_session->timecode_offset_negative()) + { + start += _session->timecode_offset (); + } else { + start -= _session->timecode_offset (); + } if (((direction == 0) && (start % one_timecode_second > one_timecode_second / 2)) || direction > 0) { start = (framepos_t) ceil ((double) start / one_timecode_second) * one_timecode_second; } else { start = (framepos_t) floor ((double) start / one_timecode_second) * one_timecode_second; } + + if (_session->timecode_offset_negative()) + { + start -= _session->timecode_offset (); + } else { + start += _session->timecode_offset (); + } break; case SnapToTimecodeMinutes: + if (_session->timecode_offset_negative()) + { + start += _session->timecode_offset (); + } else { + start -= _session->timecode_offset (); + } if (((direction == 0) && (start % one_timecode_minute > one_timecode_minute / 2)) || direction > 0) { start = (framepos_t) ceil ((double) start / one_timecode_minute) * one_timecode_minute; } else { start = (framepos_t) floor ((double) start / one_timecode_minute) * one_timecode_minute; } + if (_session->timecode_offset_negative()) + { + start -= _session->timecode_offset (); + } else { + start += _session->timecode_offset (); + } break; default: fatal << "Editor::smpte_snap_to_internal() called with non-timecode snap type!" << endmsg; |