Setup fixed ports for MIDI control data; hence remove configuration of those ports...
[ardour.git] / libs / ardour / session_transport.cc
index 8af9f0ca7b772fd32e590dbcec017e908e08c534..1123a6038b8388f4bf63a741f02eb0dbdd46527f 100644 (file)
@@ -183,11 +183,9 @@ Session::realtime_stop (bool abort, bool clear_state)
 
        // FIXME: where should this really be? [DR]
        //send_full_time_code();
-       Timecode::Time time;
-       timecode_time_subframes (_transport_frame, time);
        
        _mmc->send (MIDI::MachineControlCommand (MIDI::MachineControl::cmdStop));
-       _mmc->send (MIDI::MachineControlCommand (time));
+       send_mmc_locate (_transport_frame);
 
        if (_transport_speed < 0.0f) {
                todo = (PostTransportWork (todo | PostTransportStop | PostTransportReverse));
@@ -896,9 +894,7 @@ Session::locate (nframes64_t target_frame, bool with_roll, bool with_flush, bool
        _send_timecode_update = true;
 
        if (with_mmc) {
-               Timecode::Time time;
-               timecode_time_subframes (_transport_frame, time);
-               _mmc->send (MIDI::MachineControlCommand (time));
+               send_mmc_locate (_transport_frame);
        }
 
        Located (); /* EMIT SIGNAL */
@@ -1250,9 +1246,9 @@ Session::switch_to_sync_source (SyncSource src)
                        return;
                }
 
-               if (_mtc_port) {
+               if (_mtc_input_port) {
                        try {
-                               new_slave = new MTC_Slave (*this, *_mtc_port);
+                               new_slave = new MTC_Slave (*this, *_mtc_input_port);
                        }
 
                        catch (failed_constructor& err) {
@@ -1270,9 +1266,9 @@ Session::switch_to_sync_source (SyncSource src)
                        return;
                }
 
-               if (_midi_clock_port) {
+               if (_midi_clock_input_port) {
                        try {
-                               new_slave = new MIDIClock_Slave (*this, *_midi_clock_port, 24);
+                               new_slave = new MIDIClock_Slave (*this, *_midi_clock_input_port, 24);
                        }
 
                        catch (failed_constructor& err) {
@@ -1568,3 +1564,11 @@ Session::maybe_stop (nframes_t limit)
        }
        return false;
 }
+
+void
+Session::send_mmc_locate (nframes64_t t)
+{
+       Timecode::Time time;
+       timecode_time_subframes (t, time);
+       _mmc->send (MIDI::MachineControlCommand (time));
+}