From: Carl Hetherington Date: Mon, 10 Jan 2011 22:48:25 +0000 (+0000) Subject: Respond to MMC even when synced to JACK. Fixes #3700. X-Git-Tag: 3.0-alpha5~857 X-Git-Url: https://main.carlh.net/gitweb/?a=commitdiff_plain;h=ed72df29b79f9e2dc7482f07c39010b4523c4a8e;p=ardour.git Respond to MMC even when synced to JACK. Fixes #3700. git-svn-id: svn://localhost/ardour2/branches/3.0@8495 d708f5d6-7413-0410-9779-e7cbd77b26cf --- diff --git a/libs/ardour/session_midi.cc b/libs/ardour/session_midi.cc index f4aef76adc..8dfcec3b5b 100644 --- a/libs/ardour/session_midi.cc +++ b/libs/ardour/session_midi.cc @@ -93,7 +93,7 @@ Session::setup_midi_control () void Session::spp_start (Parser &, framepos_t /*timestamp*/) { - if (Config->get_mmc_control() && (!config.get_external_sync() || config.get_sync_source() != JACK)) { + if (Config->get_mmc_control ()) { request_transport_speed (1.0); } } @@ -107,7 +107,7 @@ Session::spp_continue (Parser& ignored, framepos_t timestamp) void Session::spp_stop (Parser&, framepos_t /*timestamp*/) { - if (Config->get_mmc_control()) { + if (Config->get_mmc_control ()) { request_stop (); } } @@ -115,7 +115,7 @@ Session::spp_stop (Parser&, framepos_t /*timestamp*/) void Session::mmc_deferred_play (MIDI::MachineControl &/*mmc*/) { - if (Config->get_mmc_control() && (!config.get_external_sync() || (config.get_sync_source() != JACK))) { + if (Config->get_mmc_control ()) { request_transport_speed (1.0); } } @@ -123,7 +123,7 @@ Session::mmc_deferred_play (MIDI::MachineControl &/*mmc*/) void Session::mmc_record_pause (MIDI::MachineControl &/*mmc*/) { - if (Config->get_mmc_control()) { + if (Config->get_mmc_control ()) { maybe_enable_record(); } } @@ -160,7 +160,7 @@ Session::mmc_record_strobe (MIDI::MachineControl &/*mmc*/) void Session::mmc_record_exit (MIDI::MachineControl &/*mmc*/) { - if (Config->get_mmc_control()) { + if (Config->get_mmc_control ()) { disable_record (false); } } @@ -168,7 +168,7 @@ Session::mmc_record_exit (MIDI::MachineControl &/*mmc*/) void Session::mmc_stop (MIDI::MachineControl &/*mmc*/) { - if (Config->get_mmc_control()) { + if (Config->get_mmc_control ()) { request_stop (); } } @@ -176,7 +176,7 @@ Session::mmc_stop (MIDI::MachineControl &/*mmc*/) void Session::mmc_pause (MIDI::MachineControl &/*mmc*/) { - if (Config->get_mmc_control()) { + if (Config->get_mmc_control ()) { /* We support RECORD_PAUSE, so the spec says that we must interpret PAUSE like RECORD_PAUSE if @@ -196,7 +196,7 @@ static bool step_queued = false; void Session::mmc_step (MIDI::MachineControl &/*mmc*/, int steps) { - if (!Config->get_mmc_control()) { + if (!Config->get_mmc_control ()) { return; } @@ -251,7 +251,7 @@ Session::mmc_step (MIDI::MachineControl &/*mmc*/, int steps) void Session::mmc_rewind (MIDI::MachineControl &/*mmc*/) { - if (Config->get_mmc_control()) { + if (Config->get_mmc_control ()) { request_transport_speed(-8.0f); } } @@ -259,7 +259,7 @@ Session::mmc_rewind (MIDI::MachineControl &/*mmc*/) void Session::mmc_fast_forward (MIDI::MachineControl &/*mmc*/) { - if (Config->get_mmc_control()) { + if (Config->get_mmc_control ()) { request_transport_speed(8.0f); } } @@ -267,7 +267,7 @@ Session::mmc_fast_forward (MIDI::MachineControl &/*mmc*/) void Session::mmc_locate (MIDI::MachineControl &/*mmc*/, const MIDI::byte* mmc_tc) { - if (!Config->get_mmc_control()) { + if (!Config->get_mmc_control ()) { return; } @@ -308,7 +308,7 @@ Session::mmc_locate (MIDI::MachineControl &/*mmc*/, const MIDI::byte* mmc_tc) void Session::mmc_shuttle (MIDI::MachineControl &/*mmc*/, float speed, bool forw) { - if (!Config->get_mmc_control()) { + if (!Config->get_mmc_control ()) { return; } @@ -326,19 +326,20 @@ Session::mmc_shuttle (MIDI::MachineControl &/*mmc*/, float speed, bool forw) void Session::mmc_record_enable (MIDI::MachineControl &mmc, size_t trk, bool enabled) { - if (Config->get_mmc_control()) { - - RouteList::iterator i; - boost::shared_ptr r = routes.reader(); - - for (i = r->begin(); i != r->end(); ++i) { - AudioTrack *at; + if (!Config->get_mmc_control ()) { + return; + } - if ((at = dynamic_cast((*i).get())) != 0) { - if (trk == at->remote_control_id()) { - at->set_record_enabled (enabled, &mmc); - break; - } + RouteList::iterator i; + boost::shared_ptr r = routes.reader(); + + for (i = r->begin(); i != r->end(); ++i) { + AudioTrack *at; + + if ((at = dynamic_cast((*i).get())) != 0) { + if (trk == at->remote_control_id()) { + at->set_record_enabled (enabled, &mmc); + break; } } }