OSC: Add /path/band extension for eq_* bands
[ardour.git] / gtk2_ardour / ardour_ui.cc
index 91c00065c6d4fe86120fc12ddc767a57d4e1c4a7..4778b6c47db0b94885da56cd8424e2123d4aa976 100644 (file)
 #include <sys/resource.h>
 #endif
 
+#ifdef __FreeBSD__
+#include <sys/types.h>
+#include <sys/sysctl.h>
+#endif
+
 #include <stdint.h>
 #include <fcntl.h>
 #include <signal.h>
@@ -331,8 +336,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
 
        if (string (VERSIONSTRING).find (".pre") != string::npos) {
                /* check this is not being run from ./ardev etc. */
-               gchar const *x = g_getenv ("ARDOUR_THEMES_PATH");
-               if (!x || string (x).find ("gtk2_ardour") == string::npos) {
+               if (!running_from_source_tree ()) {
                        pre_release_dialog ();
                }
        }
@@ -2302,7 +2306,12 @@ ARDOUR_UI::toggle_roll (bool with_abort, bool roll_out_of_bounded_mode)
        if (affect_transport) {
                if (rolling) {
                        _session->request_stop (with_abort, true);
-               } else {
+
+               } else if (!with_abort) { /* with_abort == true means the
+                                          * command was intended to stop
+                                          * transport, not start.
+                                          */
+
                        /* the only external sync condition we can be in here
                         * would be Engine (JACK) sync, in which case we still
                         * want to do this.
@@ -4005,7 +4014,9 @@ ARDOUR_UI::start_duplicate_routes ()
 void
 ARDOUR_UI::add_route ()
 {
-       int count;
+       if (!add_route_dialog.get (false)) {
+               add_route_dialog->signal_response().connect (sigc::mem_fun (*this, &ARDOUR_UI::add_route_dialog_finished));
+       }
 
        if (!_session) {
                return;
@@ -4016,7 +4027,14 @@ ARDOUR_UI::add_route ()
                return;
        }
 
-       ResponseType r = (ResponseType) add_route_dialog->run ();
+       add_route_dialog->set_position (WIN_POS_MOUSE);
+       add_route_dialog->present();
+}
+
+void
+ARDOUR_UI::add_route_dialog_finished (int r)
+{
+       int count;
 
        add_route_dialog->hide();