X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fsession_transport.cc;h=8771af46aa7138df63c17c386571d89a52cb982e;hb=77687519b69f39aaa2354f4c9945958fc1c630fe;hp=fdd67dd67e766fba6f2763d2a9192bb0d380e1f7;hpb=7ffeb70b1b29df553b3b3d49b0215c7a0d5d4a4c;p=ardour.git diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc index fdd67dd67e..8771af46aa 100644 --- a/libs/ardour/session_transport.cc +++ b/libs/ardour/session_transport.cc @@ -47,7 +47,7 @@ #include "ardour/slave.h" #include "ardour/operations.h" -#include "i18n.h" +#include "pbd/i18n.h" using namespace std; using namespace ARDOUR; @@ -163,6 +163,12 @@ Session::force_locate (framepos_t target_frame, bool with_roll) void Session::request_play_loop (bool yn, bool change_transport_roll) { + if (_slave && yn) { + // don't attempt to loop when not using Internal Transport + // see also gtk2_ardour/ardour_ui_options.cc parameter_changed() + return; + } + SessionEvent* ev; Location *location = _locations->auto_loop_location(); double target_speed; @@ -367,6 +373,12 @@ Session::butler_transport_work () } if (ptw & PostTransportAdjustPlaybackBuffering) { + /* non_realtime_locate() calls Automatable::transport_located() + * for every route. This eventually calls + * ARDOUR::AutomationList::state () which has a LocaleGuard, + * and would switch locales forth/back every time. + */ + LocaleGuard lg; for (RouteList::iterator i = r->begin(); i != r->end(); ++i) { boost::shared_ptr tr = boost::dynamic_pointer_cast (*i); if (tr) { @@ -415,7 +427,7 @@ Session::butler_transport_work () /* don't seek if locate will take care of that in non_realtime_stop() */ if (!(ptw & PostTransportLocate)) { - + LocaleGuard lg; // see note for non_realtime_locate() above for (RouteList::iterator i = r->begin(); i != r->end(); ++i) { (*i)->non_realtime_locate (_transport_frame); @@ -524,9 +536,12 @@ Session::non_realtime_locate () } - boost::shared_ptr rl = routes.reader(); - for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) { - (*i)->non_realtime_locate (_transport_frame); + { + LocaleGuard lg; // see note for non_realtime_locate() above + boost::shared_ptr rl = routes.reader(); + for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) { + (*i)->non_realtime_locate (_transport_frame); + } } _scene_changer->locate (_transport_frame); @@ -783,15 +798,18 @@ Session::non_realtime_stop (bool abort, int on_entry, bool& finished) /* this for() block can be put inside the previous if() and has the effect of ... ??? what */ - DEBUG_TRACE (DEBUG::Transport, X_("Butler PTW: locate\n")); - for (RouteList::iterator i = r->begin(); i != r->end(); ++i) { - DEBUG_TRACE (DEBUG::Transport, string_compose ("Butler PTW: locate on %1\n", (*i)->name())); - (*i)->non_realtime_locate (_transport_frame); + { + LocaleGuard lg; // see note for non_realtime_locate() above + DEBUG_TRACE (DEBUG::Transport, X_("Butler PTW: locate\n")); + for (RouteList::iterator i = r->begin(); i != r->end(); ++i) { + DEBUG_TRACE (DEBUG::Transport, string_compose ("Butler PTW: locate on %1\n", (*i)->name())); + (*i)->non_realtime_locate (_transport_frame); - if (on_entry != g_atomic_int_get (&_butler->should_do_transport_work)) { - finished = false; - /* we will be back */ - return; + if (on_entry != g_atomic_int_get (&_butler->should_do_transport_work)) { + finished = false; + /* we will be back */ + return; + } } } @@ -1138,12 +1156,9 @@ Session::locate (framepos_t target_frame, bool with_roll, bool with_flush, bool } // Update Timecode time - // [DR] FIXME: find out exactly where this should go below _transport_frame = target_frame; _last_roll_or_reversal_location = target_frame; timecode_time(_transport_frame, transmitting_timecode_time); - outbound_mtc_timecode_frame = _transport_frame; - next_quarter_frame_to_send = 0; /* do "stopped" stuff if: * @@ -1250,7 +1265,7 @@ Session::locate (framepos_t target_frame, bool with_roll, bool with_flush, bool for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) { boost::shared_ptr tr = boost::dynamic_pointer_cast (*i); - if (tr && tr->record_enabled ()) { + if (tr && tr->rec_enable_control()->get_value()) { // tell it we've looped, so it can deal with the record state tr->transport_looped (_transport_frame); }