diff options
author | Carl Hetherington <carl@carlh.net> | 2010-07-08 22:55:20 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-07-08 22:55:20 +0000 |
commit | 648a169d8ff9987ba727e9ba50af4f33da6db165 (patch) | |
tree | d8e250205004633a9f5c94e15e8f3826fac183b6 /libs/ardour/session_midi.cc | |
parent | 3549189f87813b8c9f01f2f6484b34cf923a65ad (diff) |
Move MIDI control port ownership into the MIDI Manager, since control port state should be Ardour-wide, not per-session. Fix up port connection state management.
git-svn-id: svn://localhost/ardour2/branches/3.0@7394 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/session_midi.cc')
-rw-r--r-- | libs/ardour/session_midi.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libs/ardour/session_midi.cc b/libs/ardour/session_midi.cc index 29040dc4df..3a27b1803b 100644 --- a/libs/ardour/session_midi.cc +++ b/libs/ardour/session_midi.cc @@ -130,8 +130,9 @@ Session::mmc_record_pause (MIDI::MachineControl &/*mmc*/) void Session::mmc_record_strobe (MIDI::MachineControl &/*mmc*/) { - if (!Config->get_mmc_control()) + if (!Config->get_mmc_control()) { return; + } /* record strobe does an implicit "Play" command */ @@ -358,7 +359,7 @@ Session::send_full_time_code (nframes64_t const t) _send_timecode_update = false; - if (_mtc_output_port == 0 || !session_send_mtc || _slave) { + if (!session_send_mtc || _slave) { return 0; } @@ -393,7 +394,7 @@ Session::send_full_time_code (nframes64_t const t) msg[8] = timecode.frames; // Send message at offset 0, sent time is for the start of this cycle - if (_mtc_output_port->midimsg (msg, sizeof (msg), 0)) { + if (MIDI::Manager::instance()->mtc_output_port()->midimsg (msg, sizeof (msg), 0)) { error << _("Session: could not send full MIDI time code") << endmsg; return -1; } @@ -411,7 +412,7 @@ Session::send_full_time_code (nframes64_t const t) int Session::send_midi_time_code_for_cycle(nframes_t nframes) { - if (_mtc_output_port == 0 || _slave || !session_send_mtc || transmitting_timecode_time.negative || (next_quarter_frame_to_send < 0)) { + if (_slave || !session_send_mtc || transmitting_timecode_time.negative || (next_quarter_frame_to_send < 0)) { // cerr << "(MTC) Not sending MTC\n"; return 0; } @@ -472,7 +473,7 @@ Session::send_midi_time_code_for_cycle(nframes_t nframes) nframes_t out_stamp = msg_time - _transport_frame; assert(out_stamp < nframes); - if (_mtc_output_port->midimsg (mtc_msg, 2, out_stamp)) { + if (MIDI::Manager::instance()->mtc_output_port()->midimsg (mtc_msg, 2, out_stamp)) { error << string_compose(_("Session: cannot send quarter-frame MTC message (%1)"), strerror (errno)) << endmsg; return -1; |