changes to waveform clipping display
[ardour.git] / gtk2_ardour / ardour_ui.cc
index 8e29094cc6c434511beee09f13da79c35a5a4173..099854688885b354b2227a09e6f9a66a1080863f 100644 (file)
@@ -210,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;
@@ -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 ();