Consolidate two more engine-checks

This commit is contained in:
Robin Gareus 2018-11-28 15:17:57 +01:00
parent 245d48dbd0
commit 0805b6b925
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 7 additions and 5 deletions

View File

@ -48,6 +48,7 @@
#include "gui_thread.h"
#include "timers.h"
#include "ui_config.h"
#include "utils.h"
#include "pbd/i18n.h"
@ -1794,8 +1795,11 @@ PluginPinWidget::sc_input_press (GdkEventButton *ev, boost::weak_ptr<ARDOUR::Por
{
using namespace Menu_Helpers;
assert (_session);
if (_session->actively_recording () || !_session->engine ().connected ()) {
error_message_dialog (_("Port Connections are only available with active Audio/MIDI system."));
if (!ARDOUR_UI_UTILS::engine_is_running ()) {
return false;
}
if (_session->actively_recording ()) {
error_message_dialog (/* unused */ "");
return false;
}

View File

@ -773,9 +773,7 @@ RouteUI::rec_enable_press(GdkEventButton* ev)
if (BindingProxy::is_bind_action(ev) )
return false;
if (!_session->engine().connected()) {
MessageDialog msg (_("Not connected to AudioEngine - cannot engage record"));
msg.run ();
if (!ARDOUR_UI_UTILS::engine_is_running ()) {
return false;
}