From 81857a947c106586e2a90c46cb8f69cdd3ad600d Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 28 Nov 2018 15:24:47 +0100 Subject: [PATCH] Consolidate ambiguous engine API calls available(), connected(), running() were ill-defined and used interchangeably. --- libs/ardour/port.cc | 6 +++--- libs/ardour/route.cc | 10 +++++----- libs/ardour/session.cc | 4 ++-- libs/ardour/session_export.cc | 2 +- libs/ardour/session_transport.cc | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/libs/ardour/port.cc b/libs/ardour/port.cc index 3c31094dae..eb7ca913d2 100644 --- a/libs/ardour/port.cc +++ b/libs/ardour/port.cc @@ -72,7 +72,7 @@ Port::Port (std::string const & n, DataType t, PortFlags f) assert (_name.find_first_of (':') == std::string::npos); - if (!port_engine.available ()) { + if (!port_manager->running ()) { DEBUG_TRACE (DEBUG::Ports, string_compose ("port-engine n/a postpone registering %1\n", name())); _port_handle = 0; // created during ::reestablish() later } else if ((_port_handle = port_engine.register_port (_name, t, _flags)) == 0) { @@ -205,7 +205,7 @@ Port::connected_to (std::string const & o) const return false; } - if (!port_engine.available()) { + if (!port_manager->running()) { return false; } @@ -215,7 +215,7 @@ Port::connected_to (std::string const & o) const int Port::get_connections (std::vector & c) const { - if (!port_engine.available()) { + if (!port_manager->running()) { c.insert (c.end(), _connections.begin(), _connections.end()); return c.size(); } diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index a05ccbe903..9a2559e240 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -1286,7 +1286,7 @@ Route::ab_plugins (bool forward) void Route::clear_processors (Placement p) { - if (!_session.engine().connected()) { + if (!_session.engine().running()) { return; } @@ -1391,7 +1391,7 @@ Route::remove_processor (boost::shared_ptr processor, ProcessorStream return 0; } - if (!_session.engine().connected()) { + if (!_session.engine().running()) { return 1; } @@ -1507,7 +1507,7 @@ Route::replace_processor (boost::shared_ptr old, boost::shared_ptrconnected() || !old || !sub) { + if (!AudioEngine::instance()->running() || !old || !sub) { return 1; } @@ -1588,7 +1588,7 @@ Route::remove_processors (const ProcessorList& to_be_deleted, ProcessorStreams* { ProcessorList deleted; - if (!_session.engine().connected()) { + if (!_session.engine().running()) { return 1; } @@ -3283,7 +3283,7 @@ Route::remove_aux_or_listen (boost::shared_ptr route) /* list could have been demolished while we dropped the lock so start over. */ - if (_session.engine().connected()) { + if (_session.engine().running()) { /* i/o processors cannot be removed if the engine is not running * so don't live-loop in case the engine is N/A or dies */ diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 6fd6a9474c..1a33adc7d1 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -6931,7 +6931,7 @@ Session::set_worst_output_latency () _worst_output_latency = 0; - if (!_engine.connected()) { + if (!_engine.running()) { return; } @@ -6955,7 +6955,7 @@ Session::set_worst_input_latency () _worst_input_latency = 0; - if (!_engine.connected()) { + if (!_engine.running()) { return; } diff --git a/libs/ardour/session_export.cc b/libs/ardour/session_export.cc index 879f34020a..37bdbebe5d 100644 --- a/libs/ardour/session_export.cc +++ b/libs/ardour/session_export.cc @@ -172,7 +172,7 @@ Session::start_audio_export (samplepos_t position, bool realtime, bool region_ex /* we are ready to go ... */ - if (!_engine.connected()) { + if (!_engine.running()) { return -1; } diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc index 99ce3e46ed..cc46cffad9 100644 --- a/libs/ardour/session_transport.cc +++ b/libs/ardour/session_transport.cc @@ -925,7 +925,7 @@ Session::non_realtime_stop (bool abort, int on_entry, bool& finished) because there will be no process callbacks to deliver stuff from */ - if (_engine.connected() && !_engine.freewheeling()) { + if (_engine.running() && !_engine.freewheeling()) { // need to queue this in the next RT cycle _send_timecode_update = true; -- 2.30.2