X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fvideo_server_dialog.cc;h=9422a53971dfc0485dc3bf62eac4e3bf2f88acb0;hb=2eae3b5cd19e845a2258fb578548c2b571e46348;hp=bc9e8be4420096af983318b44178ecda399eb3dd;hpb=2ba58dfe65bb0c5ba7d5eb18a1566fa79eeb6993;p=ardour.git diff --git a/gtk2_ardour/video_server_dialog.cc b/gtk2_ardour/video_server_dialog.cc index bc9e8be442..9422a53971 100644 --- a/gtk2_ardour/video_server_dialog.cc +++ b/gtk2_ardour/video_server_dialog.cc @@ -22,8 +22,14 @@ #include +#include +#include +#include +#include + #include "pbd/error.h" #include "pbd/file_utils.h" +#include "ardour/filesystem_paths.h" #include "ardour/session_directory.h" #include "gtkmm2ext/utils.h" #include "ardour/template_utils.h" @@ -35,7 +41,11 @@ #include "video_server_dialog.h" #include "utils_videotl.h" -#include "i18n.h" +#include "pbd/i18n.h" + +#ifdef PLATFORM_WINDOWS +#include +#endif using namespace Gtk; using namespace std; @@ -69,13 +79,10 @@ VideoServerDialog::VideoServerDialog (Session* s) HBox* docroot_hbox = manage (new HBox); path_entry.set_width_chars(38); - path_browse_button.set_name ("PaddedButton"); path_entry.set_text("/usr/bin/harvid"); docroot_entry.set_width_chars(38); - docroot_entry.set_text(Config->get_video_server_docroot()); - docroot_browse_button.set_name ("PaddedButton"); + docroot_entry.set_text(video_get_docroot (Config)); - listenaddr_combo.set_name ("PaddedButton"); #ifndef __APPLE__ /* Note: on OSX icsd is not able to bind to IPv4 localhost */ listenaddr_combo.append_text("127.0.0.1"); @@ -83,22 +90,27 @@ VideoServerDialog::VideoServerDialog (Session* s) listenaddr_combo.append_text("0.0.0.0"); listenaddr_combo.set_active(0); - std::string icsd_file_path; - if (find_file_in_search_path (PBD::Searchpath(Glib::getenv("PATH")), X_("harvid"), icsd_file_path)) { - path_entry.set_text(icsd_file_path); - } - else if (Glib::file_test(X_("C:\\Program Files\\harvid\\harvid.exe"), Glib::FILE_TEST_EXISTS)) { - path_entry.set_text(X_("C:\\Program Files\\harvid\\harvid.exe")); - } - else { + std::string harvid_exe; + if (ArdourVideoToolPaths::harvid_exe(harvid_exe)) { + path_entry.set_text(harvid_exe); + } else { PBD::warning << string_compose( - _("The external video server 'harvid' can not be found. The tool is included with the %1 releases from ardour.org, " - "alternatively you can download it from http://x42.github.com/harvid/ or acquire it from your distribution."), PROGRAM_NAME) + _("The external video server 'harvid' can not be found.\n" + "The tool is included with the %1 releases from ardour.org, " + "alternatively you can download it from http://x42.github.com/harvid/ " + "or acquire it from your distribution.\n" + "\n" + "see also http://manual.ardour.org/video-timeline/setup/" + ), PROGRAM_NAME) << endmsg; } - +#ifdef PLATFORM_WINDOWS + if (VideoUtils::harvid_version >= 0x000802) { + /* empty docroot -> all drive letters */ + } else +#endif if (docroot_entry.get_text().empty()) { std::string docroot = Glib::path_get_dirname(_session->session_directory().root_path()); if ((docroot.empty() || docroot.at(docroot.length()-1) != '/')) { docroot += "/"; } @@ -146,7 +158,6 @@ VideoServerDialog::VideoServerDialog (Session* s) if (Config->get_video_advanced_setup()){ vbox->pack_start (*docroot_hbox, false, false); } else { - docroot_entry.set_text(X_("/")); listenport_spinner.set_sensitive(false); } vbox->pack_start (*options_box, false, true);