Use MTC instead of MIDI Timecode as the string for the external sync button. Fixes...
[ardour.git] / gtk2_ardour / editor.cc
index 70aef3e5a7c5fe7c681c10fc3b4604ab986f0b51..cfa8770ba393479c5c0b8babef2e98cd1729ee57 100644 (file)
@@ -1090,7 +1090,6 @@ 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());
@@ -1102,11 +1101,11 @@ Editor::set_session (Session *t)
        _session->history().Changed.connect (_session_connections, invalidator (*this), boost::bind (&Editor::history_changed, this), gui_context());
 
        if (Profile->get_sae()) {
-               BBT_Time bbt;
+               Timecode::BBT_Time bbt;
                bbt.bars = 0;
                bbt.beats = 0;
                bbt.ticks = 120;
-               nframes_t pos = _session->tempo_map().bbt_duration_at (0, bbt, 1);
+               framepos_t pos = _session->tempo_map().bbt_duration_at (0, bbt, 1);
                nudge_clock.set_mode(AudioClock::BBT);
                nudge_clock.set (pos, true, 0, AudioClock::BBT);
 
@@ -1745,7 +1744,7 @@ Editor::add_selection_context_items (Menu_Helpers::MenuList& edit_items)
        }
 
        edit_items.push_back (SeparatorElem());
-       edit_items.push_back (MenuElem (_("Convert to region in-place"), mem_fun(*this, &Editor::separate_region_from_selection)));
+       edit_items.push_back (MenuElem (_("Convert to Region In-Place"), mem_fun(*this, &Editor::separate_region_from_selection)));
        edit_items.push_back (MenuElem (_("Convert to Region in Region List"), sigc::mem_fun(*this, &Editor::new_region_from_selection)));
 
        edit_items.push_back (SeparatorElem());
@@ -2429,11 +2428,10 @@ Editor::timecode_snap_to_internal (framepos_t& start, int32_t direction, bool /*
                break;
 
        case SnapToTimecodeSeconds:
-               if (_session->timecode_offset_negative())
-               {
-                       start += _session->timecode_offset ();
+               if (_session->config.get_timecode_offset_negative()) {
+                       start += _session->config.get_timecode_offset ();
                } else {
-                       start -= _session->timecode_offset ();
+                       start -= _session->config.get_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;
@@ -2441,31 +2439,28 @@ Editor::timecode_snap_to_internal (framepos_t& start, int32_t direction, bool /*
                        start = (framepos_t) floor ((double) start / one_timecode_second) * one_timecode_second;
                }
 
-               if (_session->timecode_offset_negative())
-               {
-                       start -= _session->timecode_offset ();
+               if (_session->config.get_timecode_offset_negative()) {
+                       start -= _session->config.get_timecode_offset ();
                } else {
-                       start += _session->timecode_offset ();
+                       start += _session->config.get_timecode_offset ();
                }
                break;
 
        case SnapToTimecodeMinutes:
-               if (_session->timecode_offset_negative())
-               {
-                       start += _session->timecode_offset ();
+               if (_session->config.get_timecode_offset_negative()) {
+                       start += _session->config.get_timecode_offset ();
                } else {
-                       start -= _session->timecode_offset ();
+                       start -= _session->config.get_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 ();
+               if (_session->config.get_timecode_offset_negative()) {
+                       start -= _session->config.get_timecode_offset ();
                } else {
-                       start += _session->timecode_offset ();
+                       start += _session->config.get_timecode_offset ();
                }
                break;
        default: