diff options
author | David Robillard <d@drobilla.net> | 2006-06-16 02:28:41 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2006-06-16 02:28:41 +0000 |
commit | 6a1f2919f20286b7d51de8e9c02107ab42f8e763 (patch) | |
tree | 5cd9cabfb69b5bd6d6a0239d3b22479a601aa961 /libs/ardour/session_midi.cc | |
parent | e13e84677a9213fb54d641483a7fcf5ecf2feb0d (diff) |
Preliminary MMC sending
git-svn-id: svn://localhost/ardour2/branches/midi@614 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/session_midi.cc')
-rw-r--r-- | libs/ardour/session_midi.cc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/libs/ardour/session_midi.cc b/libs/ardour/session_midi.cc index f1c4b1e84d..e1fab1ccfe 100644 --- a/libs/ardour/session_midi.cc +++ b/libs/ardour/session_midi.cc @@ -146,11 +146,15 @@ Session::set_send_mtc (bool yn) void Session::set_send_mmc (bool yn) { + cerr << "set send mmc " << yn << endl; + if (_mmc_port == 0) { + cerr << "\tno 1\n"; return; } if (send_midi_machine_control == yn) { + cerr << "\tno 2\n"; return; } @@ -159,6 +163,7 @@ Session::set_send_mmc (bool yn) */ if (_mmc_port) { + cerr << "\tyes\n"; send_mmc = yn; } @@ -1030,6 +1035,7 @@ Session::deliver_mmc (MIDI::MachineControl::Command cmd, jack_nframes_t where) SMPTE::Time smpte; if (_mmc_port == 0 || !send_mmc) { + cerr << "Not delivering MMC " << _mmc_port << " - " << send_mmc << endl; return; } @@ -1079,11 +1085,13 @@ Session::deliver_mmc (MIDI::MachineControl::Command cmd, jack_nframes_t where) mmc_buffer[nbytes++] = 0xf7; // terminate SysEx/MMC message - //Glib::Mutex::Lock lm (midi_lock); - + assert(where >= _transport_frame); + // FIXME: timestamp correct? [DR] - if (_mmc_port->write (mmc_buffer, nbytes, where - _transport_frame) != nbytes) { + if (!_mmc_port->midimsg (mmc_buffer, sizeof (mmc_buffer), where - _transport_frame)) { error << string_compose(_("MMC: cannot send command %1%2%3"), &hex, cmd, &dec) << endmsg; + } else { + cerr << "Sending MMC\n"; } } } |