act = ActionManager::register_toggle_action (option_actions, X_("SendMTC"), _("Send MTC"), mem_fun (*this, &ARDOUR_UI::toggle_send_mtc));
ActionManager::session_sensitive_actions.push_back (act);
- act = ActionManager::register_toggle_action (option_actions, X_("SendMMC"), _("Send MMC"), mem_fun (*this, &ARDOUR_UI::toggle_send_mtc));
+ act = ActionManager::register_toggle_action (option_actions, X_("SendMMC"), _("Send MMC"), mem_fun (*this, &ARDOUR_UI::toggle_send_mmc));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_toggle_action (option_actions, X_("UseMMC"), _("Use MMC"), mem_fun (*this, &ARDOUR_UI::toggle_use_mmc));
ActionManager::session_sensitive_actions.push_back (act);
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;
}
*/
if (_mmc_port) {
+ cerr << "\tyes\n";
send_mmc = yn;
}
SMPTE::Time smpte;
if (_mmc_port == 0 || !send_mmc) {
+ cerr << "Not delivering MMC " << _mmc_port << " - " << send_mmc << endl;
return;
}
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";
}
}
}
Session::realtime_stop (bool abort)
{
/* assume that when we start, we'll be moving forwards */
+
+ // FIXME: where should this really be? [DR]
+ //send_full_time_code();
+ deliver_mmc (MIDI::MachineControl::cmdStop, _transport_frame);
+ deliver_mmc (MIDI::MachineControl::cmdLocate, _transport_frame);
if (_transport_speed < 0.0f) {
post_transport_work = PostTransportWork (post_transport_work | PostTransportStop | PostTransportReverse);
last_stop_frame = _transport_frame;
- /* FIXME
- send_full_time_code();
- deliver_mmc (MIDI::MachineControl::cmdStop, 0);
- deliver_mmc (MIDI::MachineControl::cmdLocate, _transport_frame);
- */
-
if (did_record) {
/* XXX its a little odd that we're doing this here
(*i)->realtime_set_speed ((*i)->speed(), true);
}
- /* FIXME
- send_mmc_in_another_thread (MIDI::MachineControl::cmdDeferredPlay, 0);
- */
+ deliver_mmc(MIDI::MachineControl::cmdDeferredPlay, _transport_frame);
TransportStateChange (); /* EMIT SIGNAL */
}