summaryrefslogtreecommitdiff
path: root/libs/ardour/session_midi.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2006-06-15 01:34:54 +0000
committerDavid Robillard <d@drobilla.net>2006-06-15 01:34:54 +0000
commitb5db1f624d347c8865c27fdae23bf4595be372d2 (patch)
tree19d57731a87490c8de9773b64ee7ba76d244dc73 /libs/ardour/session_midi.cc
parenta8f44b1556e68f4cf28bd52e6de7359581a1ec45 (diff)
Merged with trunk revision 600
git-svn-id: svn://localhost/ardour2/branches/midi@601 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/session_midi.cc')
-rw-r--r--libs/ardour/session_midi.cc19
1 files changed, 12 insertions, 7 deletions
diff --git a/libs/ardour/session_midi.cc b/libs/ardour/session_midi.cc
index 9b6f0bf6ba..f1c4b1e84d 100644
--- a/libs/ardour/session_midi.cc
+++ b/libs/ardour/session_midi.cc
@@ -38,7 +38,7 @@
#include <ardour/audioengine.h>
#include <ardour/session.h>
#include <ardour/audio_track.h>
-#include <ardour/diskstream.h>
+#include <ardour/audio_diskstream.h>
#include <ardour/slave.h>
#include <ardour/cycles.h>
#include <ardour/smpte.h>
@@ -1016,10 +1016,15 @@ Session::send_mmc_in_another_thread (MIDI::MachineControl::Command cmd, jack_nfr
poke_midi_thread ();
}
*/
+
+/** Send an MMC command at the given absolute timestamp (@a where).
+ *
+ * This must be called in the process thread, and @a where must fall within
+ * this process cycle or horrible things will happen.
+ */
void
Session::deliver_mmc (MIDI::MachineControl::Command cmd, jack_nframes_t where)
{
-#if 0
using namespace MIDI;
int nbytes = 4;
SMPTE::Time smpte;
@@ -1030,7 +1035,7 @@ Session::deliver_mmc (MIDI::MachineControl::Command cmd, jack_nframes_t where)
mmc_buffer[nbytes++] = cmd;
- // cerr << "delivering MMC, cmd = " << hex << (int) cmd << dec << endl;
+ cerr << "delivering MMC, cmd = " << hex << (int) cmd << dec << endl;
switch (cmd) {
case MachineControl::cmdLocate:
@@ -1050,6 +1055,7 @@ Session::deliver_mmc (MIDI::MachineControl::Command cmd, jack_nframes_t where)
case MachineControl::cmdPlay:
/* always convert Play into Deferred Play */
+ /* Why? [DR] */
mmc_buffer[4] = MachineControl::cmdDeferredPlay;
break;
@@ -1073,14 +1079,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);
+ //Glib::Mutex::Lock lm (midi_lock);
- if (_mmc_port->write (mmc_buffer, nbytes) != nbytes) {
+ // FIXME: timestamp correct? [DR]
+ if (_mmc_port->write (mmc_buffer, nbytes, where - _transport_frame) != nbytes) {
error << string_compose(_("MMC: cannot send command %1%2%3"), &hex, cmd, &dec) << endmsg;
}
}
-#endif
- cout << "MMC support broken." << endl;
}
bool