GUI limitation: Require engine to add/remove tracks/busses
authorRobin Gareus <robin@gareus.org>
Tue, 27 Nov 2018 12:18:39 +0000 (13:18 +0100)
committerRobin Gareus <robin@gareus.org>
Tue, 27 Nov 2018 12:18:39 +0000 (13:18 +0100)
gtk2_ardour/ardour_ui.cc
gtk2_ardour/editor_drag.cc
gtk2_ardour/editor_ops.cc
gtk2_ardour/route_ui.cc

index 0523f9a8d11f9843c3800d8fbfc24b813cd52d31..7fcb7c74b59183f3cec59bef8d5ceb54a048a6f0 100644 (file)
@@ -4353,6 +4353,20 @@ ARDOUR_UI::add_route_dialog_response (int r)
                return;
        }
 
+       if (!AudioEngine::instance()->running ()) {
+               switch (r) {
+                       case AddRouteDialog::Add:
+                       case AddRouteDialog::AddAndClose:
+                               break;
+                       default:
+                               return;
+               }
+               add_route_dialog->ArdourDialog::on_response (r);
+               MessageDialog msg (_("Not connected to audio engine - Adding Tracks/Busses is not possible"));
+               msg.run ();
+               return;
+       }
+
        int count;
 
        switch (r) {
index 654cca2a162d7cfb9409265c4eed782ca4d4e789..5310eeed337ed104e63abe3a2ed50e51b58927d6 100644 (file)
@@ -1428,6 +1428,11 @@ RegionMoveDrag::finished (GdkEvent* ev, bool movement_occurred)
 RouteTimeAxisView*
 RegionMoveDrag::create_destination_time_axis (boost::shared_ptr<Region> region, TimeAxisView* original)
 {
+       if (!AudioEngine::instance()->running ()) {
+               error << _("Not connected to audio engine - Could not create new track after region placed in the drop zone") << endmsg;
+               return NULL;
+       }
+
        /* Add a new track of the correct type, and return the RouteTimeAxisView that is created to display the
           new track.
         */
index 50ead21c33b0c3107493520d6330157aa08a0d9c..3675a02fc528274cc518d48af57ce669cc178222 100644 (file)
@@ -45,6 +45,7 @@
 #include "widgets/prompter.h"
 
 #include "ardour/audio_track.h"
+#include "ardour/audioengine.h"
 #include "ardour/audioregion.h"
 #include "ardour/boost_debug.h"
 #include "ardour/dB.h"
@@ -7420,6 +7421,12 @@ Editor::_remove_tracks ()
                return;
        }
 
+       if (!AudioEngine::instance()->running ()) {
+               MessageDialog msg (_("Not connected to audio engine - Removing Tracks/Busses is not possible"));
+               msg.run ();
+               return;
+       }
+
        vector<string> choices;
        string prompt;
        int ntracks = 0;
index b9ece1ed075340a57381854de54e4976696dfa5e..752a951850d84cff5b94cd07f07223414081ef17 100644 (file)
@@ -2323,6 +2323,12 @@ RouteUI::manage_pins ()
 void
 RouteUI::fan_out (bool to_busses, bool group)
 {
+       if (!AudioEngine::instance()->running ()) {
+               MessageDialog msg (_("Not connected to audio engine - Fanning out to Tracks/Busses is not possible"));
+               msg.run ();
+               return;
+       }
+
        DisplaySuspender ds;
        boost::shared_ptr<ARDOUR::Route> route = _route;
        boost::shared_ptr<PluginInsert> pi = boost::dynamic_pointer_cast<PluginInsert> (route->the_instrument ());