enough with umpteen "i18n.h" files. Consolidate on pbd/i18n.h
[ardour.git] / gtk2_ardour / ardour_ui.cc
index a348f7c9f4e7e054f18b3358c6d06afa94e3fd1f..9c627dcb01a52491ae0a926cc12338c4b306a692 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>
@@ -172,7 +177,7 @@ typedef uint64_t microseconds_t;
 #include "add_video_dialog.h"
 #include "transcode_video_dialog.h"
 
-#include "i18n.h"
+#include "pbd/i18n.h"
 
 using namespace ARDOUR;
 using namespace ARDOUR_UI_UTILS;
@@ -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.
@@ -3565,6 +3574,11 @@ ARDOUR_UI::build_session (const std::string& path, const std::string& snap_name,
                new_session->add_instant_xml (*n, false);
        }
 
+       n = Config->instant_xml (X_("Preferences"));
+       if (n) {
+               new_session->add_instant_xml (*n, false);
+       }
+
        /* Put the playhead at 0 and scroll fully left */
        n = new_session->instant_xml (X_("Editor"));
        if (n) {
@@ -4535,6 +4549,24 @@ ARDOUR_UI::export_video (bool range)
        export_video_dialog->hide ();
 }
 
+XMLNode*
+ARDOUR_UI::preferences_settings () const
+{
+       XMLNode* node = 0;
+
+       if (_session) {
+               node = _session->instant_xml(X_("Preferences"));
+       } else {
+               node = Config->instant_xml(X_("Preferences"));
+       }
+
+       if (!node) {
+               node = new XMLNode (X_("Preferences"));
+       }
+
+       return node;
+}
+
 XMLNode*
 ARDOUR_UI::mixer_settings () const
 {
@@ -5629,9 +5661,6 @@ void
 ARDOUR_UI::cancel_solo ()
 {
        if (_session) {
-               if (_session) {
-                       _session->set_controls (route_list_to_control_list (_session->get_routes(), &Stripable::solo_control), 0.0, Controllable::NoGroup);
-               }
-               _session->clear_all_solo_state (_session->get_routes()); // safeguard, ideally this won't do anything, check the log-window
+               _session->cancel_all_solo ();
        }
 }