summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-09-17 21:07:14 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2013-09-17 21:07:14 -0400
commitc698ada035de4d880c385d17de53ecfa840d33af (patch)
tree20ac936b34c2bb20df60a00d2f57e29a85949015 /gtk2_ardour
parentb7c15bc9fd1ac9cc02c6d0e7c7f2c4b190661c29 (diff)
change return type on {disconnect_from,reconnect_to}_engine() and make public so that we can use these when doing intentional disconnects without popping up the "HALTED" dialog
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/ardour_ui.cc12
-rw-r--r--gtk2_ardour/ardour_ui.h5
2 files changed, 11 insertions, 6 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index 547eaf4e39..eccd37fec2 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -3786,7 +3786,7 @@ audio may be played at the wrong sample rate.\n"), desired, PROGRAM_NAME, actual
return 1;
}
-void
+int
ARDOUR_UI::disconnect_from_engine ()
{
/* drop connection to AudioEngine::Halted so that we don't act
@@ -3795,24 +3795,28 @@ ARDOUR_UI::disconnect_from_engine ()
halt_connection.disconnect ();
if (AudioEngine::instance()->stop ()) {
- MessageDialog msg (*editor, _("Could not disconnect from JACK"));
+ MessageDialog msg (*editor, _("Could not disconnect from Audio/MIDI engine"));
msg.run ();
+ return -1;
} else {
AudioEngine::instance()->Halted.connect_same_thread (halt_connection, boost::bind (&ARDOUR_UI::engine_halted, this, _1, false));
}
update_sample_rate (0);
+ return 0;
}
-void
+int
ARDOUR_UI::reconnect_to_engine ()
{
if (AudioEngine::instance()->start ()) {
- MessageDialog msg (*editor, _("Could not reconnect to JACK"));
+ MessageDialog msg (*editor, _("Could not reconnect to the Audio/MIDI engine"));
msg.run ();
+ return -1;
}
update_sample_rate (0);
+ return 0;
}
void
diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h
index fa8eb18f01..c84a279320 100644
--- a/gtk2_ardour/ardour_ui.h
+++ b/gtk2_ardour/ardour_ui.h
@@ -289,6 +289,9 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
const std::string& announce_string() const { return _announce_string; }
+ int disconnect_from_engine ();
+ int reconnect_to_engine ();
+
protected:
friend class PublicEditor;
@@ -667,8 +670,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
int pending_state_dialog ();
int sr_mismatch_dialog (ARDOUR::framecnt_t, ARDOUR::framecnt_t);
- void disconnect_from_engine ();
- void reconnect_to_engine ();
void set_engine_buffer_size (ARDOUR::pframes_t);
Gtk::MenuItem* jack_disconnect_item;