changes to waveform clipping display
[ardour.git] / gtk2_ardour / ardour_ui.cc
index 250a94baa43b3af2601fed0fb9821c31c1a92286..099854688885b354b2227a09e6f9a66a1080863f 100644 (file)
@@ -27,8 +27,6 @@
 #include <cerrno>
 #include <fstream>
 
-#include <boost/locale.hpp>
-
 #include <stdint.h>
 #include <fcntl.h>
 #include <signal.h>
@@ -212,6 +210,9 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
        }
 
        ui_config = new UIConfiguration();
+       ui_config->ParameterChanged.connect (sigc::mem_fun (*this, &ARDOUR_UI::parameter_changed));
+       boost::function<void (string)> pc (boost::bind (&ARDOUR_UI::parameter_changed, this, _1));
+       ui_config->map_parameters (pc);
 
        editor = 0;
        mixer = 0;
@@ -319,7 +320,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
 
        TimeAxisViewItem::set_constant_heights ();
 
-       /* load up the UI manager */
+        /* Set this up so that our window proxies can register actions */
 
        ActionManager::init ();
 
@@ -426,6 +427,8 @@ ARDOUR_UI::post_engine ()
 
        _tooltips.enable();
 
+       ActionManager::load_menus ();
+
        if (setup_windows ()) {
                throw failed_constructor ();
        }
@@ -813,13 +816,13 @@ ARDOUR_UI::check_memory_locking ()
                                                  "runs out of memory. \n\n"
                                                  "You can view the memory limit with 'ulimit -l', "
                                                  "and it is normally controlled by %2"),
-                                               PROGRAM_NAME).c_str()
+                                               PROGRAM_NAME, 
 #ifdef __FreeBSD__
-                                       X_("/etc/login.conf")
+                                               X_("/etc/login.conf")
 #else
-                                       X_(" /etc/security/limits.conf")
+                                               X_(" /etc/security/limits.conf")
 #endif
-                                       );
+                                       ).c_str());
 
                                msg.set_default_response (RESPONSE_OK);
 
@@ -3423,9 +3426,28 @@ ARDOUR_UI::start_video_server (Gtk::Window* float_window, bool popup_msg)
                        Config->set_video_advanced_setup(true);
                }
 
+               if (video_server_process) {
+                       delete video_server_process;
+               }
+
                video_server_process = new SystemExec(icsd_exec, argp);
-               video_server_process->start();
-               sleep(1);
+               if (video_server_process->start()) {
+                       warning << _("Cannot launch the video-server") << endmsg;
+                       continue;
+               }
+               int timeout = 120; // 6 sec
+               while (!ARDOUR_UI::instance()->video_timeline->check_server()) {
+                       usleep (50000);
+                       if (--timeout <= 0 || !video_server_process->is_running()) break;
+               }
+               if (timeout <= 0) {
+                       warning << _("Video-server was started but does not respond to requests...") << endmsg;
+               } else {
+                       if (!ARDOUR_UI::instance()->video_timeline->check_server_docroot()) {
+                               delete video_server_process;
+                               video_server_process = 0;
+                       }
+               }
        }
        return true;
 }
@@ -3455,8 +3477,12 @@ ARDOUR_UI::add_video (Gtk::Window* float_window)
        add_video_dialog->hide();
        if (r != RESPONSE_ACCEPT) { return; }
 
-       bool local_file;
+       bool local_file, orig_local_file;
        std::string path = add_video_dialog->file_name(local_file);
+
+       std::string orig_path = path;
+       orig_local_file = local_file;
+
        bool auto_set_session_fps = add_video_dialog->auto_set_session_fps();
 
        if (local_file && !Glib::file_test(path, Glib::FILE_TEST_EXISTS)) {
@@ -3515,6 +3541,11 @@ ARDOUR_UI::add_video (Gtk::Window* float_window)
                node->add_property (X_("Filename"), path);
                node->add_property (X_("AutoFPS"), auto_set_session_fps?X_("1"):X_("0"));
                node->add_property (X_("LocalFile"), local_file?X_("1"):X_("0"));
+               if (orig_local_file) {
+                       node->add_property (X_("OriginalVideoFile"), orig_path);
+               } else {
+                       node->remove_property (X_("OriginalVideoFile"));
+               }
                _session->add_extra_xml (*node);
                _session->set_dirty ();